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. Advertisements

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:
    536
    dandelion
    Nov 4, 2004
  2. Daniel Folkes

    Python Nmap script linux version

    Daniel Folkes, Nov 28, 2007, in forum: Python
    Replies:
    0
    Views:
    546
    Daniel Folkes
    Nov 28, 2007
  3. Gros Bedo
    Replies:
    2
    Views:
    1,603
    Piet van Oostrum
    Jul 10, 2008
  4. Ara.T.Howard
    Replies:
    19
    Views:
    279
    Chad Perrin
    Mar 2, 2007
  5. ara.t.howard

    [ANN] nmap-1.1.0

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

    ftp nmap support in Net::FTP

    bala, Mar 25, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    236
    Matija Papec
    Mar 29, 2005
  7. Replies:
    0
    Views:
    139
  8. KDawg44

    Running NMap Scan from Perl

    KDawg44, Feb 5, 2010, in forum: Perl Misc
    Replies:
    1
    Views:
    210
    Martijn Lievaart
    Feb 5, 2010
Loading...