-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfindsuids.sh
More file actions
executable file
·32 lines (25 loc) · 953 Bytes
/
findsuids.sh
File metadata and controls
executable file
·32 lines (25 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# This will find suids and sgids on the system
# Can also search for world writeable files as well.
#
echo -e "SUID/SGID finder tool by pr0digy\n"
echo "Where would you like your output? (default: stdout)"
read outputName
if [ -z "$outputName" ]
then
echo -e "\nI will now search through / for suids and output to terminal\n"
find / -perm -4000 -o -perm -2000 -type f -exec ls -alF {} \; 2> /dev/null
else
echo -e "\nI will now search through / for suids and output to $outputName\n"
find / -perm -4000 -o -perm -2000 -type f -exec ls -alF {} \; 2> /dev/null > $outputName
fi
echo -e "Would you like to find world writable directories too? (y/n) "
read answer
if [ "$answer" == "y" ]
then
echo -e "\nFinding world writable directories and writing to /tmp/ww.log....\n"
find / -perm -2 ! -type l -ls 2>/dev/null 1>/tmp/ww.log
else
echo -e "We have found all of the files. Now time to exploit them!"
exit 0
fi