Skip to content
RCE Write-up Intermediate

What the doc says

Apache Guacamole's telnet connection feature allows users to specify arbitrary hosts, ports, and file paths for session recordings, enabling an authenticated attacker to write a JSP webshell to Tomcat's webroot and achieve remote code execution. The same lack of restrictions permits SSRF to internal services such as PostgreSQL, which trusts loopback connections, potentially leading to further code execution.

thinkloveshare.com

Published on thinkloveshare.com

While doing research on various topics, I stood upon Guacamole, a software that can be used as a connection bastion or protocolar gateway. It has many original vulnerabilities that lead to a Remote Code Execution once chained.

The author, on thinkloveshare.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the telnet connection feature lacks restrictions on the destination host, port, and the file path and extension used for session recordings, allowing arbitrary file write and SSRF.

Impact

An authenticated attacker could achieve remote code execution on the Guacamole server, and potentially pivot to other internal services via SSRF, though the impact is reduced in docker-compose setups where components are isolated.

What the attacker needed

Valid Guacamole account (admin or privileged); Guacamole with telnet feature enabled; Tomcat and Guacd on same host (for webshell chain)

The fix

The report suggests preventing access to the loopback, adding a whitelist of reachable hosts, and enforcing the extension and path used for saving recordings.

How it was found

  1. Log in to Guacamole with default or weak credentials.
  2. Create a new telnet connection, setting the recording path to Tomcat's webroot and the filename to a JSP file.
  3. Connect to the telnet session and enter content that includes a JSP webshell, ensuring a newline triggers the file write.
  4. Access the webshell via the browser to execute commands.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Apache Guacamole is a tool that lets people connect to remote computers through a web browser. The report shows that a logged-in user can abuse a recording feature to save a malicious file on the server, which then runs code when visited. This means someone with a valid account could take over the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.