TL;DR: Week 12 of the #MagnetWeeklyCTF was a return to the browser that shalt not be named.
Review
Check out the week 1 blog post for how to get started on the Magnet Weekly CTF.
Get the first challenge
The weekly challenge for week 11 was again only two parts. The first was:
What is the PID of the application where you might learn “how hackers hack, and how to stop them”? Format: #### Warning: Only 1 attempt allowed!
“Only 1 attempt allowed” made me walk super carefully through this question because I had no desire to drop another question (hello Week 3, my old nemesis) this close to the end of the CTF. Because the question had a section in quotes, I assumed that phrase could be found directly in the image. It isn’t the fastest solution, but man if strings
isn’t one of my favorite starting points! In this case, I used strings
with the -tx
switch to tell it to output the hexadecimal address it found the string at and paired it with a case insensitive grep (grep -i
). Finally, because the string it hits on is so long, I opted to use awk
to just give me the first field ('{print $1}'
) which should be the offset.
We can see there were four hits and if you dig in, it is all the same video title. Now we just need to turn those physical offsets into virtual ones to know which process they belonged to. Absent any other starting point, I opted to use the memmap
Volatility plugin and grep
to look for the above four addresses. Because we are generally dealing with pages of size 0x1000, I truncated the last three digits to 0 on each of them. I also included the word “pid” in my search to show me each of the processes. Whichever PID was the last listed before my hit, would be my answer.
Is it elegant? No. Do I care when I can tell my computer to figure out the answer while I do other things? Also no. In the above output, it looks like Internet Explorer, PID 4480
, has one of those memory locations mapped. That must be our answer.
Get the second challenge
The second challenge was:
What is the product version of the application from Part 1? Format: XX.XX.XXXX.XXXXX
Similarly to week 9’s fifth challenge, we can use pe-tree
to read the process executable’s version information. Since we know the process ID, once we dump the process executable, this is a one-shot answer.
When you look at the pe-tree
GUI and click on “VS_VERSIONINFO”, the version is listed as 11.00.9600.18858
. This fits the format they were looking for and is the product version of the application, so it is our answer.
Conclusion
I enjoyed the careful tiptoe to figure out the right process ID for the first step. You could also figure it out by dumping every process’ memory and then grep
ing your way through it for the same string and seeing which file contained it. Overall, it was an enjoyable problem to solve a few ways.