Checking ELF Hardening with checksec
Reading ELF hardening results
checksec summarizes hardening attributes observable in an executable. It reports build properties of the specific file. Operating-system runtime settings also affect what applies in practice.
Common fields
| Field | Meaning |
|---|---|
| NX | Separates executable permissions from writable data. Often used to check whether the stack is marked non-executable. |
| PIE and ASLR | PIE builds a position-independent executable. ASLR is runtime address randomization by the operating system. |
| Stack canary | The compiler can insert a guard value into selected functions and check it before return. |
| RELRO | The loader marks selected relocation-related data read-only after handling relocations. Reports often distinguish partial and full RELRO. |
| FORTIFY | Adds checks to some standard library calls when conditions such as a compiler-known buffer size are met. |
Checking build artifacts
Inspect the actual released executables and shared libraries. Record the toolchain and target architecture. Code review and boundary tests are still needed to find out-of-bounds access.