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

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:

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

import nmap

def callback(resultSet):
                for host in resultSet:

if __name__=='__main__':
        nmap_scanner = name.Nmap()
        nmap_options =

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,


Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

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