Compare commits

...

2 Commits

Author SHA1 Message Date
Jeff Odegard
9865904e04
Nmap filetype not found for .nmap files
The file type for Normal output .nmap files were not being correctly detected and were producing an error on import.
2019-01-21 17:03:12 -07:00
Jeff Odegard
1af6091e55
Fix for Nessus Solaris 11 Sparc and VMWare ESXi ID
parse_nessus.php had an issue when parsing Nessus results with Solaris 11 results.  It would only identify the x86 architecture, but not sparc architectures.  Additionally, VMWare ESXi hosts were not identified.
2019-01-21 15:13:30 -07:00
2 changed files with 10 additions and 2 deletions

View File

@ -148,7 +148,8 @@ class nessus_parser extends scan_xml_parser
"cpe:\/o:microsoft:windows_2003_server::sp([\d]).*" => "cpe:/o:microsoft:windows_2003_server:-:sp$1",
"cpe:\/o:microsoft:windows_server_2008:r2::x64.*" => "cpe:/o:microsoft:windows_server_2008:r2",
"cpe:\/o:redhat:enterprise_linux:([\d]+)::.*" => "cpe:/o:redhat:enterprise_linux:$1",
"cpe:\/o:sun:sunos:([\d]+)::x([\d]+).*" => "cpe:/o:oracle:solaris:$1",
"cpe:\/o:sun:sunos:([\d]+)::.*" => "cpe:/o:oracle:solaris:$1",
"cpe:\/o:vmware:esx_server.*" => "cpe:/o:vmware:esxi:5.0",
"cpe:\/o:centos:centos:([\d]+).*" => "cpe:/o:centos:centos:$1",
];

View File

@ -22,6 +22,7 @@
* - Nov 7, 2016 - Added d parameter documentation
* - Dec 7, 2016 - Added check for "Interesting ports on {IP}" line
* - Jan 30, 2017 - Updated to use parse_config.ini file, and added populating new targets with shortened os software string if available.
* - Jan 21, 2019 - fixed filetype check for .nmap and .gnmap files.
*/
$cmd = getopt("f:", ['debug::', 'help::']);
@ -94,7 +95,13 @@ foreach ($lines as $line_num => $line) {
$line = trim($line, "\t\n\r"); # chomp would be nice...
$matches = [];
if (!isset($filetype)) {
if (preg_match('/Starting|\-oN/', $line)) {
if (preg_match('/\.nmap/', $cmd['f'])) {
$filetype = "text";
}
elseif (preg_match('/\.gnmap/', $cmd['f'])) {
$filetype = "grep";
}
elseif (preg_match('/Starting|\-oN/', $line)) {
$filetype = "text";
}
elseif (preg_match('/\-oG/', $line)) {