Monday, January 11, 2016

find suid files (example using find in bash for loop iterator

Locate SUID files (just handy sounding example script snippet.

The find command also works without the -exec option.

#  Find suid root files.
#  A strange suid file might indicate a security hole,
#+ or even a system intrusion.

# Might also try /sbin, /bin, /usr/bin, /usr/local/bin, etc.
permissions="+4000"  # suid root (dangerous!)

for file in $( find "$directory" -perm "$permissions" )
  ls -ltF --author "$file"

No comments:

Post a Comment