Activity 10.1 - devinziegler/Devin-Tech-Journal GitHub Wiki
Linux Permission Vulnerabilities
Suid Programs
Here is a one liner that can locate suid programs accross a system.
find / -perm -4000 -type f 2>/dev/null
Suid Breakdown
-
The
findcommand is given / as the root directory -
-perm -4000finds thiles with suid set to 4000 -
-type fdenotes only refular files -
2>/dev/nulltakes permission denied errors and throws them out
Root owner world writable files
These files can be dangerous and used for privilage escolation. Here is a script to locate them accross the system:
find / -path /proc -prune -o -user root -perm -o+w -type f -print 2>/dev/null
Word Writable Breakdown
-
find /start find at root -
-path /proc -prunedoesnt scan the /proc directory
/proc gives a lot of false positives
-
-user root- File is owned by root -
-perm -o+w- Others have write (word writable) -
-type f- regular file
rest is the same os previous command