Advanced Forensics: File extensions can be faked, but a file's "magic numbers" never lie!
mystery_file.dat on a compromised computer. Its extension says .dat, but experienced forensic analysts know — file extensions can be changed to anything!%PDF, and PNG images start with 89 50 4E 47.%PDF = PDF, PK = ZIP, 89 PNG = PNGfile mystery_file.dat (Linux/Mac) or xxd mystery_file.dat | head.dat to other extensions and see what opens!You can open the .dat file with a text editor (like Notepad) and look at the very beginning for recognizable text. Or use an online hex viewer.
If the file starts with %PDF, it's actually a PDF file! Rename the extension from .dat to .pdf, then open it with a PDF reader to see the flag.