[Ilugc] Scanning a network for live hosts

  • From: linux@xxxxxxxxxxxxxxxx (Suresh Ramasubramanian)
  • Date: Sun Aug 13 10:28:36 2006

Hari Sudhakar wrote:

I want a code which will scan the network to which my host is
connected for all the live hosts.For eg.My ip is 198.58.50.1 (Say) wid
the Net ID as 198.58.0.0.What I would like to do is scan the complete
network for currently live hosts.(from 198.58.xx.xx to 198.58.yy.yy)


  A simple script can do the trick ..initialise two varables x and y..run it 
in a nested 'for' loop,  increment for x and y ...run the ping command (ping 
198.58.x.y) and store the output in a text file.I have tried it out(in 
windows scripting though !!!)...its reasonably faster too..

He did say "dont use nmap or ping"

It sounds like exactly the sort of problem a prof would set in college.. 
so if you feel like doing his homework for him start poking around perl 
modules, expect scripts or whatever else you like.

Other related posts: