A Python script to extract Windows password hashes, LSA secrets, and OS version information from an offline Windows partition. It is intended to be used on a (preferably) Kali live USB.
HashDumper automates the following steps:
- Verifies required dependencies (
impacket-secretsdump,hivexget). - Prompts for the Windows partition device (e.g.,
/dev/nvme0n1p3). - Detects the filesystem type (NTFS, VFAT, exFAT) and mounts it read-only to
/mnt/windows. - Copies the registry hive files (
SYSTEM,SAM,SECURITY,SOFTWARE) to/tmp/dump/to avoid permission and hibernation issues. - Extracts the boot key from the
SYSTEMhive usingimpacket-secretsdump. - Dumps local SAM hashes and LSA secrets from the copied hives.
- Extracts Windows version details (
ProductName,CurrentVersion,CurrentBuild) from theSOFTWAREhive usinghivexget. - Saves all output to
dump.txt. - Unmounts the partition safely.
- Checks if the Administrator hash (RID 500) was successfully extracted.
- Python 3
impacket-scripts(providesimpacket-secretsdump)libhivex-bin(provideshivexget)ntfs-3g(for mounting NTFS partitions)- Root privileges (the script uses
sudofor mounting and copying) - Debian environment (tested on Kali Linux)
Install the required packages:
sudo apt update
sudo apt install -y impacket-scripts libhivex-bin ntfs-3gClone or download the script:
git clone https://github.com/eufrate/HashDumper
cd HashDumperRun the script with root privileges:
sudo python3 hashdumper.pyThe script will guide you through the process:
- It checks for missing dependencies and offers to install them.
- It creates
/mnt/windowsand/tmp/dumpif they do not exist. - It lists available disks with
fdisk -l. - You are prompted to enter the partition device name (e.g.,
nvme0n1p3orsda2). - The script mounts the partition read-only, copies the registry hives, and performs the extraction.
- After completion, it unmounts the partition and reports success or failure.
The extracted data is written to dump.txt in the current working directory. The file contains:
SAM– local user hashes (NTLM/LM)SECURITY– LSA secrets (cached domain credentials, service passwords, etc.)ProductName– Windows edition (e.g.,Windows 10 Pro)CurrentVersion– kernel version (e.g.,6.3)CurrentBuild– build number (e.g.,19045)
Example output format:
SAM = Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
SECURITY = $MACHINE.ACC: ...
...
ProductName = Windows 10 Pro
CurrentVersion = 6.3
CurrentBuild = 19045
- The script mounts the Windows partition read-only (
-o ro), so it is safe to use even if Windows is hibernated or has Fast Startup enabled. - Administrator privileges are required for mounting and copying files.
- The boot key is extracted from the
SYSTEMhive and truncated to 32 hexadecimal characters (the0xprefix is removed). - If
impacket-secretsdumporhivexgetare not found, the script offers to install them automatically. - The script supports NTFS, VFAT, and exFAT filesystems.
-
Command not found: impacket-secretsdump
Ensureimpacket-scriptsis installed. The script attempts to install it if missing. -
Command not found: hivexget
Ensurelibhivex-binis installed. The script attempts to install this too if it doesn't detect it. -
mount: unknown filesystem type 'ntfs-3g'
Installntfs-3g(sudo apt install ntfs-3g). -
No such file or directorywhen accessing registry hives
Verify that the partition is mounted correctly and that the path/mnt/windows/Windows/System32/config/exists. Uselsto check. -
Empty or missing output in
dump.txt
Check the error messages in the file. Common causes: missing boot key, corrupted hives, or insufficient permissions.
This tool is intended for authorized security testing and forensic analysis only. Use it only on systems you own or have explicit written permission to examine. Unauthorized access to computer systems is illegal.