#!/bin/sh # big.cheese (Internet scanner in shell) # # When run off a UNIX with Internet access, this program will scan for ALL # computer systems tied to the network. # UNIX systems will be placed in a file called: .UNIX # A complete listing of systems (including both UNIX and non-UNIX based # systems will be found in: .ALL.SYSTEMS # Please note: This is a *simplified* version written in approximately 1 hour. # if [ -z "$4" ]; then echo "\nUsage: big.cheese xxx xxx xxx xxx" exit else prefix=$1; addr1=$2; addr2=$3; addr3=$4 fi export prefix addr1 addr2 addr3 while : do if [ -f /tmp/stop.scn ]; then break fi echo "\n\r\n\r\n" | telnet "$prefix.$addr1.$addr2.$addr3" > /tmp/.chkit & sleep 10 kill 0 cat /tmp/.chkit >> .ALL.SYSTEMS x=`grep "login:" /tmp/.chkit` if [ "$x" ]; then echo "`date` => $prefix.$addr1.$addr2.$addr3" >> .UNIX fi if [ $addr3 -gt 255 ]; then addr2=`expr $addr2 + 1`; addr3=0 if [ $addr2 -gt 255 ]; then addr1=`expr $addr1 + 1`; addr2=0 if [ $addr1 -gt 255 ]; then DONE=1 fi fi fi done