qr-mania

Info

Field
Value

Category

Forensics

Difficulty

Medium


Challenge Overview

The title of the challenge is qr-mania which points us in a certain direction.

Firstly, I started analyzing the file without opening it in wireshark, which is, in my opinion, the best way to start in this kind of challenges.

Commands used for basic anaylsis:

file
exiftool
binwalk

However, binwalk sucesfully retrieved some .PNG headers so I extract them all using

foremost -T challenge.png

We've got a lot of .pngs file. Using exiftool on anyone of them, we see:

Comment: x/69

69 is clearly the size of the flag and x must be the position of the letter decoded in that QR. So I made a Bash script to sort them in the right order.

mkdir -p sorted
exiftool -p '$Comment $FileName' *.png \
| grep -E '^[0-9]+/[0-9]+' \
| awk -F'[ /]' '{print $1, $NF}' \
| sort -n \
| awk '{printf "cp \"%s\" output/%03d.png\n", $2, NR}' \
| bash

Exploitation Scripts

Afterwards, I realized that I can't just decode each QR code because some of them were invalid. Consequently, I made a script to convert all that colored QRs in black and white QRs that can easily be decoded.

We've got only one thing to do. Decode all of them and get the flag:

made by k0d

Last updated