@@ -827,7 +827,8 @@ echo -e "\e[00;31m[-] Can we read/write sensitive files:\e[00m" ; ls -la /etc/pa
827
827
echo -e " \n"
828
828
829
829
# search for suid files
830
- findsuid=` find / -perm -4000 -type f -exec ls -la {} 2> /dev/null \; `
830
+ allsuid=` find / -perm -4000 -type f 2> /dev/null`
831
+ findsuid=` find $allsuid -perm -4000 -type f -exec ls -la {} 2> /dev/null \; `
831
832
if [ " $findsuid " ]; then
832
833
echo -e " \e[00;31m[-] SUID files:\e[00m\n$findsuid "
833
834
echo -e " \n"
@@ -839,28 +840,29 @@ if [ "$export" ] && [ "$findsuid" ]; then
839
840
fi
840
841
841
842
# list of 'interesting' suid files - feel free to make additions
842
- intsuid=` find / -perm -4000 -type f -exec ls -la {} \; 2> /dev/null | grep -w $binarylist 2> /dev/null`
843
+ intsuid=` find $allsuid -perm -4000 -type f -exec ls -la {} \; 2> /dev/null | grep -w $binarylist 2> /dev/null`
843
844
if [ " $intsuid " ]; then
844
845
echo -e " \e[00;33m[+] Possibly interesting SUID files:\e[00m\n$intsuid "
845
846
echo -e " \n"
846
847
fi
847
848
848
- # lists word -writable suid files
849
- wwsuid=` find / -perm -4002 -type f -exec ls -la {} 2> /dev/null \; `
849
+ # lists world -writable suid files
850
+ wwsuid=` find $allsuid -perm -4002 -type f -exec ls -la {} 2> /dev/null \; `
850
851
if [ " $wwsuid " ]; then
851
852
echo -e " \e[00;33m[+] World-writable SUID files:\e[00m\n$wwsuid "
852
853
echo -e " \n"
853
854
fi
854
855
855
856
# lists world-writable suid files owned by root
856
- wwsuidrt=` find / -uid 0 -perm -4002 -type f -exec ls -la {} 2> /dev/null \; `
857
+ wwsuidrt=` find $allsuid -uid 0 -perm -4002 -type f -exec ls -la {} 2> /dev/null \; `
857
858
if [ " $wwsuidrt " ]; then
858
859
echo -e " \e[00;33m[+] World-writable SUID files owned by root:\e[00m\n$wwsuidrt "
859
860
echo -e " \n"
860
861
fi
861
862
862
863
# search for sgid files
863
- findsgid=` find / -perm -2000 -type f -exec ls -la {} 2> /dev/null \; `
864
+ allsgid=` find / -perm -2000 -type f 2> /dev/null`
865
+ findsgid=` find $allsgid -perm -2000 -type f -exec ls -la {} 2> /dev/null \; `
864
866
if [ " $findsgid " ]; then
865
867
echo -e " \e[00;31m[-] SGID files:\e[00m\n$findsgid "
866
868
echo -e " \n"
@@ -872,21 +874,21 @@ if [ "$export" ] && [ "$findsgid" ]; then
872
874
fi
873
875
874
876
# list of 'interesting' sgid files
875
- intsgid=` find / -perm -2000 -type f -exec ls -la {} \; 2> /dev/null | grep -w $binarylist 2> /dev/null`
877
+ intsgid=` find $allsgid -perm -2000 -type f -exec ls -la {} \; 2> /dev/null | grep -w $binarylist 2> /dev/null`
876
878
if [ " $intsgid " ]; then
877
879
echo -e " \e[00;33m[+] Possibly interesting SGID files:\e[00m\n$intsgid "
878
880
echo -e " \n"
879
881
fi
880
882
881
883
# lists world-writable sgid files
882
- wwsgid=` find / -perm -2002 -type f -exec ls -la {} 2> /dev/null \; `
884
+ wwsgid=` find $allsgid -perm -2002 -type f -exec ls -la {} 2> /dev/null \; `
883
885
if [ " $wwsgid " ]; then
884
886
echo -e " \e[00;33m[+] World-writable SGID files:\e[00m\n$wwsgid "
885
887
echo -e " \n"
886
888
fi
887
889
888
890
# lists world-writable sgid files owned by root
889
- wwsgidrt=` find / -uid 0 -perm -2002 -type f -exec ls -la {} 2> /dev/null \; `
891
+ wwsgidrt=` find $allsgid -uid 0 -perm -2002 -type f -exec ls -la {} 2> /dev/null \; `
890
892
if [ " $wwsgidrt " ]; then
891
893
echo -e " \e[00;33m[+] World-writable SGID files owned by root:\e[00m\n$wwsgidrt "
892
894
echo -e " \n"
0 commit comments