ID OPENVAS:1361412562310108758 Type openvas Reporter Copyright (C) 2020 Greenbone Networks GmbH Modified 2020-04-24T00:00:00
Description
The remote Huawei Versatile Routing Platform (VRP) device is using
known default credentials for the Telnet-Login.
# Copyright (C) 2020 Greenbone Networks GmbH
# Some text descriptions might be excerpted from the referenced
# advisories, and are Copyright (C) by the respective right holder(s)
#
# 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.108758");
script_version("2020-04-24T11:49:09+0000");
script_tag(name:"cvss_base", value:"7.5");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");
script_tag(name:"last_modification", value:"2020-04-24 11:49:09 +0000 (Fri, 24 Apr 2020)");
script_tag(name:"creation_date", value:"2020-04-24 10:19:23 +0000 (Fri, 24 Apr 2020)");
script_name("Huawei VRP Default Credentials (Telnet)");
script_category(ACT_ATTACK);
script_family("Default Accounts");
script_copyright("Copyright (C) 2020 Greenbone Networks GmbH");
# nb: Don't use the keys or dependencies to / from gb_huawei_vrp_network_device_consolidation.nasl / gb_huawei_vrp_network_device_telnet_detect.nasl
# because telnetserver_detect_type_nd_version.nasl is checking for an additional banner which isn't necessarily a VRP device.
script_dependencies("telnetserver_detect_type_nd_version.nasl", "gb_default_credentials_options.nasl");
script_require_ports("Services/telnet", 23);
script_mandatory_keys("telnet/huawei/vrp/detected");
script_exclude_keys("default_credentials/disable_default_account_checks");
script_xref(name:"URL", value:"https://support.huawei.com/enterprise/en/doc/EDOC1000060368/25506195/understanding-the-list-of-default-user-names-and-passwords");
script_tag(name:"summary", value:"The remote Huawei Versatile Routing Platform (VRP) device is using
known default credentials for the Telnet-Login.");
script_tag(name:"impact", value:"This issue may be exploited by a remote attacker to gain access to
sensitive information or modify system configuration.");
script_tag(name:"insight", value:"The remote Huawei Versatile Routing Platform (VRP) device is lacking
a proper password configuration, which makes critical information and actions accessible for people
with knowledge of the default credentials.");
script_tag(name:"vuldetect", value:"Tries to login using the default credentials: 'admin:admin',
'root:admin', 'admin:admin@huawei.com' or 'super:sp-admin'.");
script_tag(name:"solution", value:"Change the default password.");
script_tag(name:"solution_type", value:"Mitigation");
script_tag(name:"qod_type", value:"remote_vul");
exit(0);
}
if( get_kb_item( "default_credentials/disable_default_account_checks" ) )
exit( 0 );
include("telnet_func.inc");
include("misc_func.inc");
include("dump.inc");
creds = make_list( "admin:admin@huawei.com",
"admin:admin",
"root:admin",
"super:sp-admin" );
cmd = "display version";
report = 'It was possible to login to the remote Huawei VRP device via Telnet with the following known credentials:';
port = telnet_get_port( default:23 );
banner = telnet_get_banner( port:port );
if( ! banner || ( "Warning: Telnet is not a secure protocol, and it is recommended to use Stelnet." >!< banner && ( "Login authentication" >!< banner || "Username:" >!< banner ) ) )
exit( 0 );
foreach cred( creds ) {
if( ! soc = open_sock_tcp( port ) )
continue;
split = split( cred, sep:":", keep:FALSE );
if( max_index( split ) != 2 ) {
telnet_close_socket( socket:soc );
continue;
}
username = split[0];
password = split[1];
banner = telnet_negotiate( socket:soc );
if( ! banner || "Username:" >!< banner ) {
telnet_close_socket( socket:soc, data:banner );
if( "%connection refused by remote host!" )
exit( 0 ); # We're blocked, no need to continue here
else
continue;
}
send( socket:soc, data:username + '\r\n' );
sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.
res = recv( socket:soc, length:128 );
if( ! res || "Password:" >!< res ) {
telnet_close_socket( socket:soc, data:res );
continue;
}
send( socket:soc, data:password + '\r\n' );
sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.
res = recv( socket:soc, length:128 );
if( ! res || "Error: Authentication fail" >< res ) {
telnet_close_socket( socket:soc, data:res );
# nb: We're waiting here because of the two "admin" accounts with different passwords.
if( wait = eregmatch( string:res, pattern:"(Please retry after|Login authentication failed\. Please wait for) ([0-9]+) seconds\.", icase:FALSE ) )
sleep( int( wait[2] ) + 1 );
else
sleep( 6 ); # fallback
continue;
}
send( socket:soc, data:cmd + '\r\n' );
sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.
cmd_res = recv( socket:soc, length:1024 );
telnet_close_socket( socket:soc, data:cmd_res );
if( display_vers = egrep( pattern:"(Huawei Versatile Routing Platform|VRP \(R\) software)", string:cmd_res ) ) {
vuln = TRUE;
report += '\n\nUsername: "' + username + '", Password: "' + password + '"';
report += '\n\nIt was also possible to execute "' + cmd + '" as "' + username + '". Result:\n\n' + chomp( display_vers );
}
}
if( vuln ) {
security_message( port:port, data:report );
exit( 0 );
}
exit( 99 );
{"id": "OPENVAS:1361412562310108758", "type": "openvas", "bulletinFamily": "scanner", "title": "Huawei VRP Default Credentials (Telnet)", "description": "The remote Huawei Versatile Routing Platform (VRP) device is using\n known default credentials for the Telnet-Login.", "published": "2020-04-24T00:00:00", "modified": "2020-04-24T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310108758", "reporter": "Copyright (C) 2020 Greenbone Networks GmbH", "references": ["https://support.huawei.com/enterprise/en/doc/EDOC1000060368/25506195/understanding-the-list-of-default-user-names-and-passwords"], "cvelist": [], "lastseen": "2020-04-28T17:13:08", "viewCount": 5, "enchantments": {"dependencies": {"references": [], "modified": "2020-04-28T17:13:08", "rev": 2}, "score": {"value": -0.1, "vector": "NONE", "modified": "2020-04-28T17:13:08", "rev": 2}, "vulnersScore": -0.1}, "pluginID": "1361412562310108758", "sourceData": "# Copyright (C) 2020 Greenbone Networks GmbH\n# Some text descriptions might be excerpted from the referenced\n# advisories, 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.108758\");\n script_version(\"2020-04-24T11:49:09+0000\");\n script_tag(name:\"cvss_base\", value:\"7.5\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:P/I:P/A:P\");\n script_tag(name:\"last_modification\", value:\"2020-04-24 11:49:09 +0000 (Fri, 24 Apr 2020)\");\n script_tag(name:\"creation_date\", value:\"2020-04-24 10:19:23 +0000 (Fri, 24 Apr 2020)\");\n script_name(\"Huawei VRP Default Credentials (Telnet)\");\n script_category(ACT_ATTACK);\n script_family(\"Default Accounts\");\n script_copyright(\"Copyright (C) 2020 Greenbone Networks GmbH\");\n # nb: Don't use the keys or dependencies to / from gb_huawei_vrp_network_device_consolidation.nasl / gb_huawei_vrp_network_device_telnet_detect.nasl\n # because telnetserver_detect_type_nd_version.nasl is checking for an additional banner which isn't necessarily a VRP device.\n script_dependencies(\"telnetserver_detect_type_nd_version.nasl\", \"gb_default_credentials_options.nasl\");\n script_require_ports(\"Services/telnet\", 23);\n script_mandatory_keys(\"telnet/huawei/vrp/detected\");\n script_exclude_keys(\"default_credentials/disable_default_account_checks\");\n\n script_xref(name:\"URL\", value:\"https://support.huawei.com/enterprise/en/doc/EDOC1000060368/25506195/understanding-the-list-of-default-user-names-and-passwords\");\n\n script_tag(name:\"summary\", value:\"The remote Huawei Versatile Routing Platform (VRP) device is using\n known default credentials for the Telnet-Login.\");\n\n script_tag(name:\"impact\", value:\"This issue may be exploited by a remote attacker to gain access to\n sensitive information or modify system configuration.\");\n\n script_tag(name:\"insight\", value:\"The remote Huawei Versatile Routing Platform (VRP) device is lacking\n a proper password configuration, which makes critical information and actions accessible for people\n with knowledge of the default credentials.\");\n\n script_tag(name:\"vuldetect\", value:\"Tries to login using the default credentials: 'admin:admin',\n 'root:admin', 'admin:admin@huawei.com' or 'super:sp-admin'.\");\n\n script_tag(name:\"solution\", value:\"Change the default password.\");\n\n script_tag(name:\"solution_type\", value:\"Mitigation\");\n script_tag(name:\"qod_type\", value:\"remote_vul\");\n\n exit(0);\n}\n\nif( get_kb_item( \"default_credentials/disable_default_account_checks\" ) )\n exit( 0 );\n\ninclude(\"telnet_func.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"dump.inc\");\n\ncreds = make_list( \"admin:admin@huawei.com\",\n \"admin:admin\",\n \"root:admin\",\n \"super:sp-admin\" );\n\ncmd = \"display version\";\n\nreport = 'It was possible to login to the remote Huawei VRP device via Telnet with the following known credentials:';\n\nport = telnet_get_port( default:23 );\n\nbanner = telnet_get_banner( port:port );\nif( ! banner || ( \"Warning: Telnet is not a secure protocol, and it is recommended to use Stelnet.\" >!< banner && ( \"Login authentication\" >!< banner || \"Username:\" >!< banner ) ) )\n exit( 0 );\n\nforeach cred( creds ) {\n\n if( ! soc = open_sock_tcp( port ) )\n continue;\n\n split = split( cred, sep:\":\", keep:FALSE );\n if( max_index( split ) != 2 ) {\n telnet_close_socket( socket:soc );\n continue;\n }\n\n username = split[0];\n password = split[1];\n\n banner = telnet_negotiate( socket:soc );\n if( ! banner || \"Username:\" >!< banner ) {\n telnet_close_socket( socket:soc, data:banner );\n if( \"%connection refused by remote host!\" )\n exit( 0 ); # We're blocked, no need to continue here\n else\n continue;\n }\n\n send( socket:soc, data:username + '\\r\\n' );\n sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.\n res = recv( socket:soc, length:128 );\n if( ! res || \"Password:\" >!< res ) {\n telnet_close_socket( socket:soc, data:res );\n continue;\n }\n\n send( socket:soc, data:password + '\\r\\n' );\n sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.\n res = recv( socket:soc, length:128 );\n\n if( ! res || \"Error: Authentication fail\" >< res ) {\n telnet_close_socket( socket:soc, data:res );\n # nb: We're waiting here because of the two \"admin\" accounts with different passwords.\n if( wait = eregmatch( string:res, pattern:\"(Please retry after|Login authentication failed\\. Please wait for) ([0-9]+) seconds\\.\", icase:FALSE ) )\n sleep( int( wait[2] ) + 1 );\n else\n sleep( 6 ); # fallback\n continue;\n }\n\n send( socket:soc, data:cmd + '\\r\\n' );\n sleep( 3 ); # nb: The devices requires quite some time to answer so wait for a few seconds.\n cmd_res = recv( socket:soc, length:1024 );\n telnet_close_socket( socket:soc, data:cmd_res );\n\n if( display_vers = egrep( pattern:\"(Huawei Versatile Routing Platform|VRP \\(R\\) software)\", string:cmd_res ) ) {\n vuln = TRUE;\n report += '\\n\\nUsername: \"' + username + '\", Password: \"' + password + '\"';\n report += '\\n\\nIt was also possible to execute \"' + cmd + '\" as \"' + username + '\". Result:\\n\\n' + chomp( display_vers );\n }\n}\n\nif( vuln ) {\n security_message( port:port, data:report );\n exit( 0 );\n}\n\nexit( 99 );\n", "naslFamily": "Default Accounts"}