Skip to content
Misconfiguration Write-up Intermediate

Misconfigured WordPress takeover to Remote Code Execution

A WordPress installation was left unfinished and publicly reachable, so an attacker could supply their own database and complete the setup, taking over the CMS. From the admin panel they then uploaded a theme containing a PHP web shell to run commands on the server.

Smaran Chand Follow

Published on smaranchand.com.np

Hello Everyone, I hope you guys are doing well. I am sharing a recent issue which I discovered today only.

Smaran Chand (@smaranchand), on smaranchand.com.np

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 WordPress setup wizard was left reachable after installation had not been completed, allowing anyone to supply database details and finish the install.

Impact

An attacker could take over the CMS and then execute code on the web server, as demonstrated on a Windows server.

What the attacker needed

Unfinished WordPress install reachable; attacker-controlled database; server IP whitelisted on database

The fix

The setup should be blocked once installation is complete, or the unfinished install removed from public access.

How it was found

  1. Visit the subdomain and find the WordPress setup page.
  2. Create a remote MySQL database in Azure and whitelist the server's IP.
  3. Create a database using a SQL client.
  4. Submit the attacker's database details on the setup page to complete installation.
  5. Log in to the WordPress admin panel.
  6. Upload a theme containing a PHP web shell and access it under the themes directory.

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.

A website was left half-installed, so anyone visiting could finish the setup by pointing it at a database they controlled. Once the attacker owned the site's admin area, they added a small program to a theme so the server would run their code.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Smaran Chand

View all

8 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.