Skip to content

Instantly share code, notes, and snippets.

@enginefeeder101
Created November 17, 2015 21:20
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save enginefeeder101/0805faf3862d88a97d66 to your computer and use it in GitHub Desktop.
Save enginefeeder101/0805faf3862d88a97d66 to your computer and use it in GitHub Desktop.
Test outgoing open ports
#!/bin/bash
task(){
LC_ALL=C nc -vzw5 portquiz.net $1 2>&1 | grep -v 'Connection timed out'
}
N=50 # Specify number of ports to check at once
(
for port in {1..65535}; do # Specify port range to check here
((i=i%N)); ((i++==0)) && wait
task "$port" &
done
)
@Atomis70
Copy link

Atomis70 commented Mar 2, 2017

super useful to test which port is open at my college ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment