Giter Club home page Giter Club logo

Comments (7)

trashgordon-zz avatar trashgordon-zz commented on September 23, 2024

I see the XML did not get included. I can send that to you if you need.

from python-libnmap.

savon-noir avatar savon-noir commented on September 23, 2024

yes you can send it over to [email protected]. thanks for bug post

from python-libnmap.

savon-noir avatar savon-noir commented on September 23, 2024

Quick fix, i need to get further with this (parsing tags) but here is the result:
(see commit 1cd054c)

In [1]: from libnmap.parser import NmapParser
In [2]: p = NmapParser.parse_fromfile("/vagrant/smb-os-test.xml")
In [3]: h[0].scripts_results
Out[3]:
[{'id': 'smb-os-discovery',
'output': '\n OS: Windows 2000 (Windows 2000 LAN Manager)\n OS CPE: cpe:/o:microsoft:windows_2000::-\n Computer name: oracle\n NetBIOS computer name: ORACLE\n Domain name: acme.local\n FQDN: oracle.acme.local\n NetBIOS domain name: ACME\n System time: 2014-03-03T16:41:35+02:00\n'}]

from python-libnmap.

savon-noir avatar savon-noir commented on September 23, 2024

ok... way better now...

Check change log: you now have

NmapHost.scripts_results (it's a property) and will produce the below output for your specific XML.
you also have NmapService.scripts_results (again a property, it was formerly a method) and will produce similar output but for service specific nse scripts output.

See example with your xml:

In [1]: from libnmap.parser import NmapParser
In [2]: p = NmapParser.parse_fromfile("/vagrant/smb-os-test.xml")
In [3]: h = p.hosts.pop()
In [4]: h.scripts_results
Out[4]:
[{'elements': {'cpe': 'cpe:/o:microsoft:windows_2000::-',
'date': '2014-03-03T16:41:35+02:00',
'domain': 'ACME',
'domain_dns': 'acme.local',
'fqdn': 'oracle.acme.local',
'lanmanager': 'Windows 2000 LAN Manager',
'os': 'Windows 5.0',
'server': 'ORACLE' } ,

'id': 'smb-os-discovery','output': '\n OS: Windows 2000 (Windows 2000 LAN Manager)\n OS CPE: cpe:/o:microsoft:windows_2000::-\n Computer name: oracle\n NetBIOS computer name: ORACLE\n Domain name: acme.local\n FQDN: oracle.acme.local\n NetBIOS domain name: ACME\n System time: 2014-03-03T16:41:35+02:00\n' } ]

Any feedback and more tests cases are most welcome.

from python-libnmap.

savon-noir avatar savon-noir commented on September 23, 2024

@trashgordon did you tested this?

from python-libnmap.

trashgordon-zz avatar trashgordon-zz commented on September 23, 2024

Yes, and it works great now. Thank you! And thank you for your great library!

from python-libnmap.

brizzbane avatar brizzbane commented on September 23, 2024

I've downloaded straight from github as opposed to PIP install, and still have issue of dict showing {} when printing it out. I print out nmap_report = NmapParser.parse(nmap_proc.stdout), and see values in the XML.

What am I doing wrong :?

[edit]
got it figured out.

here is a gist of: nmap_report = NmapParser.parse(nmap_proc.stdout) that shows how to cycle through everything.

https://gist.github.com/brizzbane/637dfed0032d6f00e191

from python-libnmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.