SUID commands
by neca from LinuxQuestions.org on (#5CKBX)
I'm currently learning about linux privesc, and i want to fully understand it. What are differences between these SUID commands, pros and cons, which one should we use, etc.. :D
Finding SUID executables
find / -perm -4000 -type f -exec ls -la {} 2>/dev/null \;
find / -uid 0 -perm -4000 -type f 2>/dev/null
OR
find / -perm -u=s -type f 2>/dev/null
OR
find / -user root -perm -4000 -print 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} \;


Finding SUID executables
find / -perm -4000 -type f -exec ls -la {} 2>/dev/null \;
find / -uid 0 -perm -4000 -type f 2>/dev/null
OR
find / -perm -u=s -type f 2>/dev/null
OR
find / -user root -perm -4000 -print 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} \;