identifying live hosts on a network

Matias Surdi matiassurdi at gmail.com
Tue May 19 10:54:13 EDT 2009


hunteroakesgun at gmail.com escribió:
> HI
> I am new to python and am having trouble coming up with a script that
> idenifies all the live hosts on my network.
> thanks Hunter


I've done this in the past with the great help of nmap:

# nmap -sP 192.168.0.0/23

this will find hosts "alive" from 192.168.0.1 to 192.168.1.254

 From python, you can use it by saving it's output to a file and then 
reading or with the help of os.popen.


In this case, "alive" means that the hosts with the ip being analyzed 
responds to ARPs. see the manpage for nmap.

Matias.









More information about the Python-list mailing list