Binary protections
Protection flags describe constraints, not a verdict. Confirm the behavior in the target process and keep the exact binary and library versions in your notes.
Quick inventory
Section titled “Quick inventory”checksec --file=./challfile ./challreadelf -h ./challreadelf -l ./challreadelf -s ./chall | lesschecksec is a compact summary. readelf shows the underlying ELF metadata and program headers. When results matter, inspect the file and runtime mapping rather than relying on a single summary line.
| Mitigation | What it changes | Typical consequence for analysis |
|---|---|---|
| NX | Marks data pages non-executable. | Injected stack bytes usually cannot run; code reuse may be relevant. |
| Stack canary | Checks a guard value before a protected function returns. | A write must avoid, recover, or otherwise account for the guard; a crash in __stack_chk_fail means the check fired. |
| PIE | Makes the executable’s load address relocatable. | Code addresses need a runtime base, often established by a leak. |
| ASLR | Randomizes process mappings. | Stack, shared libraries, and PIE bases can vary between executions. |
| RELRO | Restricts writes to relocation data after loader setup. | Full RELRO makes the GOT read-only; it does not stop every control-flow technique. |
| FORTIFY | Adds checks to selected library operations when the compiler can infer sizes. | Some unsafe calls fail early; coverage depends on the call and build. |
| Stripped symbols | Removes many names and debugging symbols. | Navigation needs imports, strings, xrefs, function boundaries, and runtime evidence. |
PIE and ASLR are related, not identical
Section titled “PIE and ASLR are related, not identical”PIE allows the main executable to load at a variable base. ASLR is the operating-system policy that randomizes mappings. A non-PIE executable can still have randomized stack and library mappings. In a debugger, settings such as set disable-randomization on can make observations repeatable while debugging; they do not describe the normal environment.
Check the live process
Section titled “Check the live process”In GDB or pwndbg, compare static expectations with the process map:
info proc mappingsvmmap # pwndbgLook for the executable, stack, libc, and permissions. A mapping ending in x is executable; w is writable. Mappings and addresses can change on each fresh run when randomization is active.
Use protections to shape a hypothesis
Section titled “Use protections to shape a hypothesis”- Identify the input primitive and measure its real boundary.
- Determine which security check interrupts the path, if any.
- Check whether the needed address is stable, position-independent, or leaked at runtime.
- Choose the smallest technique that meets those constraints.
- Re-run from a clean process and verify each assumption.
Do not treat “NX enabled” as “ROP required” or “canary enabled” as proof that control is impossible. The binary’s reachable paths and the challenge’s permitted setup determine what is feasible.