#!/bin/bash
for p in {1..1024}
do
(echo >/dev/tcp/192.168.0.50/$p) && echo "port $p is open."&
done
If you don't want Connection refuses and Connection timeouts cluttering your screen, add in the /dev/null stuff:
(echo >/dev/tcp/192.168.0.50/$p) >/dev/null 2>&1 && echo "port $p is open."&
And keep an eye on the number of ports you are scanning -> number of child processes being spawned.
No comments:
Post a Comment