Linux Privilege Escalation with SUID files

What is SUID bit set?

Definition: SUID (Set owner User ID up on execution) is a special permission that allows other users run with the owner’s privileges. That’s why SUID files can be exploited to give adversaries the higher privilege in Linux/Unix system called privilege escalation. Mostly, root access is the goal of hackers when performing privilege escalation.

SUID will be set by adding number 4 in the permission number when using chmod command. For example: 4777, 4600, 4500, 4000, etc.

Note: Letter s or S in the permission both represent for the SUID file. They only switch to one another when the execute permission is set.

To be more specific, let’s have a look at the following explanation. The following is the full permission of a file called demo_file (777).

Click Here