Hackcon 2015: Frag Grenade
Category: misc - Points: 50
Description: flag is here
We are given the fragG.zip
and when we extract it we obtain 715 .shredC
files:
00M73.shredC 0564G.shredC 08GIC.shredC 0B2GJ.shredC 0E2HD.shredC 0FRDU.shredC 0K842.shredC 0LYRZ.shredC 0S1NG.shredC 0TAKA.shredC 0VQEL.shredC 0XHQ0.shredC 0ZR0M.shredC 01IXJ.shredC 05GXI.shredC 08UKO.shredC 0D70A.shredC 0EQD2.shredC 0H7RW.shredC 0L1FB.shredC 0NUX7.shredC 0T16C.shredC 0V4S9.shredC 0WAAG.shredC 0ZGVW.shredC ...
Let’s sample the contents of the first files to have an idea:
00M73.shredC
0564G.shredC
08GIC.shredC
This seems to be a C program divided in multiple fragments. The filename order does not seem to reflect the original order in the C source file (which we can suppose is expressed by the last line in each file having format lineXXX
). We wrote a this python script in order to reassemble the file:
We can now inspect the resulting file, which contains a lot of the following blocks:
The main
function instead is:
The getX()
functions return a single character:
By the way, if we compile and execute the resulting code we get the following output:
$ gcc output.c -o output
$ ./output
MY PASSWORD IS: Iheartpwnage
Now SHA-256 it and submit
So we just have to SHA256(Iheartpwnage) to obtain the flag:
330b845f32185747e4f8ca15d40ca59796035c89ea809fb5d30f4da83ecf45a4