socat gets us an interactive login shell right out the gate, though we’re still vulnerable to Ctrl+C. Note that when binding to PowerShell, use powershell.exe,pipes in order to force PowerShell to use UNIX-style STDIN/STDOUT.
Encrypted shells
socat can make encrypted connections, which foil after-the-fact network analysis and may circumvent IDS entirely.
The verify=0 directive turns off certificate validation, so this isn’t a “secure” connection in the sense that it’s been authenticated, but it is secure in the sense that it’s encrypted.
Shell “stabilization”
Automatically stabilize a reverse shell with socat
Shell “stabilization” refers to the process of making a remote shell behave like a normal local shell — so, allowing interactive programs to work properly, ensuring that input is not echoed inappropriately, etc.
We can use socat to create an auto-stabilized reverse shell on UNIX-like systems.
Same thing, but over an encrypted connection:
Tip
The reverse shell will not pick up on your terminal size, so you’ll need to manually specify it using stty rows and stty cols.