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

FieldMeaning
NXSeparates executable permissions from writable data. Often used to check whether the stack is marked non-executable.
PIE and ASLRPIE builds a position-independent executable. ASLR is runtime address randomization by the operating system.
Stack canaryThe compiler can insert a guard value into selected functions and check it before return.
RELROThe loader marks selected relocation-related data read-only after handling relocations. Reports often distinguish partial and full RELRO.
FORTIFYAdds 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.