In the depths of the ocean, fish in general, are hard to come by due to global warming. However, I just found a red herring, with a weird brusied QR code attached on its skin? I don't assume it could be of use to you?
This challenge had a lot of tricks. We can use binwalk to extract any hidden files embedded in the jpg file. In this case it was 4 zip files.
┌──(tev㉿kali)-[~LNC]
└─$ binwalk -e qrcode.jpg
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
364 0x16C Copyright string: "Copyright (c) 1998 Hewlett-Packard Company"
152196 0x25284 Zip archive data, at least v2.0 to extract, name: red_herrings/red_herring_1/
152253 0x252BD Zip archive data, at least v2.0 to extract, compressed size: 104618, uncompressed size: 104716, name: red_herrings/red_herring_1/red_herring.jpeg
256944 0x3EBB0 Zip archive data, at least v2.0 to extract, name: red_herrings/red_herring_2/
257001 0x3EBE9 Zip archive data, at least v2.0 to extract, compressed size: 5177, uncompressed size: 5386, name: red_herrings/red_herring_2/red_herring.jpeg
262251 0x4006B Zip archive data, at least v2.0 to extract, name: red_herrings/red_herring_3/
262308 0x400A4 Zip archive data, at least v2.0 to extract, compressed size: 4915, uncompressed size: 5107, name: red_herrings/red_herring_3/red_herring.jpeg
267296 0x41420 Zip archive data, at least v2.0 to extract, name: red_herrings/red_herring_4/
267353 0x41459 Zip archive data, at least v2.0 to extract, compressed size: 2625603, uncompressed size: 2625603, name: red_herrings/red_herring_4/red_herring.zip
2893028 0x2C24E4 Zip archive data, at least v2.0 to extract, name: red_herrings/red_herring_5/
2893085 0x2C251D Zip archive data, at least v2.0 to extract, compressed size: 10501, uncompressed size: 13304, name: red_herrings/red_herring_5/red_herring.jpeg
2904468 0x2C5194 End of Zip archive, footer length: 22
┌──(tev㉿kali)-[~/LNC/_qrcode.jpg.extracted/red_herrings]
└─$ ls
red_herring_1 red_herring_2 red_herring_3 red_herring_4 red_herring_5
Opening each folder 1-3 & 5 shows us an image of a fish except 4, which showed us a zip folder. When unzipped we get 10000 fake flags.txt.
At this point, we know that 1 out of the 10000 fake flags, will give us the real flag. We can use a script to filter out all the fake flags.txt.
CREDS: Syn Kit (teammate) for the script!
#!/bin/bash
# Define the output file
output_file="out.txt"
# Iterate over directories and read flag.txt files
for dir in */; do
if [ -f "$dir/flag.txt" ]; then
echo -n "$dir" >> "$output_file"
cat "$dir/flag.txt" >> "$output_file"
echo "" >> "$output_file"
fi
done
echo "All flag.txt contents have been written to $output_file."