Skip to content

Instantly share code, notes, and snippets.

@alex-endfinger
Created October 1, 2011 23:33
Show Gist options
  • Save alex-endfinger/1256810 to your computer and use it in GitHub Desktop.
Save alex-endfinger/1256810 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Scanning TCP ports..."
for p in {1..1023}
do
(echo >/dev/tcp/localhost/$p) >/dev/null 2>&1 && echo "$p is open!"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment