Python3 - Spawn shell inheriting setuid

When executing a shell for educational purposes using shellcode, sometimes you need to make a full shell so you can use utilities such as passwd and su. To do this, simply use python3 to spawn bash without dropping setuid privileges.

python -c 'import pty;pty.spawn(["bash", "-p"])'
Published