Ubuntu – How to list all setuid binaries in the Ubuntu repository

aptSecurity

Is there any way I can list all setuid binaries inside the Ubuntu respository? Or does such a list exist somewhere on the web? I have looked at the apt-get options and could not come up with a solution for the same. I'm assuming that there must be a list for the same though.

Best Answer

setuid executables are not recorded in the package metadata, so a short answer to your question would be: no, you can't. The only way to look for setuid executables in an archive would be to download every package and scan them.

However, if what you want to do is to list all setuid executables installed on your system, this command is what you are looking for:

find / -type f \( -perm -4000 -o -perm -2000 \)

Then, if you want to know where an executable comes from:

dpkg -S <file-path>

For example:

$ dpkg -S /bin/ping
iputils-ping: /bin/ping
Related Question