🔬
CTFs
  • 🚩nitrozeus's CTF Writeups
  • Tutorial
    • Install Windows 10 VM on M1 Mac
  • My Notes
    • Capture-The-Flag
      • Windows Forensics
      • Memory Forensics
      • Base32, Base64
      • Steganography
      • Email Analysis
      • Malware Analysis
      • MD4, MD5 Cracking
      • Social Engineering
      • OSINT
      • Google Dorking
      • Reconnaissance
      • Port Scan (nmap)
  • 2023
    • 🧠BrainHack CDDC 2023
      • Gallery
      • Eazy Network Analysis
      • What the hell happened to the PC?!
      • Audio Steganography
  • 2022
    • 🐱Grey Cat The Flag 2022
      • Parcel
      • Memory Game (Part 1)
      • Too Fast
      • Entry
      • Ghost
      • Firmware
      • Image Upload
      • flappy-js
    • ⛵STANDCON 2022
      • I Sea You (Part 1)
      • Locate Me
      • I Sea You (Part 2)
      • Trolley Trolling
      • A New Gateway
      • Walks like a cat, barks like a dog
      • Shark in the Ocean
      • Atlan Safe P1
      • Gift from Russia
      • Asmuth Shares
      • Memedump
      • Warmup Forensics
    • 🦁STACK the Flags 2022
      • Finding Nyan
      • New Task!
      • Hit you with that
      • Cobalt Struck
      • PyRunner
Powered by GitBook
On this page
  1. 2022
  2. STANDCON 2022

Warmup Forensics

warming up the forensics skillsss!!!

PreviousMemedumpNextSTACK the Flags 2022

Last updated 2 years ago

Additional Information: We did not manage to solve this challenge during the CTF, but we tried it after the event was over, and we managed to solve the challenge!

Forensics Warmup!!! This challenge should take you less than 133.7 seconds to solve!

This is an interesting challenge that we faced. We were given a file named broken and as always, we ran the file and binwalk command to find out more about the file.

file broken
binwalk broken

Naturally, we uncompress the file and extracted the contents out! We received a file named 5B and 5B.zlib

binwalk -e broken

We continued uncompressing the zlib file only to find out that there is ANOTHER zlib file inside of 5B.zlib.

Key Information: This was our pivotal moment, as we decided to approach this challenge differently.

Since this challenge falls under the category of Forensics. We began looking into the file header of broken file.

xxd broken | head

Now the next question we had was;

What would be the right file header/signature?

  • PNG File Signature

    • 89 50 4E 47 0D 0A 1A 0A

We saved our changes and renamed our file from broken to broken.png

mv broken broken.png

We tried opening the file but we received an error stating that the file is corrupted.

  • pngcheck

    • Verifies the integrity of PNG, JNG and MNG files

  • PCRT

    • A tool to help check if PNG image correct and try to auto fix the error. It's cross-platform, which can run on Windows, Linux and Mac OS.

pngcheck broken

We used exiftool for confirmation whether the image is indeed set to 0x0

exiftool broken

After confirming, we immediately ran the PCRT tool to try and fix the image.

python PCRT.py -i broken

Unfortunately, this did not work. We waited for quite some time for it to "fix" the image, but nothing was happening, and we became Thanos for a moment.

Fine, I'll do it myself - Thanos

As it turns out, the one highlighted in Red is the Width, and highlighted in Green is the Height.

Hexadecimal to Decimal convert

  • 07 80 - 1920 pixels

  • 04 38 - 1080 pixels

Flag: STANDCON22{W@RMUP_lia00000}

Challenge Files

Unfortunately, the file command did not give us any fruitful result.

However, the binwalk command did give us something! It tells us that it is a Zlib compressed data

We got really skeptical at this point as we doubt that it could be another challenge similar to .

We used the xxd command, which creates a hex dump of a given file. ()

Things starts to get really interesting! As shown above, the is not valid for the computer to recognize, e.g. STANDCON22.

On the third line, we noticed the word sRGB and after some Googling, we found out that this broken file is a supposed to be a png file! ()

We fired up our hex editor and fixed the file header (thanks to the on Wiki)

We did some Googling and found this amazing on how to fix png files using and .

We renamed our broken.png back to broken and used pngcheck to see what is wrong with the file, and it turns out that our image dimensions (width, height) has been set to zero!

We decided to fix the dimensions on our own. With some Googling, we found an interesting on hex editing the Width and Height of png files.

Et voila! We managed to fix the image and get the flag!! Also a cute dolphin!

⛵
😢
🤔
😲
🎉
🤔
Gift From Russia
What is xxd
file header
🤯
More information on sRGB and PNG
list of File Signatures
write-up
pngcheck
PCRT
LinkedIn post
3MB
broken
huhuhu, you thought i ran out of memes after Grey Cat The Flag 2022?!
hex editing width & height