Skip to content
RCE Write-up Intermediate

403 to RCE in XAMPP

A web server running an old XAMPP installation exposed the bundled php-cgi binary through a ScriptAlias mapping, and that binary was vulnerable to CVE-2012-1823. By pointing a Metasploit module at that path, the author achieved remote code execution as SYSTEM.

securifera.com

Published on securifera.com

The original lives on securifera.com

We do not hold its text, 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 default XAMPP Apache configuration maps the bundled php-cgi.exe into the web root via ScriptAlias, exposing a PHP version affected by CVE-2012-1823 to remote requests.

Impact

An attacker could achieve remote code execution as the SYSTEM account on the web server.

What the attacker needed

Target runs old XAMPP on Windows; php-cgi exposed via ScriptAlias; network access to the web server

How it was found

  1. Review website screenshots and the 403 page to identify the outdated XAMPP version and platform.
  2. Install a matching XAMPP version locally and inspect the Apache configuration for ScriptAlias entries.
  3. Note the /php-cgi/php-cgi.exe path exposed by the supplemental configuration.
  4. Load the Metasploit module for CVE-2012-1823 and set the target URI to that php-cgi path.
  5. Run the exploit and obtain remote code execution as SYSTEM.

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.

XAMPP is a package that bundles a web server and PHP together. An old version of PHP had a flaw where a specially crafted request to the PHP command-line program could make it run attacker-supplied code. Because the web server was configured to expose that program, the attacker could run commands on the machine as the highest-privilege Windows account.

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.