description: I’m such a klutz! I know I hid a flag in this file somewhere, but I can’t remember where I put it! Song is from sukasuka.
hint: Sometimes I can’t tell my left from my right, either.
category: Forensics
In this chall, we have a mp3 file containing an amazing japanese song.
Of course, I tried using file, exiftool and binwalk command, but there were nothing interesting…
I load the file in Audacity, and given the hint, I made the difference between the 2 channels. There are 2 ways to do it:
- split the audio channels into two tracks (Black triangle -> Splitting a Stereo Track), invert the right channel (Select track -> Effect -> invert), set it to be a left channel (Black triangle -> Join Stereo Track) and mix the two tracks together again (Track -> Mix and render).
- The simple way is to use Audacity plugin voice remover (Effect > Vocal Reduction and Isolation)
Using one of those methods, we now have no signal… Or maybe we have a signal ? Let’s try to amplificate the signal (Effect -> Amplification), we can boost the signal to the maximum threshold.
Nice ! we can hear a voice telling us the flag: easyctf{4ud10_st3g}
description: I’ve created a new ASCII art generator, and it works beautifully! But I’m worried that someone might have put a backdoor in it. Maybe you should check out the source for me…
category: Reverse Engineering
Here is the source code given with the challenge:
Obviously we know that we’re going to exloit the eval call to print the flag.
Let’s have a look to the program core:
It loads the image given as argument
It computes some operations on pixels
After thoses lines, we have numbers between 0 and 15.
This step will convert those numbers to char in the ‘chars’ variable:
Then this variable ‘arr’ will be given to eval.
Now we have to find a good payload that will print the flag using only characters in the var ‘chars’.
We can simply test it using this code:
I tried:
Good ! We have to create an image that will be tranlated by exec(chr(112)+chr(114)+chr(105)+chr(110)+chr(116)+chr(40)+chr(102)+chr(108)+chr(97)+chr(103)+chr(41))
I’ll save you some time, don’t try to write on the image on multiple lines, for me it didn’t work, so the best way is to do it on one line.
We can generate the image using PIL:
Those methods will print the specified characters.
I would like to just call one by one every function to print the wanted strings, but the problem is that every 19 characters, a caracter is doubled. (because of the redimension)
You can test this by entering:
In the hurry I just make a very ugly code (don’t judge me) but it worked:
Now all we have to do is to drop the generated image on the website and we get the flag: easyctf{wish_thi5_fl@g_was_1n_ASCII_@rt_t0o!}
The two strings have the same length, so we can think that they have been encrypted with the same key.
Let K be the encryption key, C1 and C2 the two ciphers, and M1 and M2 the corresponding plain texts with:
C1 = M1 ⊕ K, C2 = M2 ⊕ K
Then, we have :
R = C1 ⊕ C2 = M1 ⊕ M2
If we consider that the plain texts are made with comprehensive english language, if we xor R with a word contained in M1 at the offset x in the string, it will reveal a part of the message M2.
So we need to xor R with a known or potential substring at the offset 0 of R.
If the result looks like an english word, it means that the substring may be in M1 or M2 at the offset 0.
Else, we need to do the same again at offset +1.
This method is called crib dragging.
For this challenge, we can presume that the substring ‘easyctf{‘ is contained in M1 or M2.
When xoring this substring with R, we find the substring “intext u” (let’s call it S) at the offset 76.
In order to find out from which cipher (C1 or C2) this substring comes from, we can xor S with C1 and C2, at the offset 76. This will reveal a part of the key.
With C2, it gives us :
:8+<*8t"
This looks pretty much like random text…
With C1, it gives us :
67, 182,
This one looks more like a pattern, with numbers, spaces and commas. It should be a part of the key.
At this point we know 8 characters from M1, M2 and K at the offset 76:
M1 : intext u
M2 : easyctf{
K : 67, 182,
Then we have two possibilities :
xor R with an english word that is likely to appear in a sentence in order to find another part of M1 or M2
guess parts of M1 or M2, then xor it with the corresponding cipher to check if the result looks like the key pattern
If we guess a part of one of the plain texts then it is quite easy to find out a part of the other plain text at the same offset.
In this challenge, the flag was at the en of the 2nd message M2 ( from offset 76 to the end ).
As the process to recover the flag is quite long, we didn’t take the time to recover the full plain texts, but only enough words from the end to be able to rebuild the flag.
We ended up with something like :
M1 : …can also refer to a sample of plaintext used in the breaking
M2 : ……you will never guess! flag is easyctf{otp_ttp_cr1b_dr4gz}
description: All you CTFers are sure getting on my nerves with your source-viewing and developer tools-ing! Alas, despite my best wishes, the experienced programmers on the wonderful website StackOverflow tell me that it’s impossible to keep you from looking at the HTML. But a disable right click script certainly won’t stop an experienced CTFer like you! So finding the flag in the source of this problem should be no trouble, right?
category: Web
When we launch the chall, a web page informs us that we have to use Chrome and enable Javascript.
So I used Chrome and nothing happended. After playing with Javascript options in Chrome browser, I finally ended up to the ‘real’ chall page.
Here you can’t use ‘right click -> inspect element’ or ‘ctrl+u’ because it will redirect you to the first page and you won’t be able to get the source code like that.
The way I did it was using Wireshark: I use it to sniff the network when we get the challenge page.
Then we can get the source code by following the stream. Here is the source code:
First let’s get rid of this html and build our javascript:
It seems that all we have to do is to print process(flag, key) and write it as entry:
We try this in entry, but it didn’t work…
We know the flag look like easyctf{…}
And we can see: e??????{…
Maybe the given key is not right. Let’s generate another one (we can see that the process methos only compute xor between entry and key):
Okay let’s set our new key (‘hoo_hoo’) and print the flag:
I want root access to this special programming portal, and this file is my only clue.
Maybe the password is inside? Even if it is, I’m not sure how to enter it.
nc c1.easyctf.com 12480
Oh! Almost forgot… this might help.
For this challenge, we’ve been given an image: encrypted.png.
The instructions say that the password might be in it…
When using strings on the picture, we get the following text:
note: the password is l7&4C&Cg
Also on the picture, we can see a pseudo mathematical expression with the followings:
FLAG
E(username) = root
E(password) = REDACTED
In the instructions, we can find a link to a page with the following expression written on it:
S : E { ExpS $1 }
| global var '=' E { GlobalVarS $2 $4 }
Seems like a parsing expression grammar…
The goal of this challenge is to connect to the c1.easyctf.com server and get the flag.
When we connect to the server, it displays the following output :
ctflang
commands begin with “:” (try :help)
:help gives us a little help saying that :
:help show this message
:end stop current multi-line parse
:q exit
note: certain language features only available to root users
The goal is clear : we have to login with username root and password l7&4C&Cg.
First, we can try a simple 1 + 1 which give us the output 2.
Good news ! Our expression is interpreted.
Then if we try username = "root", we get the following message : Could not evaluate statement or expression to a value.
So let’s try global username = "root" ! No error message…
Then entering username give us the output : "root".
It works the same with : global password = "l7&4C&Cg".
So we can try to print the flag with the command : flag.
Unfortunately it gives us the previous error message.
But if we try again username = "root", instead of an error message, we get a Yas !
Let’s try with password = "l7&4C&Cg" : and again we get a Yas !
Finally we just need to enter the command : flag to print the flag : EasyCTF{5m4ll_573p_53m4n71c5_4r3_fun_r16h7?}