>_ IzzyLab

Topic breakdown

The SUID bit changes the permission model: a program with it runs as the file's owner, not as whoever launched it. Hence the risk — an extra SUID on the wrong binary becomes a ladder to root privileges, so such files are inventoried regularly. find can locate them by a permission mask: you combine selection by bits via -perm (SUID corresponds to octal 4000) with restriction to regular files via -type f, and save the output by redirecting it to a file.

What's checked

  1. /root/suid.txt lists exactly all SUID files in /usr/bin
  2. /root/suid.txt is not empty

What it looks like