Unix / Linux: Find Setuid Files

Objective: Find files with setuid permissions on Unix / Linux.

The setuid bit is normally set with the command chmod by setting the high order octal digit to 4. The following command will set setuid on a file called foo.

To find files with setuid permissions, use the following syntax.

To look for files that has both setuid and setgid set, use the following syntax.

The high order octal digit has a value of 2 when the setgid bit is set. Adding both values for setuid (4) and setgid (2) gives 6.

If you would like to find files that has setuid and/or setgid set, then you can use the following syntax. Note that this syntax is only supported on GNU find.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }