Thursday, March 13, 2014

We're given a hint (Universal dangerous positive) along with an IP (194.226.244.125) and a port (1024) to connect to. They also gave us a password to connect:

We assumed it was UDP because of the hint. Every time we attempted to use netcat UDP, however, it would not respond. We just thought it was down, until eventually it connected once I decided try to connect using python instead. I'm assuming that netcat didn't work because it was also sending the newline character with the sent password, so it would not authorize.

When you first connect, you are are told which directions you can go in the maze, which are other ports on the box. The passwords for those directions are also given.

When you connect to any other port, however, you are not given the port number. So, I guessed that the distance between the starting ports was the same for that entire specified direction and that it was the reverse distance for the opposite directions.

I wrote a script in python to reach each found port. The script can be found here.

The script to a awhile to run (~1 hour), since the maze was almost 256 by 256. The port that contained the key was port 65534. When I first say my script printed the response, I was confused because I didn't remember adding any printing. Then I realized it was the key...

Wednesday, March 12, 2014

For this one, they give us a link to a website and tell us to find the key.

When you visit the site, you're greeted with the english or russian version of the Capture the Flag entry in Wikipedia:

From the hint, "Language was detect automatically", we figured we had to modify the Accept-Language header to obtain the key.

After several attempts, we found out that we have the page echo back any page we want, however, it will attempt to run any PHP code. When we tried to have it echo back index.php, it would attempt to load the file infinitely because the file itself is attempting to echo itself:

After recalling some knowledge of PHP, I remember about the IO streams that you can call, such as php://stdout or php://stdin.

After some googling, I discovered the filter stream. The filter stream can be used to read from a file, not only in its ASCII representation, but in several available formats. We then decided to open index.php encoded in base64:

Tuesday, March 11, 2014

So, first things first, I opened the image using StegSolve. I saved all 8 frames using the frame browser. I then wrote a python script (using PIL) that XOR'd the images pixel with each other. The output was an image that looked similar to this:

I couldn't find any hidden data within the pixels of the image. I then realized that the frames were using palettes, so the mode for the image in python was labeled as 'P'. I decided to convert each one of the frames to mode 'RGBA' instead, because, originally, when I would get a pixel, it return a single value. This way, I could then XOR each red, green, blue, and alpha value of each frame with each other.

I then modified my current script to XOR each of these 'RGBA' mode frames with each other.

I never checked the alpha channel previously or if the image originally had an alpha channel. So, naturally I then found that there was no difference in the new images alpha channels. I then set all alpha channel values to 255, so I could visually see the image (the XOR results were 0 since there was no difference between the images.)

I also noticed how some red pixels of the newly created XOR'd image were not all 0. I then set any red pixel value that was not 0 to 255 so I could easily view a hidden image if there was one. The resulting image was this:

I immediately though that there was some sort of hidden text within those pixel values that were set. So, I open the image in StegSolve. I checked the red channel for steganography and found the key:

Soon after, we discovered that the original paper document was a print screen of an email within GMail. We eventually decided it would be easiest to print out the image and physically put the pieces back together.

Using our terrible school printing system, we eventually managed to print the image. Alas, the image that was printed only contained about 3/4ths of the original image.

So, I then put what pieces I had cut up together and looked at the original image for pieces I did not have.

I ended up numbering the pieces of paper that contained the key, which eventually resulted in finding the actual key: