Skip to content

Crack Hash

Alvin Smith edited this page Aug 24, 2021 · 5 revisions

Identify

SUM

md5sum sha1sum

Online Resources

Cracker

Hash Example

https://hashcat.net/wiki/doku.php?id=example_hashes

Hashcat

https://hashcat.net/wiki/doku.php?id=hashcat

https://github.com/frizb/Hashcat-Cheatsheet

hashcat -a 0 -m 1800 hash /usr/share/wordlists/rockyou.txt

John the Ripper

https://countuponsecurity.files.wordpress.com/2016/09/jtr-cheat-sheet.pdf

--format=Raw-MD5

$/usr/share/john/ssh2john.py encryptedKey > hash
john --format=ssh hash

Pipe

base16 / hex

echo hash | xxd -r -p cat hash | xxd -r -p xxd -r -p hash

base64

echo -n hash | base64 -d cat hash.txt | base64 -d base64 -d hash

echo <base64> | base64 -d -w 0 > x.zip
echo -n '{"company":"The Best Festival Company", "username":"santa"}' | xxd -p

Asymmetric Encryption

Openssl

  • To generate a private key we use the following command (8912 creates the key 8912 bits long):

openssl genrsa -aes256 -out private.key 8912

  • To generate a public key we use our previously generated private key:

openssl rsa -in private.key -pubout -out public.key

  • Lets now encrypt a file (plaintext.txt) using our public key:

openssl rsautl -encrypt -pubin -inkey public.key -in plaintext.txt -out encrypted.txt

  • Now, if we use our private key, we can decrypt the file and get the original message:

openssl rsautl -decrypt -inkey private.key -in encrypted.txt -out plaintext.txt

Clone this wiki locally