2.World-writable directories should have their sticky bit set
for part in `mount | grep dev | awk '{print $2}' | \
grep -Ev 'cdrom|nfs'`; do
echo "Searching $part"
find $part -xdev -type d \( -perm -0002 -a ! -perm -1000 \) -print
done
3.Find unauthorized world-writable files
for part in `mount | grep dev | awk '{print $2}' | \
egrep -v 'cdrom|nfs'`; do
echo "Searching $part"
find $part -xdev -type f \
\( -perm -0002 -a ! -perm -1000 \) -print
done
4.Find unauthorized SUID/SGID system executables
for part in `mount | grep dev | awk '{print $2}' | \
egrep -v 'cdrom|nfs'`; do
echo "Searching $part"
find $part \( -perm -04000 -o -perm -02000 \) \
-type f -xdev -ls
done