-rwsr-xr-x 1 root root 31308 Apr 7 2005 /bin/ping6 |
#touch /admin/bin/chk-files #chmod 700 /admin/bin/chk-files |
suid () { echo "CHECKING FOR SUID FILES" echo "~~~~~~~~~~~~~~~~~~~~~~~" echo "" find $SRCH \( -perm -4000 \) \ -type f \ -exec file {} \; \ -exec ls -la {} \; \ -exec echo "" \; read -p "HIT ANY KEY TO CONTINUE.." } |
-rwxr-sr-x 1 root root 11373 May 25 2005 /sbin/netreport |
sgid () { echo "CHECKING FOR SGID FILES" echo "~~~~~~~~~~~~~~~~~~~~~~~" echo "" find $SRCH \( -perm -2000 \) \ -type f \ -exec file {} \; \ -exec ls -la {} \; \ -exec echo "" \; read -p "HIT ANY KEY TO CONTINUE.." } |
wwd () { echo "CHECKING FOR WORLD WRITABLE DIRECTORIES" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "" find $SRCH \( -perm -o+w \) \ -type d \ -exec ls -lad {} \; read -p "HIT ANY KEY TO CONTINUE.." } |
wwf () { echo "CHECKING FOR WORLD WRITABLE FILES" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "" find $SRCH \( -perm -o+w \) \ -type f \ -exec ls -la {} \; read -p "HIT ANY KEY TO CONTINUE.." } |
fpf () { echo "CHECKING FOR FILES WITH FULL PERMISSIONS" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "" find $SRCH \( -perm -u+rwx -perm -g+rwx -perm -o+rwx \) \ -type f \ -exec ls -la {} \; read -p "HIT ANY KEY TO CONTINUE.." } |
clear read -p "WHERE DO YOU WANT TO TEST? : " SRCH=$REPLY echo "" while [ 0 ] do clear echo "CHECKING $SRCH FOR.." echo "" echo "1- CHECK FOR SUID FILES" echo "2- CHECK FOR SGID FILES" echo "3- CHECK FOR WORLD WRITABLE DIRECTORIES" echo "4- CHECK FOR WORLD WRITABLE FILES" echo "5- CHECK FOR FULL PERMISSION FILES" echo "x- EXIT" echo "" read -p "CHOOSE ONE : " CHECK=$REPLY echo "" case $CHECK in 1) suid;; 2) sgid;; 3) wwd;; 4) wwf;; 5) fpf;; x|X)clear exit;; *) echo "bad choice, try again";; esac done |