Skip to content

Instantly share code, notes, and snippets.

@gcmurphy
Created November 28, 2012 08:07
Show Gist options
  • Save gcmurphy/4159781 to your computer and use it in GitHub Desktop.
Save gcmurphy/4159781 to your computer and use it in GitHub Desktop.
Usage of checksec
# Check a file:
checksec a.out
# Check an entire directory:
checksec dir/*
# Check a running process:
checksec /proc/$(pgrep firefox)/exe
#Check all running processes :
for pid in `ps -e -o pid |grep -E "[0-9]+"`; do
echo "$(ps -o cmd $pid | grep -v CMD | sed 's/ *$//g'),"\
"$(checksec /proc/$pid/exe)"
done
# Check a binary within an RPM file:
rpm2cpio sudo-1.8.3p1-6.fc17.x86_64.rpm \
| cpio --to-stdout -iv ./usr/bin/sudoedit 2>/dev/null\
| checksec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment