Setuid and Setgid
MITRE ATT&CK, Privilege Escalation, Sub-technique T1548.001
Setuid is a Unix file flag that allows an executable to be run with the permissions of the file owner. It is often used to allow a user to perform tasks that would otherwise require privileged access.
Setgid is the same concept but instead applies to groups rather than users.
Let's take a look at the following example:
setuid is indicated by the first s whereas setgid is indicated by the second s.
Setting Permissions
Locating SUID/SGID Binaries
Escalating Privileges
Escalating privileges with these bits greatly depends on the binary that we haev in our posession. One of my favorite ways to search for what an binary can do is by referencing GTFOBins:
References
Last updated