Reverse Engineering Binaries
Use when the ask is to understand a binary, firmware blob, or opcode
stream. Use deep-exploitation after you have a crash or a primitive.
When to use
- "what is this ELF / PE / Mach-O"
- recover strings, imports, mitigations, or a function algorithm
- assemble / disassemble via
PWN::Plugins::Assemblyorpwn-asm
Methodologies
- NIST SP 800-115: target analysis / static+dynamic review
- OWASP FSTM stages 1-6 when the file is firmware (then
hardware-and-firmware-testing)
- CWE-119 / CWE-676 / CWE-416 for sink notes
- MITRE ATT&CK Execution / Discovery labels in the write-up
Tooling
- File:
file,readelf -a,objdump -d,strings -n 8,nm,ldd. - Mitigations:
checksec --file=BIN. - RE:
radare2/ Cutter, Ghidra, IDA as installed. - Dynamic:
strace,ltrace, gdb. - PWN:
PWN::Plugins::Assembly(asm <-> opcodes, multi-arch),
BannedFunctionCallsC / UseAfterFree SAST on available source,
PWN::Plugins::Fuzz if you move to crash-finding.
PWN::Plugins::Assembly.opcodes_to_asm(opcodes: '90 90', arch: 'x86_64')
PWN::Plugins::Assembly.asm_to_opcodes(asm: 'nop', arch: 'x86_64')
Procedure
file+ hashes. Note arch, linking, stripped or not.checksec/readelf -lfor NX, PIE, RELRO, canary, rpath.strings+ import table (readelf -d/objdump -T) for the
interesting surface (crypto, net, parser, system/strcpy).
- Locate the function (symbols, strings xrefs, entry). Disassemble.
- If packed, unpack first (UPX or a loader dump) - do not invent
control flow from a packed blob.
- Write notes: purpose, inputs, dangerous sinks, unanswered questions.
- Hand off to
deep-exploitationonly when you have a sink + control.
Pitfalls
- Do not paste a 4k disassembly as the answer. Summarize, keep the
artefact on disk, read it back.
- Firmware without a known base address is not "fully reversed" after
one strings.
pwn-asmis for opcode work, not a substitute forchecksec.
Verification
Notes on disk (or in the final) include arch, mitigations, and at least
one concrete function or sink with evidence from the tools above.