-
Notifications
You must be signed in to change notification settings - Fork 78
/
NexposeFrameWork.py
35 lines (31 loc) · 1.54 KB
/
NexposeFrameWork.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- encoding: utf-8 -*-
#class for connecting with NexposeFrameWork with pynexposeHttps
from bs4 import BeautifulSoup
class NexposeFrameWork:
def __init__(self, pynexposeHttps):
self.pynexposeHttps = pynexposeHttps
def siteListing(self):
print "\nSites"
print "--------------------------"
bsoupSiteListing = BeautifulSoup(self.pynexposeHttps.site_listing(),'lxml')
for site in bsoupSiteListing.findAll('sitesummary'):
attrs = dict(site.attrs)
print "Description: " + attrs['description']
print "riskscore: " + attrs['riskscore']
print "Id: " + attrs['id']
print "riskfactor: " + attrs['riskfactor']
print "name: " + attrs['name']
print "\n"
def vulnerabilityListing(self):
print "\nVulnerabilities"
print "--------------------------"
bsoupVulnerabilityListing = BeautifulSoup(self.pynexposeHttps.vulnerability_listing(),'lxml')
for vulnerability in bsoupVulnerabilityListing.findAll('vulnerabilitysummary'):
attrs = dict(vulnerability.attrs)
print "Id: " + attrs['id']
print "Severity: " + attrs['severity']
print "Title: " + attrs['title']
bsoupVulnerabilityDetails = BeautifulSoup(self.pynexposeHttps.vulnerability_details(attrs['id']),'lxml')
for vulnerability_description in bsoupVulnerabilityDetails.findAll('description'):
print "Description: " + vulnerability_description.text
print "\n"