Challenge Author: Jeffery John
Description
“People keep trying to trick my players with imitation flags. I want to make sure they get the real thing! I’m going to provide the SHA-256 has and a decrypt script to help you know that my flags are legitimate.”
Process / Notes
- Downloading the file with
wget <link> - Unzip the download with
unzip <download>
- Saw that a lot of files got unzipped, originating in the
filesdirectory
cdinto thedrop-indirectorycat checksum.txt- Now we need to compare this checksum against the checksum for everything in the
filesdirectory - We can achieve that by first getting the checksums of every file in the
filesdirectory withsha256sum files/*
- Each line will display the checksum followed by the file the checksum is from
- Then we can pipe the result into
grepto produce online the line that matches the checksum from thechecksum.txtfile. sha256sum files/* | grep 'checksum-from-the-file'- Now that we have the proper file, we can run the decryption script with
./decrypt.sh files/the-file-with-the-flag
- There was an error when doing this one on the web-terminal and when performing it locally, but connecting with ssh and running the decryption ended up producing the proper flag
Hints
- Checksums let you tell if a file is complete and from the original distributor. If the hash doesn’t match, it’s a different file.
- You can create a SHA checksum of a file with
sha256sum <file>or all files in a directory withsha256sum <directory>/* - Remember you can pipe the output of one command to another with
|. Try practicing wtih the ‘First Grep’ challenge if you’re stuck!
Core Lessons
- You can get the checksums of a whole directory by using the ‘*’ wildcard
- You can narrow your search by piping the results into the
grepcommand