Shells

Normal Shells

Meterpreter

First, generate the file which, when executed, starts a reverse shell on the targeted host. Here's an example of an aspx shell:

Then, in your attacker machine, run Metasploit and start a handler:

Replace the port and IP address with your own ones, of course.

Interactive Powershell Reverse Shell

Caveat: stderr doesn't work!

Full TTY Shells

Pwncat

Caveat: I've tested it on 2 Windows boxes in HTB, and it didn't work in either one.

Probably a good idea to switch to bash if using ZSH:

If your target machine doesn't have internet access, then you'll need to download the plugins first:

Listen on port 4444:

Then connect to the pwncat with either a powershell.exe or cmd.exe reverse shell:

Reverse SSH Shell

Features:

  • Full TTY shell

  • File sharing via SFTP

  • Port forwarding

Requirementsarrow-up-right:

  • At least Windows 7 or Windows server 2008 (Windows 10 for conpty, need workaround for lower windows versions for full TTY functionality)

  • Linux kernel version 2.6.23 and higher

Caveats:

  • SCP doesn't seem to work

  • SSH port forwarding doesn't seem to work

  • It hangs sometimes

Evades antivirus: Don't know

First run this on your machine:

Then the following on the victim machine (you can use the upx packed executable, use ssh-shellhost on older machines):

And finally on your machine:

The default password is letmeinbrudipls

NB! If the target doesn't have conpty (pre-windows 10, build 17763), then you need the following workaround:

The shellhost.exe executable needs to be in the same directory. It's an executable from OpenSSHarrow-up-right.

Rlwrap with nishang

Serve the script on your machine. Then download the nishang shell to memory:

Start a listener on SOME_PORT on the attacker machine. Use rlwraparrow-up-right as explained here (not tested).

Then run the reverse shell.

Socat

I think socat can be used to make a decent reverse shell?

arrow-up-right

Last updated