Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: implementing nmap in python
From: Giorgio Zoppi <giorgio.zoppi () gmail com>
Date: Wed, 05 Sep 2007 11:19:42 +0200

On Mon, 2007-08-27 at 11:17 +0000, Julius Kuhn wrote:
"I don't believe this reason you are pointing is good enough to make a
new portscanner.
If you wish to do something like import nmap; nmap.scan(something) and
etc, you will need to create a set of nmap bindings for Python, and
that will be easier than creating a new portscanner that equals to
nmap."

I  have no idea how i would do that if you could give me an example that
would be great because this is my first program that im writing which tries
to implement nmap into python. Thanks again

The main reason is that why do you wish implement a portscan, when is
there a portscan efficient as nmap? (You're loosing time, that IMHO i
should prefer employ in a better way as Italian..i love girls...).
You can argue that you want learn how works a portscanner, but at that
point...read the nmap code. If you want simply learn to program in
Python, you should start with something simpler than a portscanner "ala
nmap" like a personal diary or a notebook, or a contact list.
There's a book that it does for you:
http://www.ibiblio.org/obp/thinkCSpy/


If you want "wrap" nmap in order to create something like:

import nmap

def callback(resultSet):
                for host in resultSet:
                        host.printHostName()
                        host.printOS()

if __name__=='__main__':
        
        nmap_scanner = name.Nmap()
        nmap_options =
nmap.NmapOptions(nmap.STEALTH_SYN_SCAN,nmap.OS_FINGER_PRINT)
        nmap_scanner.setOptions(nmap_options)
        nmap_scanner.start(callback)



It will be great because every sysadm  will be able to customize its
Python scripts in order to do networks checks. But that's a lot of work:
 
* First of all you need a deep understand on how nmap work: create a
some kind of api for nmap.
* Second wrapping with C/C++ Python binding.

Just my 1 cent,

Ciao
Giorgio.





_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]