Skip to content

Commit 5cac43d

Browse files
committed
Add colored output, blank hash detection, and fix LM hash display
- Add --color auto|always|never for colored terminal output (TTY auto-detect) - Highlight usernames (bold), hashes (yellow), section headers (green), provider names (cyan), plaintext passwords (red), blank hashes (dim) - Annotate well-known blank password hashes with (blank) in text mode - Hide zero LM hashes in text mode (mimikatz convention: LM disabled) - Output aad3b435b51404eeaad3b435b51404ee for zero LM in ntlm/csv modes (impacket pwdump convention for downstream tool compatibility) - Add acknowledgements section for mimikatz, pypykatz, and impacket
1 parent def787c commit 5cac43d

4 files changed

Lines changed: 287 additions & 46 deletions

File tree

‎README.md‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ cargo build --release
105105
| `hashcat` | `--format hashcat` | Raw hashes: mode 1000 (NTLM), mode 2100 (DCC2) |
106106
| `csv` | `--format csv` | Machine-readable, all fields |
107107

108+
In `text` mode, well-known blank password hashes (`31d6cfe0...` for NTLM, `aad3b435...` for LM) are annotated with `(blank)`.
109+
110+
Use `--color auto|always|never` to control colored terminal output (default: `auto`, detects TTY). Colors highlight usernames, section headers, interesting hashes, and plaintext passwords.
111+
108112
## Example Output
109113

110114
### LSASS extraction (default text)
@@ -129,7 +133,6 @@ $ vmkatz snapshot.vmsn
129133
LogonServer: YOURPC
130134
SID: S-1-5-21-4247878743-2693906039-1959858616-1000
131135
[MSV1_0]
132-
LM Hash : 00000000000000000000000000000000
133136
NT Hash : bbf7d1528afa8b0fdd40a5b2531bbb6d
134137
SHA1 : 6ed12f1e60b17cfff120d753029314748b58aa05
135138
DPAPI : 6ed12f1e60b17cfff120d753029314748b58aa05
@@ -154,9 +157,9 @@ $ vmkatz --ntds /dev/pve/vm-102-disk-0
154157
Hashes extracted : 18
155158
156159
[+] AD NTLM Hashes:
157-
RID: 500 Administrator current NT:c66d72021a2d4744409969a581a1705e LM:00000000000000000000000000000000
158-
RID: 502 krbtgt current NT:9c238cafb7b4447e5f701c71dbdcf636 LM:00000000000000000000000000000000
159-
RID: 1000 vagrant current NT:e02bc503339d51f71d913c245d35b50b LM:00000000000000000000000000000000
160+
RID: 500 Administrator current NT:c66d72021a2d4744409969a581a1705e
161+
RID: 502 krbtgt current NT:9c238cafb7b4447e5f701c71dbdcf636
162+
RID: 1000 vagrant current NT:e02bc503339d51f71d913c245d35b50b
160163
...
161164
```
162165

@@ -266,3 +269,11 @@ Tested across 7 Windows versions and 4 hypervisors.
266269
5. **Disk extraction**: Parses the virtual disk container (sparse VMDK, VDI, QCOW2, VHDX, VHD), finds the Windows partition (MBR/GPT), walks NTFS MFT to locate `SAM`, `SYSTEM`, `SECURITY` hives, and decrypts hashes using the boot key.
267270

268271
6. **NTDS extraction**: For domain controllers (`--ntds`), locates `NTDS.dit` and the `SYSTEM` hive on disk, then parses the ESE (JET Blue) database natively. Traverses B+ trees to read the `datatable`, extracts the PEK (Password Encryption Key) using the bootkey, and decrypts NT/LM hashes for every AD account. Supports both 8KB pages (Windows Server 2019 and earlier) and 32KB large pages (Windows Server 2025), as well as RC4 (legacy), AES pre-Win2016, and AES Win2016+ (v0x13) hash blob formats.
272+
273+
## Acknowledgements
274+
275+
VMkatz builds on the foundational work of several projects that mapped out Windows credential internals:
276+
277+
- [**mimikatz**](https://github.com/gentilkiwi/mimikatz) by Benjamin Delpy ([@gentilkiwi](https://twitter.com/gentilkiwi)) -- the original Windows credential extraction tool. mimikatz's source code is the definitive reference for LSASS internals: SSP structures, crypto key resolution, credential decryption across Windows versions. VMkatz's 9-provider extraction pipeline follows the architecture Benjamin documented.
278+
- [**pypykatz**](https://github.com/skelsec/pypykatz) by Tamas Jos ([@skaborern](https://twitter.com/skaborern)) -- a pure Python reimplementation of mimikatz credential parsing. pypykatz's clean separation of minidump reading from credential decryption informed VMkatz's design, and its SAM/LSA/DCC2 extraction logic served as a cross-reference for offline registry decryption.
279+
- [**Impacket**](https://github.com/fortra/impacket) by Fortra (originally by Alberto Solino [@agsolino](https://twitter.com/agsolino)) -- the standard Python library for Windows network protocols. Impacket's `secretsdump.py` is the reference implementation for NTDS.dit extraction, SAM dumping, and the pwdump output format that VMkatz's `--format ntlm` follows.

‎src/lsass/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub(crate) mod cloudap;
22
pub(crate) mod credman;
33
pub(crate) mod crypto;
4+
pub use crypto::base64_encode;
45
pub(crate) mod dpapi;
56
pub mod finder;
67
pub(crate) mod kerberos;

‎src/lsass/types.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Convert Windows FILETIME (100-ns ticks since 1601-01-01) to a readable string.
2-
fn filetime_to_string(ft: u64) -> String {
2+
pub fn filetime_to_string(ft: u64) -> String {
33
if ft == 0 || ft == 0x7FFF_FFFF_FFFF_FFFF {
44
return "N/A".to_string();
55
}
@@ -57,7 +57,7 @@ fn filetime_to_string(ft: u64) -> String {
5757
}
5858

5959
/// Human-readable Windows logon type.
60-
fn logon_type_name(lt: u32) -> &'static str {
60+
pub fn logon_type_name(lt: u32) -> &'static str {
6161
match lt {
6262
0 => "UndefinedLogonType",
6363
2 => "Interactive",

0 commit comments

Comments
 (0)