lib/dradis/plugins/acunetix/importer.rb in dradis-acunetix-3.11.0 vs lib/dradis/plugins/acunetix/importer.rb in dradis-acunetix-3.12.0
- old
+ new
@@ -28,11 +28,12 @@
private
attr_accessor :scan_node
def process_scan(xml_scan)
- start_url = URI::parse(xml_scan.at_xpath('./StartURL').text()).host
+ url = xml_scan.at_xpath('./StartURL').text()
+ start_url = URI::parse(url).host || url # urls wo/ protocol returned nil
self.scan_node = content_service.create_node(label: start_url, type: :host)
logger.info{ "\tScan start URL: #{start_url}" }
# Define Node properties
@@ -47,11 +48,11 @@
scan_node.set_property(:banner, xml_scan.at_xpath('./Banner').text() )
scan_node.set_property(:os, xml_scan.at_xpath('./Os').text() )
scan_node.set_property(:web_server, xml_scan.at_xpath('./WebServer').text() )
scan_node.set_property(:technologies, xml_scan.at_xpath('./Technologies').text() )
scan_node.save
- end
+ end
scan_note = template_service.process_template(template: 'scan', data: xml_scan)
content_service.create_note text: scan_note, node: scan_node
xml_scan.xpath('./ReportItems/ReportItem').each do |xml_report_item|
@@ -72,6 +73,6 @@
logger.info{ "\t\t => Creating new evidence" }
evidence_content = template_service.process_template(template: 'evidence', data: xml_report_item)
content_service.create_evidence(issue: issue, node: scan_node, content: evidence_content)
end
end
-end
\ No newline at end of file
+end