Hi! My name is Isaac Basque-Rice, I'm A Security Engineer and former Abertay Ethical Hacker, and this website is a repository for all the cool stuff I've done, enjoy!
(originally published Oct 17 2019)
This is the first in my series of “Capture The Flag” walkthroughs for tryhackme, and as such I feel as if It’s probably best to start with a fairly easy CTF, that is c4ptur3-th3-fl4g: A beginner level CTF challenge, by dcdavidlee. This CTF Covers a few of the basics of what to expect in a CTF and is an excellent foundation for someone to build their skills over time.
This CTF has 5 Tasks, these are Translation & Shifting, Hashes, Spectrograms, Steganography, and Security through Obscurity.
This section requires the player to perform a number of fairly standard translations and cipher solves in order to obtain the flag, including but not limited to Binary and Hexadecimal to ASCII, as well as Morse, and, as we will see in a second, the hacker’s CLASSIC… 13375p34k
13375p34k is, as I’m sure you’ll know, “a system of modified spellings used primarily on the Internet”, where some letters are replaced by numbers and other spellings (as in hax0rz, pwned, and n00b). This is clearly in 1337, no question about it.
Flag: can you capture the flag?
Does the series of 1’s and 0’s give it away? This is binary, the “language of computers” as journalists correctly, but all too frequently, point out for the benefit of those not terribly technologically inclined.
I made use of RapidTables’s Binary to Text Translator for this question, which worked a treat.
Flag: lets try some binary out!
Okay, now it’s getting into slightly newer territory! This question deals with Base32 values, base 32 being a number system that is made up of the 26 letters of the English alphabet (A-Z) AS WELL AS the numbers 2–7, allowing for a total of 32 usable characters in each position.
There are several ways you’re able to tell apart Base32 from other bases, it’s definitely not lower than base 10 because there are letters involved, it’s not as high as Base64 because (as we will see), there are no lower-case characters and the numbers 0-1 and 8–9 aren’t represented.
I used Base32 Decode Online.
Flag: base32 is super common in CTF’s
This is in Base64, you can tell because lower case characters are included this time, pretty cut and dry.
I used Base64 Decode and Encode.
Flag: Each Base64 digit represents exactly 6 bits of data
This is in Hexadecimal, or Base16. Each character is always 1 byte, or 8 bits long, helpfully each hexadecimal number is 4 bits, meaning 2 hex digits can ALWAYS represent a character in ASCII.
The way you can tell it’s in hex is the spacing between each couplet and the character set, that is 0–9 then a-f, adding to 16.
I used RapidTables again for this conversion.
Flag: hexadecimal or base16?
ROT13 is an extremely simple cipher where each letter in a phrase is “rotated” 13 times, so that a letter becomes the letter 13 places after it, for example A <-> N, I <-> V, and so on (my name is Vfnnp, as an extra example you didn’t ask for.) Rot13 is its own inverse because 13 is half 26, there are 26 letters in the alphabet, meaning that the letter A will translate to N and the letter N will translate back to A, making the cipher trivial to break.
To speed things up, I used rot13.com.
Flag: Rotate me 13 places!
This is a Rot47 cipher, it’s the same basic principle as the Rot13 but instead of using just the letters A-Z, it uses all characters in the ASCII encoding table, A-Z, 0–9, punctuation, and so on.
I used dcode’s decoder for this cipher
Flag: You spin me right round baby right round (47 times)
It’s Morse code, Dots and dashes, you know? Just obvious I suppose, not much more else to say here
I used browserling’s Morse code decoder
Flag: telecommunication encoding
This is much the same as the previous translation and decoding questions (using hex and base64 and whatnot) but instead this time we’re using good ol’ reliable base 10, 0–9, what’s known as BCD, or Binary Coded Decimal, where each number represents its value in binary, which is then converted to ASCII and spat out as a series of letters and numbers. Regardless, Base10 is what we’re used to, great stuff.
I returned to Cryptii’s decoder for this task.
Flag: Unpack this BCD
Oh boy…
This one was a long winded one, so I’ll spare the screenshots and the links to decoders and what have you.
This question was designed to make sure you were paying attention, the original message was in Base 64, as one can tell from the mixture of upper and lower case characters. This decoded into Morse, which itself decoded into Binary, which then decoded into a ROT47 cipher, which THEN decoded to decimal, and FINALLY spat out…
Flag: Let’s make this a bit trickier…
Someone’s having a giggle…
The author recommends brute forcing these hashes through hashcat, however the constraints of my system means this will take over a day. Websites such as md5decrypt work especially well for this as the hashes should already be stored in their databases. In CTFs you take what you can, I suppose.
Once I resolved to use md5decrypt I realised that whilst this section was still one of the longest, it was just a matter of finding what hash was used for each flag and using that to crack it.
This hash had the hint “This method of encryption is no longer considered ‘secure’. It’s an MD, but which one?”, which told me that it was encoded using Message Digest 2, the simplest (read: most insecure) in the series of MD hashes that provide 128-bit values
Flag: MDwhat?
The hint here is “Better than MD2, but not as good as MD5”, which means it’s using MD4.
Flag: digest the message algorithm
This question didn’t have a hint, however, I reasoned that seen as how the last two hashes were both MD and went up in difficulty to crack, logically this next hash must be MD5, I was correct
Flag: 128-bit of delicious hash values
The hint here is “SoftMicro”, Which fairly transparently is a reference to Microsoft. After a bit of research I discovered that Microsoft has a somewhat proprietary hashing algorithm called NTLM, or New Technology (Microsoft’s Kernel) LAN Manager.
Flag: Microsoft has encryption?
The hint was “My heart goes SHAlalalala SHA lala 512 times!”. The capitalisation of the word SHA plus the mention of the number 512 means that this is a SHA512 Hash, (SHA for Secure Hashing Algorithm, and 512 for the digest, or hash value size in bits).
Flag: 1024 bit blocks!
There was no hint here, once again. I thought, however, maybe seen as how the last hash was a SHA512, maybe this is a SHA hash of half the digest of the previous one? This was correct, so I used the SHA256 Decryption algorithm on it.
Flag: Commonly used in Blockchain
The hint here was “The First SHA”, Must be SHA-1
Flag: The OG
According to Wikipedia, A spectrogram is “a visual representation of the spectrum of frequencies of a signal as it varies with time. When applied to an audio signal, spectrograms are sometimes called sonographs, voiceprints, or voicegrams. When the data is represented in a 3D plot they may be called waterfalls.”
The hint here was “audacity”.
To do this question I recommend already having installed an audio editing program, my personal recommendation (as well as the recommendation of the author) is Audacity. You can install it off the website or, if you are so inclined, use the command:
sudo apt-get install audacity
Once installed, open the file given to you (called secretaudio.wav) and change the view from waveform to spectrogram in the menu with the downwards facing black triangle off to the side, like so:
As you can see, it now displays the flag
Flag: Super Secret Message
Steganography is “The process of hiding a message or file within another message or file”
I used futureboy.us’s steganography decoder on the image, as you can see below:
Flag: SpaghettiSteg
Finally, I solved this section in a manner that I don’t believe was intended, but hey, that’s what hacking is isn’t it?.
I opened up the file in a text editor, scrolled to the bottom, and found the two flags in plaintext
Flag1: hackerchat.png
Flag2: AHH_YOU_FOUND_ME!
This CTF Is pretty good, and works an absolute treat for beginners, I’d recommend it to my nan, if she ever wanted to become a 1337 h4x0r.
If you learned something from this, why not send me over a little tip by way of thanks? No pressure but it would be much appreciated :)