NetCat Shell
NETCAT REVERSE-SHELLS
NETCAT
REVERSE-SHELLS
nc -lvnp <port-number>
-l = used to tell netcat that this will be a listener
-v = is used to request a verbose output
-n = tells netcat not to resolve host name or dns
-p = indicates that the port specification will follow
eg:
nc -lvnp 443
BIND-SHELLS
nc <target-ip> <chosen-port>
Di default le shell create con NetCat sono molto poco staili e non interattive. Infatti non sarà possibile usare il tab-autocomplete, le frecce di navigazione e ctrl + C killerà tutto.
STABILIZZAZIONE SHELLS CON PYTHON:
python -c 'import pty;pty.spawn("/bin/bash")'
- useremo python per creare un altra shell ottimizzata meglio. Tuttavia sarà ancora una shell non interattiva.
shellexport TERM=xterm
- ci darà l'accesso ai comandi da terminale come "clear".
Nel nostro terminale lanceremo il comando:
questo fa due cose: ci da il permesso di usare il tab-autocomplete, le arrow keys, and ctrl + C to kill processes.stty raw -echo; fg
STABILIZZAZIONE SHELLS CON RLWRAP:
in questo caso andremo in principio ad usare un listener differente con questo comando, che ci darà immediatamente accesso al tab-autocomplete, arrow keys, and ctrl + C
rlwrap nc -lvnp <port>