Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax for printing the vulnerblities #137

Open
Sohel1999 opened this issue Jan 6, 2023 · 0 comments
Open

Syntax for printing the vulnerblities #137

Sohel1999 opened this issue Jan 6, 2023 · 0 comments

Comments

@Sohel1999
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant