Search in sources :

Example 1 with NMapGeneralInformation

use of com.xebia.vulnmanager.models.nmap.objects.NMapGeneralInformation in project vulnmanager by xebia-research.

the class NMapParser method getNMapReport.

public NMapReport getNMapReport(Document nMapDoc) {
    ScanDataParserHelper scanDataParserHelper = new ScanDataParserHelper();
    HostsParserHelper hostsParserHelper = new HostsParserHelper();
    NMapGeneralInformation nMapScanData = scanDataParserHelper.getReportData(nMapDoc);
    List<Host> hosts = hostsParserHelper.getHostsFromDocument(nMapDoc);
    return new NMapReport(nMapScanData, hosts);
}
Also used : NMapReport(com.xebia.vulnmanager.models.nmap.objects.NMapReport) NMapGeneralInformation(com.xebia.vulnmanager.models.nmap.objects.NMapGeneralInformation) Host(com.xebia.vulnmanager.models.nmap.objects.Host)

Example 2 with NMapGeneralInformation

use of com.xebia.vulnmanager.models.nmap.objects.NMapGeneralInformation 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);
}
Also used : NMapInfo(com.xebia.vulnmanager.models.nmap.objects.NMapInfo) NamedNodeMap(org.w3c.dom.NamedNodeMap) NMapGeneralInformation(com.xebia.vulnmanager.models.nmap.objects.NMapGeneralInformation) NodeList(org.w3c.dom.NodeList) NMapScanInfo(com.xebia.vulnmanager.models.nmap.objects.NMapScanInfo) GeneralScanResult(com.xebia.vulnmanager.models.nmap.objects.GeneralScanResult)

Aggregations

NMapGeneralInformation (com.xebia.vulnmanager.models.nmap.objects.NMapGeneralInformation)2 GeneralScanResult (com.xebia.vulnmanager.models.nmap.objects.GeneralScanResult)1 Host (com.xebia.vulnmanager.models.nmap.objects.Host)1 NMapInfo (com.xebia.vulnmanager.models.nmap.objects.NMapInfo)1 NMapReport (com.xebia.vulnmanager.models.nmap.objects.NMapReport)1 NMapScanInfo (com.xebia.vulnmanager.models.nmap.objects.NMapScanInfo)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1 NodeList (org.w3c.dom.NodeList)1