Python for InfoSec Professionals Part 12: Pseudo-Terminal
This tutorial will introduce some very quick Python Kung Fu to fix a raw shell. To fully understand the awesomeness of this little trick, you need to understand some of the challenges with a raw shell.
A raw shell is a command shell (cmd.exe, /bin/sh) bound to a network socket and either thrown back to the attacker (reverse shell), or bound to a listening port. Raw shells don’t handle STDIN/STDOUT/STDERR the same way terminal access does (SSH access, directly at the keyboard, etc.).