use of com.xebia.vulnmanager.models.nmap.objects.NMapInfo in project vulnmanager by xebia-research.
the class ScanDataParserHelper method getReportData.
NMapGeneralInformation getReportData(Document nMapDoc) {
NamedNodeMap reportData = nMapDoc.getElementsByTagName(NMapConstants.PARSER_LITERAL_NMAP_RUN).item(0).getAttributes();
NMapInfo nMapInfo = getNMapInfo(reportData);
NamedNodeMap scanInfo = nMapDoc.getElementsByTagName(NMapConstants.PARSER_LITERAL_NMAP_SCAN_INFO).item(0).getAttributes();
NodeList tasksList = nMapDoc.getElementsByTagName(NMapConstants.PARSER_LITERAL_NMAP_TASK_END);
NMapScanInfo nMapScanInfo = getNMapScanInfo(scanInfo, tasksList);
NodeList runStatistics = nMapDoc.getElementsByTagName(NMapConstants.PARSER_LITERAL_NMAP_RUNSTATS).item(0).getChildNodes();
GeneralScanResult generalScanResult = getGeneralScanResults(runStatistics);
return new NMapGeneralInformation(nMapInfo, nMapScanInfo, generalScanResult);
}
use of com.xebia.vulnmanager.models.nmap.objects.NMapInfo in project vulnmanager by xebia-research.
the class ScanDataParserHelper method getNMapInfo.
private NMapInfo getNMapInfo(NamedNodeMap reportData) {
String startDate = reportData.getNamedItem(NMapConstants.PARSER_LITERAL_START_TIMEDATE_STR).getNodeValue();
LocalDateTime startScanDateTime = getLocalDateTimeFromString(startDate);
String runArguments = reportData.getNamedItem(NMapConstants.PARSER_LITERAL_ARGS).getNodeValue();
String nMapVersion = reportData.getNamedItem(NMapConstants.PARSER_LITERAL_VERSION).getNodeValue();
return new NMapInfo(startScanDateTime, nMapVersion, runArguments);
}
Aggregations