Posts

Showing posts with the label rkhunter.

Open for business?

Image
This is two scripts one to find and record machines on the system at the time and the second script is to find open ports on those systems below 1024. alive.sh [code] #!/bin/bash rm /tmp/goodips is_alive_ping() {   ping -c 1 $1 > /dev/null   [ $? -eq 0 ] && echo $i >> /tmp/goodips } for i in 192.168.1.{1..255} do is_alive_ping $i & disown done [/code] /tmp/goodips 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 Now the second script. scannet.sh [code] datafile="/tmp/goodips" a=1 m="not done" while read line do fdata[$a]=$line echo echo $line        let a=a+1        for p in {1..1023};        do        (echo >/dev/tcp/$line/$p) >/dev/null 2>&1 && echo "$p open"        done done < $datafile [/code] results: 192.168.1.1 23 open 53 open ...