Crack The Hash
Difficulty = Easy
Hola👋 Welcome back. Here is a walkthrough on CrackTheHash based on TryHackMe. It covers learning how to crack a hash by using different methods, such as online hash cracking tools or tools like hashcat and John. Let’s get started; it’s fun 😆
What is Hash 🤔?
Hash: A hash is a unique string of characters generated by applying a mathematical algorithm to some input data. This algorithm takes the input (such as a password or any other piece of data) and produces a fixed-size string of characters, which is the hash. Hashes are used to secure passwords, verify data integrity, generate digital signatures, identify duplicate data, and perform cryptographic operations. They uniquely represent data in a secure manner.
Task 1: Level 1
Q1: 48bb6e862e54f2a795ffc4e541caed4d
-
First, we’re given a hash to crack. Before cracking it, we need to determine its hash type. There are different types of hashes, such as MD5, SHA256, bcrypt, and others. To identify the hash type, we can use various tools, including online hash identifier websites or specific software tools. In this case, I used a hash identifier tool designed for identifying hashes.
-
By using it, we could see possible results which is md5.
- Got the hash type. Now let’s crack it. We can use a variety of tools here, such as web tools or software tools. In this case, I’m using John 😎.
john --wordlist=/usr/share/wordlists/rockyou.txt --format=raw-md5 hashes.txt
- Answer: easy
Q2: CBFDAC6008F9CAB4083784CBD1874F76618D2A97
- For determining the type of hash, I decided to use another tool called haiti.
- Using john the ripper again:
sudo john --wordlist=/usr/share/wordlists/rockyou.txt --format=raw-sha1 hashes1.txt
- Answer: password123
Q3: 1C8BFE8F801D79745C4631D09FFF36C82AA37FC4CCE4FC946683D7B336B63032
- Identifying our hash, it is SHA256(Secure Hash Algorithm 256).
- Then john
sudo john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-SHA-256 hashes2.txt
- Answer: letmein
Q4: $2y$12$Dwt1BZj6pcyc3Dy1FWZ5ieeUznr71EeNkJkUlypTsgbX1H68wsRom
-
FOR THIS WE ARE GIVE A HINT: Search the hashcat examples page hashcat for $2y$. This type of hash can take a very long time to crack, so either filter rockyou for four character words, or use a mask for four lower case alphabetical characters.
-
Taking a look at the site, the hash type is bcrypt (is widely used for securely storing passwords in databases and is considered one of the most secure password hashing algorithms available)
- We were given instructions to filter “rockyou” for four-character words or use a mask for four lowercase alphabetical characters. i did.
cat /usr/share/wordlists/rockyou.txt | grep -o -w '\w\{4\}' > 4rockyou.txt
sudo john --wordlist=./4rockyou.txt --format=bcrypt hashes3.txt
- Answer: bleh
Q5: 279412f945939ba78ce0758d3fd83daa
- For this, I used the online hash cracking tool CrackStation (is commonly used as an online password hash cracker.)
- Answer: Eternity22
Task 2: level 2
This task increases the difficulty. All of the answers will be in the classic rock you password list. You might have to start using hashcat here and not online tools. It might also be handy to look at some example hashes on hashcats page.
Q1: Hash: F09EDCB1FCEFC6DFB23DC3505A882655FF77375ED8AA2D1C13F640FCCC2D0C85
- Hash types is SHA-256(which is secure)
sudo john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-SHA256 hashes5.txt
- Answer: paule
Q2: 1DFECA0C002AE40B8619ECF94819CC1B
- Hash type: NT refers to the NTLM (New Technology LAN Manager) hash
sudo john --wordlist=/usr/share/wordlists/rockyou.txt hashes6.txt --format=NT
- Answer: n63umy8lkf4i
Q3: Hash: $6$aReallyHardSalt$6WKUTqzq.UQQmrm0p/T7MPpMbGNnzXPMAXi4bJMl9be.cfi3/qxIf.hsGpS41BqMhSrHVXgMpdjS6xeKZAs02.
Salt: aReallyHardSalt
A salt is a random string of characters that is added to the input data before it is hashed.
- Check the Hashcat page. We can see it’s SHA-512(SHA-512 hashes start with the characters “$6$”) hash type. So, I’m using Hashcat to crack it. This might take a while.
- hash type in hashcat is -1800
hashcat -m 1800 "\$6\$aReallyHardSalt\$6WKUTqzq.UQQmrm0p/T7MPpMbGNnzXPMAXi4bJMl9be.cfi3/qxIf.hsGpS41BqMhSrHVXgMpdjS6xeKZAs02." /usr/share/wordlists/rockyou.txt — show
- Answer: waka99
Q4: Hash: e5d8870e5bdd26602cab8dbe07a942c8669e56d6
Salt: tryhackme
- Hint: HMAC-SHA1
- This might take a while, so by setting the mode to 160, we’ll get the answer.
hashcat -m 160 "e5d8870e5bdd26602cab8dbe07a942c8669e56d6:tryhackme" /usr/share/wordlists/rockyou.txt
- Answer: 481616481616
And we are done 👋! That’s all, friends. Thank you for reading up to this point. I would like to hear your feedback on anything not clear here. Here is my Twitter account @T3chnocr4t. Feel free to DM me if you have any issues with my write-up. Thanks!