Simple port scanner in BASH using netcat

for port in {1..65535}; do
  nc -w 1 localhost $port > /dev/null && echo "Port $port open" || echo "Port $port closed";
done;
Published
Categorized as geek Tagged

Leave a comment

Your email address will not be published.