checksec
TLDR
Check security properties of a binary
SYNOPSIS
checksec [--file binary] [--dir directory] [--proc pid] [--kernel] [--output format]
DESCRIPTION
checksec audits security features enabled in compiled Linux executables (ELF files), the kernel, or running processes. It helps security researchers and administrators assess the exploitability posture of binaries by checking for common mitigations.
Security properties checked:
RELRO (Relocation Read-Only) - Protects GOT/PLT from being overwritten. Full RELRO marks these as read-only after dynamic linking.
Stack Canary - Random value placed before return addresses to detect buffer overflows.
NX (No eXecute) - Marks memory regions as non-executable, preventing code execution from stack/heap.
PIE (Position Independent Executable) - Enables ASLR by allowing random base address loading.
FORTIFY - Compile-time buffer overflow checks for common functions.
PARAMETERS
--file binary
Check security properties of specified binary--dir directory
Scan all binaries in directory--proc pid
Check running process by PID--proc-all
Check all running processes--kernel
Check kernel security features--output format
Output format: cli, csv, json, xml--fortify-file binary
Detailed fortify analysis
CAVEATS
Color-coded output indicates security status: green for enabled protections, red for missing. Red doesn't always indicate a vulnerability—distribution vendors may make intentional tradeoffs when compiling binaries.
HISTORY
Originally written by Tobias Klein at trapkit.de. The tool has been actively maintained and expanded, moving from Bash to Golang, with the current version maintained at github.com/slimm609/checksec.


