Lab 6 read a process in memory. This is the static complement: the file on disk, before it runs. A Portable Executable is a rigid, well-documented format — which is exactly why abuse leaves marks in it. Binders staple a second program on; weaponized documents carry a launcher; fileless loaders avoid the disk entirely; worms copy themselves with a tell. Each one shows up as a structural anomaly. Learn the anatomy, and the triage falls out of it.
A PE is a stack of headers that tell the loader how to map the file into memory and where to start. Tap each region — it's where it sits, what it does, and the abuse surface a defender watches.
Same idea, different shape. A Mach-O opens with a magic number (often a fat/universal wrapper carrying arm64 + x86_64 slices), then load commands instead of a section table — LC_SEGMENT_64 (__TEXT r-x, __DATA rw-), LC_MAIN (entry), LC_LOAD_DYLIB (imports), and LC_CODE_SIGNATURE. The abuse surface rhymes: an unsigned or ad-hoc-signed binary, a suspicious extra dylib load, or DYLD_INSERT_LIBRARIES injection are the Mach-O equivalents of the anomalies below.
A morning's worth of samples. Run static triage — it reads structure and metadata only (no execution) and flags each by its indicators. Note the installer: it carries the same big overlay a binder does, and is still benign. Structure raises the question; provenance answers it.
MZ/PE embedded inside; a dropper that writes a child to %TEMP% and runs it; icon + double-extension spoof (invoice.pdf.exe). Overlays are also normal in installers — so you corroborate with signing and behavior, never convict on overlay alone./OpenAction + /JavaScript + /Launch + /EmbeddedFile is a launcher wearing a document's clothes.The tools that read these without running anything:
# PE: overlay, sections, entropy, signature, imports — no execution pefile / PE-bear / CFF Explorer # structure & overlay size sigcheck # Authenticode: signed? valid? who? capa / DIE # capabilities & packer ID from structure # PDF: count the dangerous tags without opening it pdfid statement.pdf /JavaScript 1 /OpenAction 1 /Launch 1 /EmbeddedFile 1 ← launcher shape # macOS codesign --verify --deep · spctl --assess · otool -l / -L
Static triage is fast, safe, and scalable — the right first filter. It narrows thousands of files to the few worth detonating in a sandbox or confirming in memory. It never convicts alone.
codesign/spctl.T1036, Embedded Payloads / binders, User Execution T1204, Reflective Loading T1620, Replication / worms.Next: Lab 10 — ROP / JOP: detecting the exploit that injects no code at all, flagged back in Lab 8.