First let’s take a look a these different files. I have one zip who contain a flag, but the zip ask for a password, and I have a picture who seems to be corrupt.
First I use hexyl to view the header of the corrupt picture
The header seems not be the good header for a png file, the correct header is :
89 50 4E 47 0D 0A 1A 0A
With hexedit I changed the corrupt header by the good one.
I tried to open the picture but I get an error with “IDAT”. So I decided to compare the file with a good png to see what is the good header for the IDAT :
The left one is the good png, and the right one it the corrupt png. We can see that the IDAT header is not good. It should be :
00 20 00 49 44 41 54 78
So I changed it with hexedit. Now I can open the picture :
Let’s unzip the zip file with the password : h4CK3RM4n
, but it’s not the good password. The hint of the challenge may be of some help :
You may have to hash the secret word to get the flag...
I hashed the password with md5sum :
echo -n "h4CK3RM4n" | md5sum
2c919f82ee2ed6985d5c5e275d67e4f8 -
Unzip the file with the hashed password :
unzip -P 2c919f82ee2ed6985d5c5e275d67e4f8 tryme.zip
Archive: tryme.zip
extracting: flag.txt
The flag :
pctf{y0u_s33_m33_n0w!}