Projects STRLCPY flan Commits b73f07b9
🤬
  • 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

  • Loading...
  • Nadin El-Yabroudi committed 4 years ago
    b73f07b9
    1 parent 0240604f
  • ■ ■ ■ ■ ■ ■
    .gitignore
     1 +__pycache__
     2 + 
  • ■ ■ ■ ■ ■
    contrib/descriptions/cveproject.py
    skipped 28 lines
    29 29   response.raise_for_status()
    30 30   cve_json = response.json()
    31 31   description = cve_json['description']['description_data'][0]['value']
    32  - self.cache[vuln] = description
    33  - return VulnDescription(description, self.nist_uri_template.format(vuln))
     32 + vuln_description = VulnDescription(description, self.nist_uri_template.format(vuln))
     33 + self.cache[vuln] = vuln_description
     34 + return vuln_description
    34 35   except HTTPError as he:
    35 36   return VulnDescription('', 'Description fetching error: ' + str(he))
    36 37   
    skipped 2 lines
  • ■ ■ ■ ■
    contrib/parsers/flan_xml_parser.py
    skipped 112 lines
    113 113   if not ip_addr:
    114 114   return
    115 115   
    116  - if host['status']['@state'] == 'up' and 'port' in host['ports']:
     116 + if host['status']['@state'] == 'up' and 'ports' in host.keys() and 'port' in host['ports']:
    117 117   ports = host['ports']['port']
    118 118   if isinstance(ports, list):
    119 119   for p in ports:
    skipped 37 lines
Please wait...
Page is in error, reload to recover