Last active
January 8, 2018 12:22
-
-
Save xremix/824259814270df77afa1f94458042536 to your computer and use it in GitHub Desktop.
Shell TCP Listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Make Sure Script Is Ran As Root | |
if [ $(id -u) != 0 ]; then | |
echo; echo -e "\e[1;31mScript must be run as sudo. Please Type \"sudo\" To Run As Root \e[0m"; echo | |
exit 1 | |
fi | |
echo "Enter port to listen" | |
read portL | |
while true; | |
do | |
nc -l -p $portL | |
done | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Listener (-l) that listens to Port (-p) 9999 | |
nc -l -p 9999 | |
# Run in infinite loop | |
while :; do nc -l -p 999; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment