Skip to content

Syntax for printing the vulnerblities #137

Description

@Sohel1999

Hello,
I try to print out VULNERABLITIES from .xml file unsuccessfully.
I have vulnerblity in my Result.xml file.
I want to print that vulnerblity but i unable to do can you plz guid me.

This is my code for printing Host and Services:

python_libnmap==0.7.3
python==3.8.10

from libnmap.parser import NmapParser

nmapparser = NmapParser.parse_fromfile("Result.xml")
print("Nmap scan summary: {0}".format(nmapparser.summary))

for host in nmapparser.hosts:
    print('Host : {0} '.format(host))
    print('Services: ')

    for serv in host.services:
        print('Service : {0} '.format(serv))

Output:

Nmap scan summary: Nmap done at Fri Jan  6 18:59:32 2023; 1 IP address (1 host up) scanned in 80.16 seconds
Host : NmapHost: [0.0.0.0 () - up] 
Services: 
Service : NmapService: [open 25/tcp smtp ()] 
Service : NmapService: [open 80/tcp http ()] 
Service : NmapService: [open 2000/tcp cisco-sccp ()] 
Service : NmapService: [open 8291/tcp unknown ()] 

similarly i tried for vulnerblity but i failed

This is code:

print(host.scripts_results)
for script_out in host.scripts_results:
    print("Output of {0}: {1}".format(
        script_out['id'], script_out['output']))

Output was empty but my .xml have vulnerblities.
Can i get valid syntax for printing the vulnerblities.

Thank You.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions