How parrotsec/mimikatz works
Project type and purpose
• This is a low-level Windows security tool written in C/C++ (“mimikatz.exe”) with an optional kernel-mode driver (“mimidrv.sys”).
• It provides modules (sekurlsa, kerberos, crypto, vault, lsadump, token, etc.) to extract credentials, tickets, hashes, perform pass-the-hash/ticket, Golden Ticket attacks, and interact with Windows security subsystems.
File structure
• Top-level:
• README.md – project overview and usage
• mimicom.idl – COM interface definitions (if any)
• kiwi_passwords.yar – YARA rules for password detection
• debian/ – Debian packaging metadata (control, rules, install scripts)
• Build output trees:
• Win32/ – 32-bit builds: mimikatz.exe, mimidrv.sys, mimilove.exe
• x64/ – 64-bit builds: mimikatz.exe, mimidrv.sys
• The presence of a driver (WinDDK) and a desktop executable indicates a split user‐mode vs kernel‐mode architecture.
Pulling architecture hints from the README
• Core “mimikatz.exe” loads modules at runtime (e.g., sekurlsa::, kerberos::, crypto::, vault::, lsadump::).
• An optional driver (“mimidrv.sys”) is used for operations requiring direct kernel memory access or to bypass certain OS protections.
• Uses standard Windows APIs (LSA, CryptoAPI, CNG, Vault, SAM, Kerberos).
Main components
a. User-mode CLI front-end (mimikatz.exe)
b. Module loader / plugin manager (dispatches sekurlsa, kerberos, crypto, vault, lsadump, token modules)
c. Native library “mimilib” (common code shared by modules)
d. Optional kernel-mode driver (mimidrv.sys)
e. Windows security subsystems & processes:
• LSASS.exe (local logon session data)
• CryptoAPI / CNG
• Vault API
• SAM database / Active Directory calls
• Local or remote KDC / Domain Controller for Kerberos
f. Debian packaging pipeline (dpkg-build, control, rules) – can be shown as a peripheral CI/CD component if desired.
Relationships and data flows
• CLI issues a module command → module loader → invokes module code in process
• Module code may:
• Call mimilib routines for parsing memory structures
• Call standard Win32 APIs (LSA, Crypt32, NCrypt)
• Communicate with mimidrv.sys via DeviceIoControl for raw memory read/write
• Driver runs in kernel context → reads LSASS memory or modifies kernel objects → returns data back to user-mode
• For Kerberos operations: module calls KERB protocol over RPC to KDC, or writes .kirbi files to disk
• For Debian packaging: source files + compiled binaries → dpkg packaging → .deb artifacts
Architectural patterns and design principles
• Modular / plugin architecture for security modules
• Clear separation of privileges: user-mode vs kernel-mode
• Reuse of common code via “mimilib”
• Build matrix for multiple architectures (Win32, x64, ARM64)
• Packaging integration (Debian) for cross-platform distribution
Recommendations for high fidelity
• Be precise about the user-mode vs kernel-mode boundary
• Detail each module’s major dependencies (e.g., sekurlsa → LSASS memory structures)
• Optional paths (if driver not installed, module falls back to API)
• Build inputs (Visual Studio projects, WinDDK) and packaging steps separately at the bottom or side