Unified Automation UaGateway Version Detection (Windows)
2019-02-12T00:00:00
ID OPENVAS:1361412562310107554 Type openvas Reporter Copyright (C) 2019 Greenbone Networks GmbH Modified 2019-12-05T00:00:00
Description
Detects the installed version
of Unified Automation UaGateway for Windows.
# Copyright (C) 2019 Greenbone Networks GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
if(description)
{
script_oid("1.3.6.1.4.1.25623.1.0.107554");
script_version("2019-12-05T15:10:00+0000");
script_tag(name:"last_modification", value:"2019-12-05 15:10:00 +0000 (Thu, 05 Dec 2019)");
script_tag(name:"creation_date", value:"2019-02-12 12:14:22 +0100 (Tue, 12 Feb 2019)");
script_tag(name:"cvss_base", value:"0.0");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Unified Automation UaGateway Version Detection (Windows)");
script_category(ACT_GATHER_INFO);
script_copyright("Copyright (C) 2019 Greenbone Networks GmbH");
script_family("Product detection");
script_dependencies("smb_reg_service_pack.nasl");
script_mandatory_keys("SMB/WindowsVersion", "SMB/Windows/Arch");
script_require_ports(139, 445);
script_tag(name:"summary", value:"Detects the installed version
of Unified Automation UaGateway for Windows.");
script_xref(name:"URL", value:"https://www.unified-automation.com/");
script_tag(name:"qod_type", value:"registry");
exit(0);
}
include("smb_nt.inc");
include("cpe.inc");
include("host_details.inc");
include("secpod_smb_func.inc");
os_arch = get_kb_item("SMB/Windows/Arch");
if(!os_arch)
exit(0);
if("x86" >< os_arch) {
key_list = make_list("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\");
} else if("x64" >< os_arch) {
key_list = make_list("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",
"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\");
}
if(isnull(key_list)) exit(0);
foreach key (key_list) {
foreach item (registry_enum_keys(key:key)) {
appName = registry_get_sz(key:key + item, item:"DisplayName");
if(!appName || appName !~ "UaGateway") continue;
concluded = appName;
location = "unknown";
loc = registry_get_sz(key:key + item, item:"InstallLocation");
if(loc) location = loc;
else {
loc = registry_get_sz(key:key + item, item:"UninstallString");
if(loc) {
split = split( loc, sep:"\" );
location = ereg_replace(string:loc, pattern:split[max_index(split) - 1], replace:'');
}
}
if(!version = registry_get_sz(key:key + item, item:"DisplayVersion"))
version = "unknown";
set_kb_item(name:"unifiedautomation/uagateway/win/detected", value:TRUE);
register_and_report_cpe(app:"Unified Automation " + appName, ver:version, concluded:concluded,
base:"cpe:/a:unfiedautomation:uagateway:", expr:"^([0-9.]+)", insloc:location, regService:"smb-login", regPort:0);
exit(0);
}
}
exit(0);
{"id": "OPENVAS:1361412562310107554", "type": "openvas", "bulletinFamily": "scanner", "title": "Unified Automation UaGateway Version Detection (Windows)", "description": "Detects the installed version\n of Unified Automation UaGateway for Windows.", "published": "2019-02-12T00:00:00", "modified": "2019-12-05T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310107554", "reporter": "Copyright (C) 2019 Greenbone Networks GmbH", "references": ["https://www.unified-automation.com/"], "cvelist": [], "lastseen": "2019-12-06T15:25:39", "viewCount": 3, "enchantments": {"dependencies": {"references": [], "modified": "2019-12-06T15:25:39", "rev": 2}, "score": {"value": 0.3, "vector": "NONE", "modified": "2019-12-06T15:25:39", "rev": 2}, "vulnersScore": 0.3}, "pluginID": "1361412562310107554", "sourceData": "# Copyright (C) 2019 Greenbone Networks GmbH\n#\n# SPDX-License-Identifier: GPL-2.0-or-later\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.107554\");\n script_version(\"2019-12-05T15:10:00+0000\");\n script_tag(name:\"last_modification\", value:\"2019-12-05 15:10:00 +0000 (Thu, 05 Dec 2019)\");\n script_tag(name:\"creation_date\", value:\"2019-02-12 12:14:22 +0100 (Tue, 12 Feb 2019)\");\n script_tag(name:\"cvss_base\", value:\"0.0\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:N/I:N/A:N\");\n script_name(\"Unified Automation UaGateway Version Detection (Windows)\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2019 Greenbone Networks GmbH\");\n script_family(\"Product detection\");\n script_dependencies(\"smb_reg_service_pack.nasl\");\n script_mandatory_keys(\"SMB/WindowsVersion\", \"SMB/Windows/Arch\");\n script_require_ports(139, 445);\n\n script_tag(name:\"summary\", value:\"Detects the installed version\n of Unified Automation UaGateway for Windows.\");\n script_xref(name:\"URL\", value:\"https://www.unified-automation.com/\");\n script_tag(name:\"qod_type\", value:\"registry\");\n\n exit(0);\n}\n\ninclude(\"smb_nt.inc\");\ninclude(\"cpe.inc\");\ninclude(\"host_details.inc\");\ninclude(\"secpod_smb_func.inc\");\n\nos_arch = get_kb_item(\"SMB/Windows/Arch\");\nif(!os_arch)\n exit(0);\n\nif(\"x86\" >< os_arch) {\n key_list = make_list(\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\\");\n} else if(\"x64\" >< os_arch) {\n key_list = make_list(\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\\",\n \"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\\");\n}\n\nif(isnull(key_list)) exit(0);\n\nforeach key (key_list) {\n foreach item (registry_enum_keys(key:key)) {\n\n appName = registry_get_sz(key:key + item, item:\"DisplayName\");\n if(!appName || appName !~ \"UaGateway\") continue;\n\n concluded = appName;\n location = \"unknown\";\n\n loc = registry_get_sz(key:key + item, item:\"InstallLocation\");\n if(loc) location = loc;\n else {\n loc = registry_get_sz(key:key + item, item:\"UninstallString\");\n if(loc) {\n split = split( loc, sep:\"\\\" );\n location = ereg_replace(string:loc, pattern:split[max_index(split) - 1], replace:'');\n }\n }\n\n if(!version = registry_get_sz(key:key + item, item:\"DisplayVersion\"))\n version = \"unknown\";\n\n set_kb_item(name:\"unifiedautomation/uagateway/win/detected\", value:TRUE);\n\n register_and_report_cpe(app:\"Unified Automation \" + appName, ver:version, concluded:concluded,\n base:\"cpe:/a:unfiedautomation:uagateway:\", expr:\"^([0-9.]+)\", insloc:location, regService:\"smb-login\", regPort:0);\n exit(0);\n }\n}\n\nexit(0);\n", "naslFamily": "Product detection"}