su.
su.

Reputation: 103

Find suid and gid files under root

I’m looking for find command arguments to find all files under the / that have setuid and setgid privileges. I have find / ??? so far.

Upvotes: 10

Views: 30040

Answers (3)

Boschko
Boschko

Reputation: 374

find / -perm -u=s  -g=s -type f 2>/dev/null

the following command you can enumerate all binaries having SUID permission.

Upvotes: 0

Alok Singhal
Alok Singhal

Reputation: 96141

find / \( -perm -u+s -o -perm -g+s \) -type f

Upvotes: 9

Sean Bright
Sean Bright

Reputation: 120644

setuid or setgid (GNU findutils):

find / -perm /6000

setuid or setgid (POSIX):

find / -perm -4000 -o -perm -2000

setuid and setgid:

find / -perm -6000

Upvotes: 18

Related Questions