mirror of
https://github.com/cloudflare/flan.git
synced 2026-10-16 21:12:47 +08:00
Fix xml parser when host is up but not ports are open (#46). Also fix error when getting description from the cache. The entire vuln description object should be saved in the cache not just the string of the description. Also added all __pycache__ files to gitignore
This commit is contained in:
@@ -0,0 +1 @@
|
||||
__pycache__
|
||||
@@ -29,8 +29,9 @@ class CveProjectProvider(VulnDescriptionProvider):
|
||||
response.raise_for_status()
|
||||
cve_json = response.json()
|
||||
description = cve_json['description']['description_data'][0]['value']
|
||||
self.cache[vuln] = description
|
||||
return VulnDescription(description, self.nist_uri_template.format(vuln))
|
||||
vuln_description = VulnDescription(description, self.nist_uri_template.format(vuln))
|
||||
self.cache[vuln] = vuln_description
|
||||
return vuln_description
|
||||
except HTTPError as he:
|
||||
return VulnDescription('', 'Description fetching error: ' + str(he))
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class FlanXmlParser:
|
||||
if not ip_addr:
|
||||
return
|
||||
|
||||
if host['status']['@state'] == 'up' and 'port' in host['ports']:
|
||||
if host['status']['@state'] == 'up' and 'ports' in host.keys() and 'port' in host['ports']:
|
||||
ports = host['ports']['port']
|
||||
if isinstance(ports, list):
|
||||
for p in ports:
|
||||
|
||||
Reference in New Issue
Block a user