Apache Guacamole Default Credentials (HTTP)
🗓️ 04 Aug 2021 00:00:00Reported by Copyright (C) 2021 Greenbone Networks GmbHType
openvas🔗 plugins.openvas.org👁 289 Views
# Copyright (C) 2021 Greenbone Networks GmbH
# Some text descriptions might be excerpted from (a) referenced
# source(s), 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.
CPE = "cpe:/a:apache:guacamole";
if(description)
{
script_oid("1.3.6.1.4.1.25623.1.0.117610");
script_version("2022-02-15T15:02:34+0000");
script_tag(name:"last_modification", value:"2022-02-15 15:02:34 +0000 (Tue, 15 Feb 2022)");
script_tag(name:"creation_date", value:"2021-08-04 10:19:36 +0000 (Wed, 04 Aug 2021)");
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_name("Apache Guacamole Default Credentials (HTTP)");
script_category(ACT_ATTACK);
script_family("Default Accounts");
script_copyright("Copyright (C) 2021 Greenbone Networks GmbH");
script_dependencies("gb_apache_guacamole_http_detect.nasl", "gb_default_credentials_options.nasl");
script_require_ports("Services/www", 80);
script_mandatory_keys("apache/guacamole/http/detected");
script_exclude_keys("default_credentials/disable_default_account_checks");
script_tag(name:"summary", value:"The remote Apache Guacamole instance is using known default
credentials for the HTTP login.");
script_tag(name:"vuldetect", value:"Tries to login via HTTP using known default credentials.");
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:"affected", value:"All Apache Guacamole instances with default credentials.");
script_tag(name:"solution", value:"Change the password.");
script_tag(name:"qod_type", value:"remote_vul");
script_tag(name:"solution_type", value:"Mitigation");
exit(0);
}
if( get_kb_item( "default_credentials/disable_default_account_checks" ) )
exit( 0 );
include("host_details.inc");
include("http_func.inc");
include("http_keepalive.inc");
include("misc_func.inc");
if( ! port = get_app_port( cpe:CPE, service:"www" ) )
exit( 0 );
if( ! dir = get_app_location( cpe:CPE, port:port ) )
exit( 0 );
if( dir == "/" )
dir = "";
creds = make_array();
creds["guacadmin"] = "guacadmin";
url = dir + "/api/tokens";
report = "It was possible to gather a valid 'authToken' with the following known default credentials (username:password:authToken) via a login at '" + http_report_vuln_url( port:port, url:url, url_only:TRUE ) + "':" + '\n';
foreach username( keys( creds ) ) {
password = creds[username];
data = "username=" + username + "&password=" + password;
req = http_post_put_req( port:port, url:url, data:data, add_headers:make_array( "Content-Type", "application/x-www-form-urlencoded" ) );
res = http_keepalive_send_recv( port:port, data:req );
if( ! res || res !~ "^HTTP/1\.[01] 200" )
continue;
headers = http_extract_headers_from_response( data:res );
body = http_extract_body_from_response( data:res );
if( ! headers || ! body || headers !~ "Content-Type\s*:\s*application/json" )
continue;
# e.g. the following with a 200 status code for successful login:
# {"authToken":"C48C40DC75BDA1229B183BEF10834C6EE2A5BE3F6131236DE37014FC8D0F22B8","username":"guacadmin","dataSource":"postgresql","availableDataSources":["postgresql","postgresql-shared"]}
# or the following on invalid credentials with a 403 status code:
# {"message":"Invalid login","translatableMessage":{"key":"APP.TEXT_UNTRANSLATED","variables":{"MESSAGE":"Invalid login"}},"statusCode":null,"expected":[{"name":"username","type":"USERNAME"},{"name":"password","type":"PASSWORD"}],"type":"INVALID_CREDENTIALS"}
# see e.g.:
# https://github.com/ridvanaltun/guacamole-rest-api-documentation/blob/master/docs/AUTHENTICATION.md#generate-token
if( egrep( string:body, pattern:'"username"\\s*:\\s*"' + username + '"', icase:FALSE ) &&
egrep( string:body, pattern:'"authToken"\\s*:\\s*"[^"]+"', icase:FALSE ) ) {
token = "N/A";
to = eregmatch( string:body, pattern:'"authToken"\\s*:\\s*"([^"]+)"', icase:FALSE );
if( to[1] )
token = to[1];
report += '\n' + username + ":" + password + ":" + token;
VULN = TRUE;
}
}
if( VULN ) {
security_message( port:port, data:report );
exit( 0 );
}
exit( 99 );Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
15 Feb 2022 00:00Current
7.5High risk
Vulners AI Score7.5