Added some small boring scripts and programs writen in few last years
[mirrors/Programs.git] / bash / netinfect / neti.bash
1 #!/bin/bash
2 #Random IP scanner
3 PORT=22;
4
5 function rand_addr() {
6 echo $[$RANDOM%255].$[$RANDOM%255].$[$RANDOM%255].$[$RANDOM%255];
7 }
8
9 echo Scanning random IPs for port $PORT opened...
10 while true; do
11 RADDR=$(rand_addr);
12 echo -n $RADDR:$PORT:;
13 nc -z -w 1 $RADDR $PORT > /dev/null 2>&1;
14 case "$?" in
15 "0") echo open; echo $RADDR >> open$(echo $PORT)s.txt ;;
16 *) echo closed
17 esac;
18 done;
This page took 0.24727 seconds and 4 git commands to generate.