Hashing and Integrity Solutions lab

This is a lab that I did at home using my just my Macbook pro to work on my hash generating skills using different operating systems. I was tasked with questions that i had to find the answers to in a capture the flag type format!

Question 1 - Using the command: echo -n texthere | md5sum, what is the md5 hash of the following sentence (without the quotes): "BTL1 rocks!"

Echo will write the provided words (strings) back to the terminal. But by piping it (sending the output to) md5sum, it will take ‘BTL1 rocks!’ and hash it using the MD5 algorithm, giving me the answer.

Question 2 - Using the same command as above, but with a slight change, generate the sha256 hash of the same sentence

By changing the pipe to md5sum to sha256 sum instead, I got my answer for this question.

Question 3 - In PowerShell, what command would you use to retrieve the SHA1 hash value of a file named "hashthis.jpg"?

In this hypothetical question, I know from the that I can use the Get-FileHash cmdlet, using the algorithm flag (-algorithm) to specifically state SHA1. The answer is Get-FileHash -algorithm SHA1 hashthis.jpg.

Question 4 - Using a linux terminal, what command would we use to retrieve the MD5 hash of a file named "hashthis.jpg"?

In a Linux-based terminal, I would use the ‘sum’ command, with the hashing algorithm in front of it. So for MD5, I used md5sum.

Question 5 - Generate the MD5, SHA1, and SHA256 hashes of the image "tastypancakes.jpg" and submit the first 5 characters of each. Answer this question in the format: MD5First5 SHA1First5 SHA256First5

I know for this question i'll be using md5sum, sha1sum, and sha256. I could run these commands individually, but i decided to use && to chain them together.

Question 6 - On your host machine, find a website that decodes MD5 hashes and enter the value "1f3870be274f6c49b3e31a0c6728957f". What is the plaintext string?

After a quick Google search, I found the website MD5 Online | Free MD5 Decryption, MD5 Hash Decoder. I entered the MD5 hash and clicked Decrypt. I was told the hash is the same as the string ‘apple’.

This lab was an efficient way of keeping my hashing skills sharp and just good practice overall! Big shout out to security blue team for the lab platform.