Getting flags of the Secarmy-CTF box via unintended way
DISCLAIMER
In this un-intended solution blog of Secarmy box, I changed my strategy and solved the box as a forensic challenge instead of a pentest. So yes, If Secarmy would have hosted the box on a server instead of giving us the .ova file, it can’t be solved using this method. Also according to the new rules by Secarmy, unintended ways were not allowed so this blog is just for learning how to analyse a .ova file[and get all the flags].
Overview
TBH, Before doing the box un-intended way I wasn’t even sure if this method is possible or not, so I am gonna try to explain the factors that pushed me to try this method.
We had a .ova file
Every .ova file(basically a VM) need a separate storage, generally a .vmdk file, which is used to store the data.
If there is a storage device, can’t we mount on our host machine?
Now you guys are curious too, Right? Alrighty, let’s get to it.
Analysing the .OVA File
I start by googling how can we analyse a .ova file. And luckily I reached this forum which explained what a .ova file is and how we can extract a .vmdk file from it.
So .ova file is just a tar that contains the OVF file, compressed VMDK files, and a manifest file.
Sweet now we know we can extract the .vmdk files from a .ova file. So let’s get back to Keyboard.
Awesome, we got our .vmdk file which store all the data of the VM.
Analysing the .VMDK File
Time to jump back to google, OK GOOGLE How to analyse a .vmdk file?
And after a little researching, I reached this awesome blog which had 4 ways that can be used to analyse a .vmdk file, I decided to use 2nd method that is, by using 7z.
Slick, let’s try to find more information about the files we extracted.
POG !!!
Yea, even irl I was shocked, but this looks like the 1.img has the boot config, so let’s try mounting the 2.img.
Slick !!!
Lets get those flag !
If you will notice i mounted the disk in a read-write mode by mount -o rw so now we can change perms and simply access all the data.
UwU, let’s get that root flag now !
Yes we failed to get few flags, but as now we have access to data we can simply solve them, also I would suggest you to go the box intended way because it was fun !!
CleanUp
Hope you learned something new, also thank you secarmy for this fun box and letting me publish this unintended writeup blog.