A cheat-sheet for password crackers
A cheat-sheet for password crackers
@
In this ar cle I am going to share some bash scrip ng commands and regular expressions which I find useful in password
cracking. Most of the me, we find hashes to crack via shared pastes websites (the most popular of them being Pastebin.)
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Isola ng the hashes by hand can be a me consuming process; for that reason we are going to use regular expressions to make
our life easier!
Note: The above regexes can be used for SHA1, SHA256 and other unsalted hashes represented in hex. The only
thing you have to do is change the '{32}' to the corresponding length for your desired hash-type.
Extraxt phpBB3-MD5
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
# egrep -o '$H$S{31}' *.txt > phpBB3-md5.txt
Extract Wordpress-MD5
# egrep -o '$P$S{31}' *.txt > wordpress-md5.txt
Extract Drupal 7
# egrep -o '$S$S{52}' *.txt > drupal-7.txt
Extract md5-apr1
# egrep -o '$apr1$w{8}S{22}' *.txt > md5-apr1.txt
For extrac ng HTTPS, FTP and other URL format use # grep -E '(((https|ftp|gopher)|mailto)[.:][^ >" ]*|www.
[-a-z0-9.]+)[^ .,; >">):]' *.txt > urls.txt
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Note: if grep returns "Binary file (standard input) matches" use the following approaches # tr '[\000-\011\013-
\037177-377]' '.' < *.log | grep -E "Your_Regex" OR # cat -v *.log | egrep -o "Your_Regex"
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Extract US Passport Number
# grep -E -o "[23][0-9]{8}" *.txt > us-pass-num.txt
WordList Manipulation
Remove the space character with sed
# sed -i 's/ //g' file.txt OR # egrep -v "^[[:space:]]*$" file.txt
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
# tr [A-Z] [a-z] < file.txt > lower-case.txt
# tr [a-z] [A-Z] < file.txt > upper-case.txt
Note: if you want to isolate all columns a er column 3 use # cut -d "," -f 3- infile.csv > outfile.csv
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
=]'
# tr -dc '[:print:]' < /dev/urandom | fold -w 10| head -n 10
# tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n2
Faster sorting
# export alias sort='sort --parallel=<number_of_cpu_cores> -S <amount_of_memory>G ' && export LC_ALL
='C' && cat file.txt | sort -u > new-file.txt
Mac to unix
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
# tr '\015' '\012' < in_file > out_file
Dos to Unix
# dos2unix file.txt
Unix to Dos
# unix2dos file.txt
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
# time ack-grep -o "\b[a-zA-Z0-9.#?$*_-]+@[a-zA-Z0-9.#?$*_-]+.[a-zA-Z0-9.-]+\b" *.txt > /dev/null
real 1m2.447s
user 1m2.297s
sys 0m0.645s
real 0m10.851s
user 0m13.069s
sys 0m0.092s
real 0m6.689s
user 0m7.881s
sys 0m0.424s
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
@
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD