Jasper Alblas
Jasper Alblas
Cryptography is essential in security. In this walkthrough of the Crypto 101 room on THM we will cover hashing!
I am making these walkthroughs to keep myself motivated to learn cyber security, and ensure that I remember the knowledge gained by THMs rooms. Join me on learning cyber security. I will try and explain concepts as I go, to differentiate myself from other walkthroughs.
Room URL: https://tryhackme.com/room/hashingcrypto101
Before we start, we need to get some jargon out of the way.
Read these, and take in as much as you can. We’ll expand on some of them later in the room.
Plaintext — Data before encryption or hashing, often text but not always as it could be a photograph or other file instead.
Encoding — This is NOT a form of encryption, just a form of data representation like base64 or hexadecimal. Immediately reversible.
Hash — A hash is the output of a hash function. Hashing can also be used as a verb, “to hash”, meaning to produce the hash value of some data.
Brute force — Attacking cryptography by trying every different password or every different key
Cryptanalysis — Attacking cryptography by finding a weakness in the underlying maths
This room will likely involve some research. Get good at using search engines, it’s crucial to infosec.
Answer: encoding
A hash function takes an input of any size and produces a fixed-size output (digest). Unlike encryption, there’s no key, and reversing the process is extremely difficult. A good hash function ensures that even a tiny change in input drastically changes the output. The result is usually encoded in formats like hexadecimal or base64.
Hashing is widely used in cybersecurity, particularly for password verification. When you log into a system, it checks your stored hash instead of your actual password.
A hash collision occurs when two different inputs produce the same hash. While rare in strong algorithms, it’s inevitable due to the limited number of possible outputs. MD5 and SHA1 have been compromised through collision attacks, making them unsuitable for security purposes.
Read carefully. The output of the MD5 hash function is 128 bits large. Divide that by 8 (number of bits in a byte) and you get 16.
Answer: 16
You have have any output, but can expect a set number of outputs. Therefore hash collisions are theoretically impossible to avoid.
Answer: Nay
8 bits give 256 possibilities (2 ^8).
Answer: 256
Storing passwords in plaintext is dangerous, as seen in past data breaches (e.g., RockYou, Adobe, LinkedIn). Encrypting passwords is also insecure if the key is exposed.
Instead, hashing is used for password storage. By storing only the hash of a password, even if the database is leaked, attackers must crack each password individually. However, hashing alone has weaknesses:
To counteract this, a salt (a unique, random value) is added to each password before hashing. This ensures that even identical passwords generate different hashes, preventing precomputed attacks. Modern hashing algorithms like bcrypt and sha512crypt automatically incorporate salting. Salts don’t need to be secret but must be unique per user.
Simply find the hash in the rainbow table and fits its value.
Answer: basketball
Go the https://hashes.com/en/decrypt/hash and enter the above hash.
Answer: encoding
No. It is possible to encrypt password, but you still need to store the key somewhere. If this gets stolen you can easily decrypt the password. So…encrypting? NO. Hashing? Yes.
Answer: Nay
Automated hash recognition tools like hashID can help but are often unreliable, especially for formats without prefixes. Context is crucial—MD5 is more common in web databases, while NTLM is used for Windows passwords.
For other hash types, use hash length, encoding, or research to determine the format. The Hashcat example page (https://hashcat.net/wiki/doku.php?id=example_hashes) is a great reference.
If you do not use the rounds option when running sha512crypt, the number of rounds is set to 5000. Source: https://wiki.archlinux.org/title/SHA_password_hashes
Answer: 5000
A quick google search on “Citrix Netscaler hash” brought me to the following website:
https://hashcat.net/wiki/doku.php?id=example_hashes
Answer: 1765058016a22f1b4e076dccd1c3df4e8e5c0839ccded98ea
Same website and table as above. You lookup NTLM in the table and find that the hash is 32 characters long.
Answer: 32
Hashes can’t be decrypted; they must be cracked by hashing different inputs until a match is found. Tools like Hashcat and John the Ripper are commonly used for this.
GPUs have thousands of cores optimized for hash function calculations, making them much faster than CPUs for cracking most hashes. However, bcrypt is designed to resist GPU acceleration.
VMs usually lack direct access to the host’s GPU, making Hashcat slower unless configured with OpenCL. John the Ripper, which runs on CPUs, works fine in a VM but performs better on a host OS.
Never use –force in Hashcat—it can lead to false positives and negatives, making cracking unreliable.
Now, it’s time to crack some hashes using online tools, wordlists (like Rockyou), or brute force with Hashcat/John the Ripper!
Start by adding the hash to a text file:
echo '$2a$06$7yoU3Ng8dHTXphAg913cyO6Bjs3K5lBnwq5FJyA6d01pMSrddr1ZG' > hash.txt
Pay attention to the prefix. This points us to the hash type bcrypt (See task 4). Then run the following command using John the Ripper:
john hash.txt -format=bcrypt — wordlist=/usr/share/wordlists/rockyou.txt
Answer: 85208520
This apparantely is in a SHA2–256 hash format, which I found about here:
https://www.tunnelsup.com/hash-analyzer
john hash.txt -format=raw-sha256 — wordlist=/usr/share/wordlists/rockyou.txt
Answer: halloween
This is of the hash format sha512crypt (see previous task). The command is therefore:
john hash.txt — format=sha512crypt — wordlist=/usr/share/wordlists/rockyou.txt
Answer: spaceman
This hash is of type MD4 or MD5, which I found about here:
https://www.tunnelsup.com/hash-analyzer
John The Ripper has trouble figuring this one out, so I used https://hashes.com/en/tools/hash_identifier instead.
Answer: funforyou
Hashing ensures file integrity by producing a consistent output for the same input. E modifications,change and identifying duplicates.ven a single-bit results in a completely different hash, making it useful for verifying file integrity, detecting
HMAC (Hash-based Message Authentication Code) enhances security by combining a cryptographic hash with a secret key. It ensures both authenticity (verifying the sender) and integrity (ensuring data hasn’t been altered). For example, TryHackMe VPN uses HMAC-SHA512 for message authentication.
It’s the first one on the list here:
http://old.kali.org/kali-images/kali-2019.4/SHA1SUMS
Answer: 186c5227e24ceb60deb711f1bdc34ad9f4718ff9
The hashcat mode number for the hash-name HMAC-SHA512 can be found here:
https://hashcat.net/wiki/doku.php?id=example_hashes
Answer: 1750
That was it folks, for this walkthrough of the Hashing – Crypto 101 Room on TryHackMe! It’s quite a difficult subject, but I hope you ended up a bit wiser nonetheless 🙂
You can find more of my walkthroughs here.
You are welcome to comment on this article, or share it with friends!
I would be so grateful if you support me by buying me a cup of coffee:
I learned a lot through HackTheBox’s Academy. If you want to sign up, you can get extra cubes, and support me in the process, if you use the following link: