Friday, August 31, 2012

Python-nmap 0.2.4 patch fixing NSE support and support version and product output

After using python-nmap version 0.2.4, the previous patch that i've created before for python-nmap didnt work. So, i decide to take a peek, and now come with new patch :). I also fix the "NSE output" support.

Oh Well, here are the result with NSE:

>>> import nmap
>>> nm=nmap.PortScanner()
>>> nm.scan('192.168.1.212', '445', arguments='--script=/usr/local/share/nmap/scripts/smb-os-discovery.nse')
{'nmap': {'scanstats': {'uphosts': u'1', 'timestr': u'Fri Aug 31 21:33:19 2012', 'downhosts': u'0', 'totalhosts': u'1', 'elapsed': u'0.28'}, 'scaninfo': {u'tcp': {'services': u'445', 'method': u'syn'}}, 'command_line': u'nmap -oX - -p 445 --script=/usr/local/share/nmap/
scripts/smb-os-discovery.nse 192.168.1.212'}, 'scan': {u'192.168.1.212': {'status': {'state': u'up', 'reason': u'arp-response'}, 'hostname': u'BookLife', u'tcp': {445: {'product':
None, 'state': u'open', 'version': None, 'reason': u'syn-ack', 'name': u'microsoft-ds'}},'script': {u'smb-os-discovery': u'\n  OS: Unix (Samba 3.2.5)\n  Computer name: localhost\n Domain name: localdomain\n  FQDN: localhost.localdomain\n  NetBIOS computer name: \n  System time: 2012-07-19 09:27:12 UTC+7\n'}}}}
>>> 

Enjoy ;)

No comments:

Post a Comment