예제 #1
0
def pdfify(enhanced, output):
  enhanced["scan"]["time"] = fromEpoch(enhanced["scan"]["time"])
  enhanced["enhanced"]["time"] = fromEpoch(enhanced["enhanced"]["time"])
  appendixes=[]
  
  appendix = 1
  for system in enhanced["systems"]:
    if "cpes" in system:
      for cpe in system["cpes"]:
        cpe["cpe"] = toHuman(cpe["cpe"])
        if "cves" in cpe and len(cpe["cves"])!=0:
          appendixes.append(cpe["cves"])
          cpe.pop("cves")
          cpe["appendix"]=appendix
          appendix += 1
    for service in system["services"]:
      service["banner"]=product(service["banner"])
      if "cves" in service and len(service["cves"])!=0:
        appendixes.append(service["cves"])
        service["appendix"] = appendix
        appendix += 1
      if "cves" in service: service.pop("cves")

  enhanced["appendixes"]=appendixes
  html_out = template.render(enhanced)
  HTML(string=html_out).write_pdf(output, stylesheets=[stylesheets])
예제 #2
0
def pdfify(enhanced, output):
    enhanced["scan"]["time"] = fromEpoch(enhanced["scan"]["time"])
    enhanced["enhanced"]["time"] = fromEpoch(enhanced["enhanced"]["time"])
    appendixes = []

    appendix = 1
    for system in enhanced["systems"]:
        if "cpes" in system:
            for cpe in system["cpes"]:
                cpe["cpe"] = toHuman(cpe["cpe"])
                if "cves" in cpe and len(cpe["cves"]) != 0:
                    appendixes.append(cpe["cves"])
                    cpe.pop("cves")
                    cpe["appendix"] = appendix
                    appendix += 1
        for service in system["services"]:
            service["banner"] = product(service["banner"])
            if "cves" in service and len(service["cves"]) != 0:
                appendixes.append(service["cves"])
                service["appendix"] = appendix
                appendix += 1
            if "cves" in service: service.pop("cves")

    enhanced["appendixes"] = appendixes
    html_out = template.render(enhanced)
    HTML(string=html_out).write_pdf(output, stylesheets=[stylesheets])
예제 #3
0
 def humanify(cpe):
     return toHuman(cpe)
예제 #4
0
 def humanify(cpe):
   return toHuman(cpe)