Pentest Tools


Hashcat Cheatsheet

How to Install Hashcat

Hashcat installation:

Installation
username@machine_name:~$ sudo apt install hashcat

Useful Commands for Hashcat


-a [attack-mode]: Specify the attack mode (0: Dictionary, 1: Combination, 3: Brute-force, etc.)
-m [hash-type]: Specify the hash type (e.g., 0: MD5, 1000: NTLM, etc.)
-o [file]: Specify the output file
--username: Enable ignoring of usernames in the input file
--increment: Enable mask increment mode
-w [workload-profile]: Specify the workload profile (1: Low, 2: Default, 3: High, 4: Nightmare)
--session [name]: Specify a session name
--restore [name]: Restore a session by name
--show: Show cracked passwords
--potfile-disable: Disable the potfile

Examples of Hashcat Commands

Crack a password hash using a dictionary attack:

Dictionary Attack
username@machine_name:~$ hashcat -a 0 -m 0 /path/to/hashfile /path/to/wordlist.txt

Crack a password hash using a brute-force attack:

Brute-force Attack
username@machine_name:~$ hashcat -a 3 -m 0 /path/to/hashfile ?a?a?a?a

Enable mask increment mode for brute-force:

Mask Increment Mode
username@machine_name:~$ hashcat -a 3 -m 0 --increment /path/to/hashfile ?a?a?a?a

Specify the workload profile:

Workload Profile
username@machine_name:~$ hashcat -a 0 -m 0 -w 3 /path/to/hashfile /path/to/wordlist.txt

Save and restore session:

Save and Restore Session
username@machine_name:~$ hashcat -a 0 -m 0 --session=my_session /path/to/hashfile /path/to/wordlist.txt
username@machine_name:~$ hashcat --restore=my_session

Show cracked passwords:

Show Cracked Passwords
username@machine_name:~$ hashcat -a 0 -m 0 --show /path/to/hashfile

Disable the potfile:

Disable Potfile
username@machine_name:~$ hashcat -a 0 -m 0 --potfile-disable /path/to/hashfile /path/to/wordlist.txt