Confirming a file type
tag: file-typestag: triage
The routine
Section titled “The routine”- Don’t double-click. Work on a copy, inside your lab.
- Get its hash and look it up. Someone may already know what it is.
- Ask the
filecommand (macOS, Linux, REMnux):file FILE. It reads the magic number and more. - Look at the first bytes yourself:
xxd FILE | head(see Reading hex). - Ask Detect It Easy for the details: compiler, packer, installer type.
- Compare with the name. A mismatch between the extension and the real type is a finding in itself.
| Tool | What it tells you | Where |
|---|---|---|
file |
File type from its signature and structure | Built into macOS and Linux |
| Detect It Easy (DiE) | Type, compiler, packer, protector | Windows, Linux, macOS |
| TrID | Ranked guesses from a large signature database | Windows, Linux |
| CyberChef “Detect File Type” | Type of data pasted or dropped in your browser | Any browser |
| A hex editor | The raw bytes, when the tools disagree | See Reading hex |
Red flags
Section titled “Red flags”- Double extensions:
invoice.pdf.exe,photo.jpg.lnk. - A program wearing a document’s icon. Icons are just resources inside the file.
- A container inside a container: an ISO inside a ZIP, a script inside a shortcut. Each layer can hide the next from a scanner.
- Right-to-left override: a hidden Unicode character can make
invoice_fdp.exedisplay asinvoice_exe.pdf.
Common file formats: what each format is, and why attackers pick it.

One Reverse Look
"A little learning is a dangerous thing." ~ A. Pope
One Reverse Look · Made with ❤ · Your friendly knowledge seeker

