2. Static Triage: Sizing Up a Sample Without Running It
Hashes, magic bytes, strings, entropy and packer tells: the ten-minute first look that tells you what a Windows or Linux file is, and how much of your time it deserves
A patient arrives at a busy emergency department. Before any surgeon sees them, a triage nurse spends a few minutes on the basics: pulse, blood pressure, temperature, a couple of questions, a look at the wound. Nobody is operated on at the front desk. The point of those few minutes is a decision: is this a sprained ankle that can wait in the corridor, a familiar problem with a standard treatment, or something unusual that needs a specialist right now?
Static triage is the same few minutes, spent on a suspicious file. Before you run it, before you open a disassembler, you take its vital signs: a fingerprint, its real file type, the readable text inside it, how random its bytes look, and a few tell-tale structural details. None of that requires executing a single instruction. Most of it takes seconds per step. And at the end you can usually say what kind of thing you're holding, whether somebody has already analysed it, and what to do next.
The previous article built the glovebox. This one is the first thing you
do inside it. We'll work through every step for both Windows samples (PE files:
.exe, .dll) and Linux samples (ELF binaries), and every example uses either the
harmless EICAR test file or small byte buffers made up for this page. Nothing here is live
malware.
Static doesn't mean "safe to do on the host"
Static analysis never runs the sample, but it does feed the sample to tools that parse
it, and parsers have bugs. A file crafted to crash or exploit a PE parser is rare but not
imaginary. Do triage inside the lab (REMnux for Linux tooling,
FLARE-VM for Windows tooling), keep the sample renamed to something unclickable like
sample.bin, and keep defanging every indicator you copy into your notes.
What Triage Is For
Triage answers a short list of questions, fast:
- Is this already known? If a thousand analysts have seen this exact file, their work is a search away.
- What is it, really? A Windows executable, a Linux binary, a document, a script, an archive? The filename's extension is a claim, not a fact.
- What does it hint at? Addresses it might contact, files and registry keys it mentions, commands it might run.
- Is it hiding? Packed or encrypted samples show very little on the surface, and that is a finding too.
- How much effort does it deserve, and what kind? Close it, look up an existing report, dig in statically, or detonate it in the lab.
The emphasis is on minutes. Triage is breadth, not depth: you skim every vital sign once rather than chase the first interesting one for an hour. The deep dives (the PE and ELF formats, disassembly, debugging) are later articles, and triage is what tells you whether a sample is worth them.
Step 1: Fingerprint It
Cryptographic hashes are names
The first thing you compute is a cryptographic hash of the whole file. You met this in the lab article as a handling ritual; in triage it's also your search key. A hash is a short, fixed-length value computed from every byte of the file: change a single bit anywhere and the hash changes beyond recognition. Two files with the same SHA-256 are, for every practical purpose, the same file.
Three algorithms turn up everywhere in malware work, mostly for historical reasons:
| Hash | Length | Status |
|---|---|---|
| MD5 | 128 bits, 32 hex digits | Broken for collisions since 2004. Still common in old reports and feeds. |
| SHA-1 | 160 bits, 40 hex digits | Practical collision demonstrated in 2017 (SHAttered). Still common. |
| SHA-256 | 256 bits, 64 hex digits | No known collisions. Use this as the canonical ID. |
"Broken" here means an attacker can deliberately craft two different files with the same MD5 or SHA-1. For looking up a sample you already hold, MD5 still finds the right report almost every time, but write SHA-256 in your notes and use it as the name. For the EICAR test file:
$ sha256sum eicar.com
275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f eicar.com
$ sha1sum eicar.com
3395856ce81f2b7382dee72602f798b642f14140 eicar.com
$ md5sum eicar.com
44d88612fea8a8f36de82e1278abb02f eicar.com
On Windows, Get-FileHash does the same in PowerShell (-Algorithm SHA1 or MD5 for the
others), and most triage tools show all three the moment you open a file.
Fuzzy hashes: "this looks a lot like that"
A cryptographic hash is deliberately all-or-nothing, which is a weakness for tracking malware. Attackers rebuild their tools constantly; a new build with one changed configuration string has a completely different SHA-256 but is obviously the same family. Fuzzy hashes (also called similarity hashes) are designed so that similar files get similar hashes, and two of them can be compared to produce a score.
ssdeep, by Jesse Kornblum (2006), uses context-triggered piecewise hashing. The idea is easier to see than to say:
A rolling hash slides along the file, and wherever it hits a particular value, ssdeep cuts a
chunk boundary. Each chunk is hashed down to a single character, and the characters are
strung together. Because the boundaries depend on the bytes nearby, inserting or changing
data only disturbs the chunk it lands in, and the rest of the signature survives. An ssdeep
hash looks like blocksize:signature:signature (two signatures at two chunk sizes), and
comparing two of them gives a score from 0 (no match) to 100.
TLSH (Trend Micro's Locality Sensitive Hash, 2013) takes a different route: it builds a statistical summary of small byte sequences across the whole file and compares summaries. It's harder to fool than ssdeep by moving data around, and many feeds now publish it. Its comparison gives a distance rather than a score: 0 means identical, and lower is more similar. The current library needs at least 50 bytes of input with some variety in them.
Neither is a verdict. Two files that share a large chunk of library code, or a common installer stub, can look "similar" without being related, so treat a fuzzy match as a lead to check, not a conclusion.
imphash: fingerprinting the import table
Windows programs list the functions they need from system DLLs in an import table (more on
that in step 5). In 2014 Mandiant described imphash: take the imported DLL and
function names in the order they appear, normalise them to lowercase (kernel32.virtualalloc,
kernel32.writeprocessmemory, ...), join them with commas, and MD5 the result. Because the
linker builds that table from the source code, rebuilds of the same tool often keep the same
imphash even when every other byte changes. VirusTotal and MalwareBazaar both show it, and the
pefile Python library computes it:
$ python3 -c "import pefile; print(pefile.PE('sample.bin').get_imphash())"
It only applies to PE files, and it's useless on packed samples (they all import the same handful of functions, as we'll see). For ELF files, Trend Micro's telfhash plays a similar role using the binary's symbol names.
Look it up, don't hand it over
With a SHA-256 in hand, search for it:
- VirusTotal: paste the hash into the search box. If anyone has uploaded the file before, you get the antivirus verdicts, first-seen date, file names it has been seen under, sandbox behaviour, and the fuzzy hashes and imphash we just met.
- MalwareBazaar: search by hash for the family tag, the reporter's notes, YARA matches, and links to related samples.
- Your own notes and your team's case system. "We saw this last month" is the fastest triage there is.
Upload the file
The file becomes available to VirusTotal's paying subscribers, and attackers watch for their own samples appearing. A targeted phishing attachment may also contain your client's real data. Upload only what you're allowed to share, and never by reflex.
Search for the hash
You learn everything the service already knows, and you give away nothing: a hash can't be turned back into the file. This is always the first move, and the opsec section of the lab article explains why.
Read a lookup carefully. A hit with dozens of detections and a consistent family name means you're probably holding a known thing, and someone's report may already answer your questions. No hit means nothing. It doesn't mean the file is clean, only that nobody has shared this exact file. A rebuilt or targeted sample is expected to be new. And a handful of detections with generic names ("Trojan.Generic", "ML.Attribute.HighConfidence") is a machine learning hunch, not an identification.
Step 2: What Is It, Really?
Windows decides what to do with a file by its extension, which is exactly why attackers lie
about extensions: invoice.pdf.exe, or a "document" that's really a script. Analysts ignore
the name and look at the first few bytes. Most file formats start with a fixed
magic number,
because the programs that read them need a quick way to check they've been handed the right
kind of file.
| First bytes (hex) | As text | What it is |
|---|---|---|
4D 5A |
MZ |
Windows PE executable or DLL (and old DOS programs) |
7F 45 4C 46 |
.ELF |
Linux/Unix ELF binary, shared library, or core dump |
50 4B 03 04 |
PK.. |
ZIP archive, including .docx, .xlsx, .jar, .apk |
25 50 44 46 2D |
%PDF- |
PDF document |
D0 CF 11 E0 A1 B1 1A E1 |
OLE Compound File: legacy .doc, .xls, .ppt, .msi |
|
1F 8B |
gzip-compressed data | |
37 7A BC AF 27 1C |
7z..'. |
7-Zip archive |
52 61 72 21 1A 07 |
Rar!.. |
RAR archive |
23 21 |
#! |
Script with an interpreter line (#!/bin/sh) |
CA FE BA BE |
Java class file, or a macOS universal binary |
MZ are the initials of Mark Zbikowski, one of the MS-DOS developers. Every Windows
executable still starts with a small DOS header and a stub program that prints "This program
cannot be run in DOS mode" if you try. At offset 0x3C that header holds a pointer to the
real PE header, which starts with the bytes PE\0\0:
The ELF magic is the byte 0x7F followed by the letters ELF. The next few bytes already
tell you a lot: byte 4 is the class (01 for 32-bit, 02 for 64-bit), byte 5 the byte
order (01 little-endian, 02 big-endian), and a little further in, at offset 0x12, the
machine type (0x3E for x86-64, 0x28 for 32-bit ARM, 0xB7 for AArch64, 0x08 for
MIPS). A big-endian MIPS binary is almost certainly aimed at routers and other embedded
devices, which is triage information in itself.
Tools that read magic for you
You rarely read these bytes by hand. Three tools do it, each a bit deeper than the last:
file(Linux, also in REMnux and Git for Windows) checks the bytes against a large database of signatures. It knows EICAR too (output lightly trimmed):
$ file eicar.com
eicar.com: EICAR virus test files
$ file hello
hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped
$ file sample.bin
sample.bin: PE32+ executable (GUI) x86-64, for MS Windows, 5 sections
- TrID (by Marco Pontello) matches against thousands of user-contributed definitions and
reports a ranked list of guesses with percentages, which is useful for obscure formats
filedoesn't know. - Detect It Easy (DiE, by horsicq) is the analyst's favourite. Beyond the format it
identifies the compiler, linker, packer and protector: "Microsoft Visual C++", "Go",
"UPX", "Themida". It runs on Windows, Linux and macOS, has a console version
(
diec sample.bin) for scripting, and handles PE, ELF, Mach-O, Android packages and more.
A couple of traps. Magic only describes the start of a file: a valid PE can have extra
data glued on after its last section (called an
overlay),
and some formats tolerate junk before the magic (PDF readers famously search the first
kilobyte for %PDF). Detect It Easy reports overlays; file doesn't. And a script has no
magic at all unless it starts with #!, so a PowerShell or JavaScript dropper usually
shows up as plain "ASCII text". That's a result too: it tells you the next tool to reach for
is a text editor, not a disassembler.
Step 3: Read the Strings
Programs are full of text: messages, file paths, URLs, registry keys, command lines, names of
the functions they call. All of that is stored as ordinary bytes in the file, and you can
pull it out without understanding anything else about the format. A strings tool just
scans for runs of printable characters at least n long and prints them.
ASCII and "wide" strings
The catch is that Windows programs store a lot of their text as UTF-16LE, which Windows calls "wide" or "Unicode" strings. For plain English, every character becomes the character's byte followed by a zero byte, and a naive ASCII scanner sees a run of one-character strings and prints nothing:
So on a Windows sample, always run both passes. With GNU strings on Linux or REMnux:
$ strings -a -n 6 sample.bin # ASCII, minimum length 6
$ strings -a -n 6 -el sample.bin # UTF-16LE ("encoding: 16-bit little-endian")
-a asks for the whole file to be scanned. Modern GNU strings does that by default, but
older versions only looked at the data sections of recognised executables, so the flag is a
harmless habit. -n sets the minimum length: the default of 4 catches more but buries you
in noise; 6 to 8 is a common triage setting. On Windows, the Sysinternals strings.exe
searches both encodings at once (its default minimum is 3).
What's worth noticing
Most of what comes out is noise. You're skimming for a few categories that are hard to explain innocently. Here's a small, made-up excerpt of the kind of thing that should make you stop scrolling (defanged, as everything in your notes should be):
hxxp://update-cdn[.]example/cfg/stage2.bin
198[.]51[.]100[.]23
Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0
SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Global\mtx-3f9a1c07
cmd.exe /c schtasks /create /sc onlogon /tn "Updater" /tr
C:\Users\builder\source\repos\updtr\Release\updtr.pdb
%APPDATA%\Microsoft\updtr.exe
/bin/sh -c
/etc/cron.d/
/var/tmp/.cache-upd
wget -q -O-
The categories, and why each one matters
- URLs, domains, IP addresses. Candidate command-and-control servers and download locations. These become network IOCs, and things to watch for in the fake internet's logs when you detonate.
- User agents. Malware often hard-codes a browser identity, and a years-old or misspelled one stands out in proxy logs. The one above claims to be Firefox 24 (a 2013 release) on Windows 7.
- Registry keys. The
...\CurrentVersion\Runkey starts programs at logon, the classic persistence spot. Others hint at settings the sample reads or changes. - Mutex names.
Fixed, odd-looking names prefixed with
Global\orLocal\are often an "am I already running?" check, and the exact name is a precise detection. - Commands.
cmd.exe /c,powershell -enc,schtasks,vssadmin; on Linux/bin/sh -c,chmod +x,crontab,wget/curl. They hint at what the sample intends to do on the machine. - PDB paths. When a Windows program is built with debug information,
the compiler records the path of its
.pdbsymbol file. It can leak the developer's username, project name and folder layout, and the same path across samples links them together. - File paths. Where it drops copies of itself or hides data:
%APPDATA%,%TEMP%,/tmp,/var/tmp, dot-files thatlshides by default. - Everything else that reads like a human wrote it: ransom notes, email addresses, cryptocurrency wallet addresses, error messages, odd log lines. Error messages in particular often say exactly what a function was trying to do.
The noise, and why it's there
Machine code is just bytes, and some instruction sequences happen to be printable. On
x86-64, the instruction push rbp is the byte 0x55, which is the letter U, and
push r12 through push r15 are 41 54 to 41 57, which read AT, AU, AV, AW. So
the start of a function that saves those registers shows up in strings output as
UATAUAVAW, and you'll see it, and cousins like D$0H and t$ WH, all through any
x86-64 binary. Section names (.text, .rdata), compiler runtime messages, and the names of
standard library functions are also everywhere. Skim past them.
Encoding confusion adds a little noise of its own. In a test buffer holding the ASCII
string ascii-here (ending in a zero byte) followed by the wide string
C:\Users\Public\run.bat, GNU strings -el reports eC:\Users\Public\run.bat: the final
e and its terminating zero look like one more UTF-16LE character. Expect the occasional
stray letter at the edges of wide strings.
When the strings aren't there: FLOSS
Malware authors know analysts run strings, so careful ones hide their text. Two common
tricks:
- Stack strings: instead of storing
"cmd.exe"in the data section, the code writes it onto the stack one or a few characters at a time, with separate instructions. No contiguous run of characters ever exists in the file. - Encoded strings: the text is stored XORed, Base64'd or encrypted, and decoded by a small function at run time.
FLOSS (the FLARE Obfuscated String Solver, from Mandiant's FLARE team) handles both. It
extracts ordinary ASCII and UTF-16LE strings first, then emulates the sample's functions
(without running it natively) to recover stack strings, "tight" strings (stack strings that
are decoded in place in a tight loop), and strings produced by decoding routines. It also
understands the string layouts used by Go and Rust binaries, which plain strings turns into
an unreadable soup. FLOSS was built for Windows PE files (and raw shellcode, with
--format sc32 or sc64); check floss --help on your version for what it supports beyond
that. It's slower than strings and can take minutes on a large file, but it's often the
step where a "boring" sample suddenly shows its URLs.
Strings Extractor
Choose a file from your computer or pick one of the built-in samples. Files are read and processed entirely in your browser and are never uploaded anywhere. The built-in samples are small byte buffers generated on this page: none of them is real malware. URLs and IP addresses are shown defanged, and nothing in the output is a link.
Or drop a file anywhere on this panel. Loading a file or sample here also loads it into the other triage panel on this page.
Categories
| Offset | Enc | Category | String (defanged) |
|---|
Step 4: How Random Does It Look?
Pick any byte at random from an English text file and you can make a decent guess what it
is: probably a lowercase letter, quite likely e or a space, almost certainly not 0xF3.
Pick a byte at random from an encrypted file and you can't guess at all: all 256 values are
equally likely. Entropy puts a number on that difference. It measures, on average, how
surprised you are by each byte, in bits.
For a block of bytes, count how often each of the 256 possible values appears, and turn the counts into probabilities . The Shannon entropy is
where values that never appear (with ) are simply skipped. Two extremes set the scale. If every byte is the same, one value has and , so : no surprise at all. If all 256 values are equally likely, each , and , the maximum.
Working it through by hand
AAAAAAAA: one value, probability 1. H = 0 bits per byte.AAAABBBB: two values, each with probability 1/2. Each contributes −(1/2)×log2(1/2) = 1/2, so H = 1. One bit per byte: each byte only answers a yes/no question, "A or B?".ABCDABCD: four values, each 1/4. Each contributes −(1/4)×(−2) = 1/2, four times, so H = 2.- The 68-byte EICAR file: H ≈ 4.87. It's all printable characters, with some repeated.
- 64 KB of random bytes: H ≈ 7.998, a whisker under the maximum of 8.
Notice the pattern: entropy is the number of bits you'd need per byte if you encoded the data as cleverly as possible, which is why it's the same quantity that sets the limit for Huffman coding and other compressors. Data that can't be compressed any further sits near 8. That gives us a rough scale:
| Kind of data | Typical entropy (bits/byte) |
|---|---|
| Runs of zero padding | 0 |
| English text, HTML, source code | about 4 to 5 |
| Ordinary compiled code and data | about 5 to 6.5 |
| Compressed data (ZIP, gzip, PNG, JPEG) | 7.5 to 8 |
| Encrypted data | 7.9 to 8 |
These ranges are rules of thumb. As a quick check, the Markdown source of the lab article measures about 5.06, and the same file gzipped measures about 7.99. Lyda and Hamrock's widely cited 2007 study of Windows executables flagged a file as probably packed or encrypted when its average entropy was above about 6.68 and its highest-entropy block was above about 7.2.
Entropy can't tell compressed from encrypted
That table hides an important limit: compressed data and encrypted data both look like noise, and entropy alone can't tell them apart. It also can't tell malicious encryption from an innocent embedded PNG icon. High entropy says "this region has been compressed or encrypted, so you can't read it as it is". That's all, and that's useful.
Look at it in slices
A single number for the whole file averages everything together. A large program with one small encrypted payload might average 6.2 and look perfectly normal. The fix is to measure entropy in a sliding window, block by block, and plot it across the file, or per section for PE and ELF files. The shape tells the story:
The normal program goes up and down: a low header, code around 6, text-heavy data lower, zero padding at 0, a compressed icon spiking up in the resources. The packed program is one long, high, flat plateau (just under 8 when measured with large windows). When most of a file looks like that, most of the file is something you can't read yet.
One practical gotcha, which you'll see in the widget below: with a small window, entropy can't reach 8. A window of 64 bytes can contain at most 64 different values, so its maximum is log2 64 = 6. The EICAR file can never score above log2 68 ≈ 6.09, however random it looked.
The cap is only half the story. Even below it, a short window of perfectly random bytes falls short, simply because in a small sample some values don't turn up at all and others turn up twice by chance. Averaging many windows of random bytes:
| Window | Average entropy of random bytes |
|---|---|
| 64 bytes | about 5.77 |
| 256 bytes | about 7.17 |
| 1 KB | about 7.81 |
| 4 KB | about 7.95 |
| 64 KB | about 7.997 |
So always read a plateau against the window that produced it. At 256 bytes, a reading of about 7.2 already means "as random as random gets", which is why a per-block threshold around 7.2, like Lyda and Hamrock's, makes sense. If you want encrypted or compressed data to read close to 8, use windows of 1 KB or more.
File Triage
Steps 1, 2 and 4 of triage in one place. Choose a file or a built-in sample: it is hashed, identified by its first bytes, and measured for entropy right here in your browser, and never uploaded. Try the synthetic samples first and compare the shapes of their entropy graphs, then change the window size and watch the small-window ceiling appear.
Or drop a file anywhere on this panel. Loading a file or sample here also loads it into the other triage panel on this page.
Fingerprints
First bytes
Entropy across the file
Packers: When a Sample Hides Its Contents
A packer takes a finished executable, compresses or encrypts it, and wraps it in a small stub program. When the packed file runs, the stub rebuilds the original in memory and jumps into it. The result behaves the same but looks completely different on disk. Packers have honest uses (smaller downloads, protecting commercial code from cracking), but for malware they're mostly camouflage: the strings, imports and code you'd analyse are all inside the compressed blob.
The most common one by far is UPX (the Ultimate Packer for eXecutables), a free, open source compressor for both PE and ELF files. Here's what a UPX-packed Windows program typically looks like next to a normal build. The numbers are illustrative, but the pattern is the real one:
Normal build
Name VirtSize RawSize Entropy
.text 0x1A2B4 0x1A400 6.3
.rdata 0x0B1C0 0x0B200 4.9
.data 0x02A10 0x00E00 2.1
.rsrc 0x01E48 0x02000 4.4
Dozens of imports from several DLLs. Hundreds of readable strings.
Packed with UPX
Name VirtSize RawSize Entropy
UPX0 0x30000 0x00000 (empty)
UPX1 0x12000 0x11E00 7.9
.rsrc 0x01000 0x00C00 4.1
A handful of imports. Almost no readable strings.
The tells, which apply to most packers, not just UPX:
- Odd section names.
UPX0andUPX1are UPX's own. Other packers leave their own names (.aspack,.MPRESS1,.themida), or random ones. Normal compilers produce.text,.rdata,.data,.rsrc,.reloc. - Tiny on disk, huge in memory.
UPX0has a raw size of zero: it takes up no space in the file, but asks the loader for 0x30000 bytes of memory. That's the empty room the stub will decompress the real program into. - High entropy.
UPX1holds the compressed original, and it sits near 8. - Very few imports. The stub only needs to load DLLs and find functions, so the import
table shrinks to a few entries like
LoadLibraryA,GetProcAddress,VirtualProtectandVirtualAlloc. The real imports are rebuilt at run time. - Few strings, apart from the packer's own. UPX helpfully leaves
$Info: This file is packed with the UPX executable packer ...and the markerUPX!.
On Linux, UPX-packed ELF files usually have no section headers at all (readelf -S reports
that there are none), a few program headers, the same UPX! marker, and the same entropy
plateau. Static Go binaries, common in Linux malware, are another trap: they're large and
fairly dense even when not packed, so check the per-section entropy before you shout "packed".
What to do about it
Detect It Easy will usually just tell you, with a line like "Packer: UPX" plus the
version and compression method it detected. For stock UPX,
upx -d sample.bin -o unpacked.bin unpacks it statically, without running anything, and you
can restart triage on the result. Malware authors know this, so they often tamper with
UPX's headers (overwriting the UPX! marker, renaming the sections) so that upx -d
refuses. Commercial protectors and custom packers can't be unpacked with a command at all.
That's a perfectly good place for triage to end. "Packed with a modified UPX, strings and imports hidden" is a finding, and it tells you the next step: run it in the lab and let the stub do the unpacking for you. Unpacking gets its own article later in the series.
Step 5: A Taste of Imports and Symbols
A program that wants to do anything (open a file, connect to a server, start a process) has to ask the operating system, through library functions. On Windows these come from DLLs and are listed in the PE's import table; on Linux, dynamically linked ELF files list the shared libraries they need and the symbols they use. That list is a rough sketch of what the program can do. The PE and ELF format articles later in the series take these structures apart properly; for triage, a glance is enough.
Windows: suspicious combinations
No single import proves anything: Windows programs call VirtualAlloc constantly. What's
worth noticing are combinations that together describe a known technique. The classic
example is the trio for
process injection:
-
VirtualAllocExReserve memory inside another process.
-
WriteProcessMemoryCopy code into that memory.
-
CreateRemoteThreadStart a thread in the other process that runs the copied code.
Other combinations that earn a note: OpenProcessToken with AdjustTokenPrivileges
(raising its own privileges); RegSetValueExW alongside a Run key string (persistence);
URLDownloadToFileW or the WinHttp*/InternetOpenUrl* families (downloading);
IsDebuggerPresent and CheckRemoteDebuggerPresent (looking for an analyst);
CryptEncrypt or BCryptEncrypt together with file enumeration (FindFirstFileW,
FindNextFileW), which is what ransomware needs. And as we saw with packers, an import table
that is almost empty apart from LoadLibraryA and GetProcAddress means the program finds
its real functions at run time, on purpose.
Linux: what file already told you
On Linux, the file output from step 2 carries two words worth reading carefully:
- dynamically / statically linked. A dynamic binary names its libraries
(
readelf -d sample.binlists them asNEEDEDentries, usually includinglibc.so.6) and the functions it imports from them (readelf --dyn-syms). A static binary has the C library built in, which makes it portable across the many odd devices IoT malware targets, and leaves no import list to read. - stripped / not stripped. A stripped binary has had its symbol table removed, so its own functions have no names. Release software is often stripped, so this alone isn't suspicious.
A statically linked, stripped binary is the Linux version of "very few clues", and it's
very common in botnet malware. When a dynamic binary does have imports, a few are worth a
second look: ptrace (a process calling ptrace(PTRACE_TRACEME) on itself is a well-known
way to detect or block a debugger), dlopen and dlsym (loading code and finding functions
at run time, the Linux cousins of LoadLibrary/GetProcAddress), fork and setsid (going
into the background as a daemon), and execve with socket and connect.
capa: imports, turned into sentences
Reading import lists gets easier with practice, but capa, also from Mandiant's FLARE team, does a lot of it for you. It analyses a program's code, imports, strings and structure against a library of community-written rules and reports capabilities in plain language, mapped to MITRE ATT&CK techniques. It handles PE files, ELF files (since version 3.0 in 2021), .NET assemblies and shellcode. An illustrative, shortened result for a made-up Windows sample:
$ capa sample.bin
ATT&CK Tactic ATT&CK Technique
DEFENSE EVASION Process Injection T1055
PERSISTENCE Boot or Logon Autostart Execution::Registry Run Keys T1547.001
Capability Namespace
contain obfuscated stackstrings anti-analysis/obfuscation/string/stackstring
inject thread host-interaction/process/inject
persist via Run registry key persistence/registry/run
receive data communication
check for debugger via API anti-analysis/anti-debugging/debugger-detection
capa needs to see the code, so on a packed sample it mostly reports "this is packed" and not much else. That's one more reason to run it after checking entropy.
The Triage Toolkit
Everything above is available as free tools on both lab platforms. FLARE-VM installs the Windows set; REMnux ships most of the Linux set.
Windows (FLARE-VM)
- PEStudio (Marc Ochsenmeier): the one-window PE triage tool. Hashes, sections with entropy, imports flagged against a list of suspicious functions, strings with categories, overlay and resources, and it can look the hash up on VirusTotal (without uploading).
- Detect It Easy: file type, compiler, packer and protector.
- CFF Explorer (Daniel Pistelli): a PE structure editor for when you want to see every header field.
- FLOSS: static, stack, tight and decoded strings.
- capa: capabilities summary with ATT&CK mapping.
- Get-FileHash, Sysinternals strings.
Linux (REMnux)
- file: type, architecture, static/dynamic, stripped.
- readelf (binutils): ELF headers, sections, program headers, dynamic section, symbols.
- strings, including
-elfor wide strings. - rabin2 (from radare2): one tool for info (
-I), imports (-i), sections (-S) and strings (-z), for both ELF and PE. - ssdeep, sha256sum and friends.
- capa and Detect It Easy both run on Linux and both understand ELF.
| Triage step | Windows | Linux |
|---|---|---|
| Hashes | Get-FileHash, PEStudio |
sha256sum, ssdeep |
| File type | Detect It Easy, TrID | file, Detect It Easy |
| Strings | FLOSS, PEStudio | strings (twice), FLOSS, rabin2 -z |
| Entropy, packer | Detect It Easy, PEStudio | Detect It Easy, upx -t |
| Imports, symbols | PEStudio, CFF Explorer | readelf -d, readelf --dyn-syms, rabin2 -i |
| Capabilities | capa | capa |
Nothing stops you running REMnux's Linux tools against Windows samples, or vice versa;
rabin2, strings, FLOSS, capa and Detect It Easy all work across platforms. Many analysts
do all their triage on REMnux, which has the advantage that a Windows sample can't run
there even by accident.
Writing It Down
Triage that isn't written down didn't happen. Your notes are what the next analyst (or you, in three months) searches when the same hash turns up again, and they're the start of any report. Keep them short, structured and defanged. A template that fits on one screen:
TRIAGE NOTE
Date / analyst :
Source : (ticket, email, sample repository, TLP label)
Original filename :
Size (bytes) :
SHA-256 :
SHA-1 / MD5 :
ssdeep / TLSH :
imphash : (PE only)
File type : (magic, not extension; arch, 32/64-bit)
Compiler / packer : (Detect It Easy)
Lookups : VirusTotal: hit/miss, detections, family names
MalwareBazaar: hit/miss, tags
Entropy : overall; any sections above ~7.2
Notable strings : (defanged) URLs, IPs, paths, registry, mutexes, commands
Notable imports : combinations worth noting
capa highlights :
Assessment : what I think it is, and how confident I am
Next step : close / reuse report / deeper static / dynamic in lab
Time spent :
Here it is filled in for the harmless EICAR file, so you can see the level of detail. Every value is real:
TRIAGE NOTE
Date / analyst : 2026-11-14 / blowhole
Source : eicar.org, test file
Original filename : eicar.com
Size (bytes) : 68
SHA-256 : 275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f
SHA-1 / MD5 : 3395856ce81f2b7382dee72602f798b642f14140
44d88612fea8a8f36de82e1278abb02f
File type : "EICAR virus test files" (file). Printable ASCII only;
despite the .com name, there is no MZ header
Lookups : VirusTotal: hit, detected by nearly every engine as EICAR
Entropy : 4.87 bits/byte (68 bytes, so the ceiling is ~6.09)
Notable strings : EICAR-STANDARD-ANTIVIRUS-TEST-FILE
Assessment : industry-standard AV test string. Harmless.
Next step : close
Time spent : 3 minutes
Note the "Assessment" line includes a confidence. "Probably a commodity downloader, medium confidence, based on one URL and a Run key string" is far more useful than either "malware" or a hedge-everything paragraph.
Knowing When to Stop
Triage is time-boxed. Set a budget before you start (fifteen to thirty minutes per sample is a common one) and when you hit it, make the decision with what you have. The outcomes match the four exits from the workflow diagram at the top:
-
It's known
A confident hash hit with a consistent family name, or a close imphash or fuzzy match to something your team already analysed. Pull the existing reports, check that your copy matches what they describe, extract the IOCs, and stop.
-
It's benign, or it isn't worth more
A signed, well-known installer that tripped a heuristic; a test file; a corrupt download. Write down why you believe that, and close it.
-
It's readable, and interesting
Unpacked, with meaningful imports and strings, and questions you can't answer from the surface. Go deeper statically: the PE or ELF structure, then a disassembler.
-
It's hiding
Packed, encrypted, or obfuscated past what FLOSS recovers. Stop reading and start watching: detonate it in the lab, with the fake internet listening, and let it unpack itself. Your triage notes tell you what to look for: the URLs to expect in INetSim's logs, the Run key to check, the mutex to search memory for.
The common mistake is the opposite of stopping too early. It's falling down the first rabbit hole: an intriguing string, an hour of chasing it, and the sample's hash lookup (which would have named the family in ten seconds) still not done. Do every step once, quickly, in order, and then decide where to spend your time.
What's Next
You can now take a suspicious file's vital signs without running it: fingerprint it and look it up without giving it away, identify it from its first bytes, read its ASCII and wide strings, measure how random it looks, spot the signs of packing, and skim its imports for telling combinations. On both Windows and Linux, and written up in a note someone else can use.
Several of those steps leaned on structures we only glimpsed: the PE header behind MZ,
the sections with their raw and virtual sizes, the import table, the ELF program headers and
dynamic section. The next articles open those formats up properly, starting with the PE file
that most Windows malware is built from.