Python Nmap Scour sP script for linux

Discussion in 'Python' started by Daniel Folkes, Nov 28, 2007.

  1. 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>
    Daniel Folkes, Nov 28, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lasek

    Nmap Malloc etc...

    lasek, Nov 4, 2004, in forum: C Programming
    Replies:
    5
    Views:
    432
    dandelion
    Nov 4, 2004
  2. Daniel Folkes

    Python Nmap script linux version

    Daniel Folkes, Nov 28, 2007, in forum: Python
    Replies:
    0
    Views:
    442
    Daniel Folkes
    Nov 28, 2007
  3. Ara.T.Howard
    Replies:
    19
    Views:
    173
    Chad Perrin
    Mar 2, 2007
  4. ara.t.howard

    [ANN] nmap-1.1.0

    ara.t.howard, Jul 25, 2010, in forum: Ruby
    Replies:
    3
    Views:
    125
    Joel VanderWerf
    Jul 27, 2010
  5. bala

    ftp nmap support in Net::FTP

    bala, Mar 25, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    115
    Matija Papec
    Mar 29, 2005
Loading...

Share This Page