Find files with the SUID or SGID bit
find suid files linux | check setuid binaries rootkit | find programs running as root | security audit file permissions | find | suid | securityfind / -xdev \( -perm -4000 -o -perm -2000 \) -type f -exec ls -l {} + 2>/dev/nullSearches the root filesystem for files with the SUID bit set (runs as the owner, usually root) or the SGID bit (runs with the file’s group). System programs such as passwd, sudo or mount under /usr/bin are normal. Matches in web directories, /tmp or a user’s home directory are a red flag.
Note: -xdev stays on the root filesystem. If /var or /home live on separate partitions, pass them separately as starting paths.
Also searched as
- find suid files linux
- check setuid binaries rootkit
- find programs running as root
- security audit file permissions