SSH login-based detection of Huawei FusionSphere OpenStack.
{"id": "OPENVAS:1361412562310145271", "type": "openvas", "bulletinFamily": "scanner", "title": "Huawei FusionSphere OpenStack Detection (SSH Login)", "description": "SSH login-based detection of Huawei FusionSphere OpenStack.", "published": "2021-01-28T00:00:00", "modified": "2021-02-01T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310145271", "reporter": "Copyright (C) 2021 Greenbone Networks GmbH", "references": [], "cvelist": [], "lastseen": "2021-02-03T20:39:10", "viewCount": 7, "enchantments": {"dependencies": {}, "score": {"value": 0.2, "vector": "NONE"}, "backreferences": {}, "exploitation": null, "vulnersScore": 0.2}, "pluginID": "1361412562310145271", "sourceData": "# Copyright (C) 2021 Greenbone Networks GmbH\n# Some text descriptions might be excerpted from (a) referenced\n# source(s), and are Copyright (C) by the respective right holder(s).\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.145271\");\n script_version(\"2021-02-01T14:29:13+0000\");\n script_tag(name:\"last_modification\", value:\"2021-02-01 14:29:13 +0000 (Mon, 01 Feb 2021)\");\n script_tag(name:\"creation_date\", value:\"2021-01-28 08:56:42 +0000 (Thu, 28 Jan 2021)\");\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\n script_tag(name:\"qod_type\", value:\"package\");\n\n script_name(\"Huawei FusionSphere OpenStack Detection (SSH Login)\");\n\n script_tag(name:\"summary\", value:\"SSH login-based detection of Huawei FusionSphere OpenStack.\");\n\n script_category(ACT_GATHER_INFO);\n\n script_copyright(\"Copyright (C) 2021 Greenbone Networks GmbH\");\n script_family(\"Product detection\");\n script_dependencies(\"gb_huawei_euleros_consolidation.nasl\");\n script_require_ports(\"Services/ssh\", 22);\n script_mandatory_keys(\"ssh/login/euleros/is_uvp\", \"huawei/euleros/ssh-login/port\");\n\n exit(0);\n}\n\ninclude(\"host_details.inc\");\ninclude(\"ssh_func.inc\");\n\nif (!infos = get_app_port_from_cpe_prefix(cpe: \"cpe:/o:huawei:euleros_virtualization\", service: \"ssh-login\"))\n exit(0);\n\nport = infos[\"port\"];\n\nsoc = ssh_login_or_reuse_connection();\nif (!soc)\n exit(0);\n\n# {\"install_type\": \"openstack\", \"install_info\": {\"os\": [{\"platform\": \"x86_64\", \"default_os\": \"true\", \"version\": \"2.0\", \"type\": \"euleros\"}]}, \"solution_scenes\": \"NFVI\"\n# Where NFVI are FusionSphere OpenStack installations\nfile = \"/opt/fusionplatform/data/fusionsphere/cfg/install-data.cfg\";\ninstall_data = ssh_cmd(socket: soc, cmd: \"cat \" + file);\nif (install_data !~ '\"solution_scenes\"\\\\s*:\\\\s*\"NFVI\"') {\n close(soc);\n exit(0);\n}\n\nconclloc = \" - \" + file;\nconcl = \" - \" + install_data;\n\nfile = \"/etc/hostos.version\";\nhostos = ssh_cmd(socket: soc, cmd: \"cat \" + file);\nclose(soc);\n\nversion = \"unknown\";\n\nset_kb_item(name: \"huawei/fusionsphere_openstack/detected\", value: TRUE);\nset_kb_item(name: \"huawei/fusionsphere_openstack/ssh-login/port\", value: port);\n\n# FUSIONSPHERE FUSIONPLATFORM 8.0.0.SPC17\nvers = eregmatch(pattern: 'FUSIONSPHERE FUSIONPLATFORM ([^\\r\\n]+)', string: hostos);\nif (!isnull(vers[1])) {\n conclloc += '\\n - ' + file;\n concl += '\\n - ' + vers[0];\n version = vers[1];\n}\n\nset_kb_item(name: \"huawei/fusionsphere_openstack/ssh-login/\" + port + \"/concluded\", value: concl);\nset_kb_item(name: \"huawei/fusionsphere_openstack/ssh-login/\" + port + \"/concluded_loc\", value: conclloc);\nset_kb_item(name: \"huawei/fusionsphere_openstack/ssh-login/\" + port + \"/version\", value: version);\n\nexit(0);\n", "naslFamily": "Product detection", "immutableFields": [], "cvss2": {}, "cvss3": {}, "_state": {"dependencies": 1645857204}}