/* [ http://www.rootshell.com/ ] - Maybe has a use if you run OS/2? */ /* OS/2 Rexx-script ; scans hosts by IP-adresses */ crlf='0d0a'x The_End = 0 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call RxFuncAdd 'SockLoadFuncs','rxsock','SockLoadFuncs' SIGNAL on HALT name CLEANUP call SysLoadFuncs call SockLoadFuncs call SysCls say ' ' rc = SockVersion() say '' say ' SockVersion='rc rc = SockInit() say ' ' rc = Charout(,' Enter First IP: ') pull First_IP . say ' ' rc = Charout(,' Enter Last IP : ') pull Last_IP . say ' ' rc = Charout(,' Enter filename: ') pull filename . if filename = '' then filename = 'hostscan.dmp' say ' ' say ' ' say ' scanning hostnames from 'First_IP 'to 'Last_IP '...' say ' ' rc = lineout(filename, ' ') rc = lineout(filename, '**********************************************************************') rc = lineout(filename, 'scan results for 'First_IP 'until 'Last_IP '...') rc = lineout(filename, ' ') parse value First_IP with D1 '.' C1 '.'B1 '.'A1 parse value Last_IP with D2 '.' C2 '.'B2 '.'A2 do forever First_IP = D1'.'C1'.'B1'.'A1 say '' rc = charout(,First_IP' :') rc = lineout(filename, ' ') rc = charout(filename,First_IP' :') rc = SockGetHostByAddr(First_IP, 'host.!') if (rc = 0) then do c = charout(,' ** Unable to resolve name ** ') c = charout(filename,' ** Unable to resolve name ** ') end if rc <> 0 then do rc = charout(,host.!name) rc = charout(filename,host.!name) if host.!alias.0 > 1 then do bla = 1 to host.!alias.0 rc= charout(,' | 'host.!alias.bla) rc= charout(filename,' | 'host.!alias.bla) end /* do bla */ end If The_End = 1 then leave call ipcounter end /* do forever */ SIGNAL ENDE ipcounter: A1 = A1 + 1 if A1 = 256 then do A1 = 0 B1 = B1 + 1 end /* do */ if B1 = 256 then do B1 = 0 C1 = C1 +1 end /* do */ if C1 = 256 then do C1 = 0 D1 = D1 +1 end /* do */ If D1 = D2 then do If C1 = C2 then do If B1 = B2 then do If A1 = A2 then do The_End = 1 end /* do */ nop end /* do */ nop end /* do */ nop end /* do */ return 0 /* Begin Error-routines */ ENDE: rc = charout(filename) say '' say '' say '' say ' Results are in 'filename say '' say '' exit 0 CLEANUP: say 'CLEANUP' rc = charout(filename) say "Done !" exit 0