How to Find Files With setuid Permissions

find directory -user root -perm -4000 -exec ls -ldb {} \; >/tmp/filename
  • find directory -> Checks all mounted paths starting at the specified directory, which can be root (/), sys, bin, or mail.
  • -user root -> Displays files owned only by root.
  • -perm -4000 -> Displays files only with permissions set to 4000.
  • -exec ls -ldb -> Displays the output of the find command in ls -ldb format.
  • >/tmp/filename -> Writes results to this file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.