Python Nmap Scour sP script for linux

Daniel Folkes danfolkes at gmail.com
Tue Nov 27 21:34:20 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!

<code>

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...')

</code>



More information about the Python-list mailing list