Huntress-CTF - DontBelieveEverythingOnTheInternet
Don't believe everything you see on the Internet!
Anyway, have you heard this intro soundtrack from Half-Life 3?
The challenge starts by downloading an .mp3
file. While trying to process it in Python to extract metadata, I encountered errors. After several attempts, I started to wonder if it was actually an MP3 file—or something else. I wrote a function to determine the real file type:
import filetype
def check_file_type(filename):
kind = filetype.guess(filename)
if kind is None:
return "unknown file type."
return f"type: {kind.mime}, extension: {kind.extension}"
filename = 'src/Half-Life_3_OST.mp3'
print(check_file_type(filename))
Thanks to this script, I found out that the file was actually a PNG:
Type: image/png, Extension: png
I then processed the image using the PIL library with this code:
from PIL import Image
image_path = 'src/Half-Life_3_OST.mp3'
img = Image.open(image_path)
img.show()
This revealed the flag:
flag{a85466991f0a8dc3d9837a5c32fa0c91}