Python Nmap script linux version

Daniel Folkes danfolkes at gmail.com
Wed Nov 28 12:54:19 EST 2007


I made this script for fun.  you need to have Nmap installed on your
linux computer and it will find all the computers on the network and
then run Nmap on it.

Hope you enjoy!

import os
fn = 'i.result'
ip = '192.168.1.1-255'
ip1 = ip[:3]
ips = []
os.system("nmap -sP 192.168.1.1-255 > "+fn)
f = open(fn)
try:
       for line in f:
               if ip1 in line:
                       ips.append(line[5:-19])

finally:
       f.close()

os.system("clear")
for i in ips:
       print '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
       os.system("nmap "+i)
       print '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
       raw_input('press to continue...')


Tell me what you think....



More information about the Python-list mailing list