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.

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

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


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


http://tldp.org/LDP/abs/html/moreadv.html








No comments:

Post a Comment