Skip to content
RCE Write-up Intermediate

Hacking A Wordpress Blog

A WordPress blog running version 5.0 exposed usernames through its API and allowed password brute-forcing over xmlrpc.php, which led to admin credentials. The attacker then used a known image-upload remote code execution exploit to obtain a reverse shell.

David Eduardo Karpinski Follow

Published on systemweakness.com

Hey guys! Today we’re going to tackle the CTF Blog, from TryHackMe (not to break the habit), which basically involves a blog made by our friend Billy Joel on top of WordPress (at this point you can already imagine where this is going).

David Eduardo Karpinski, on systemweakness.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 an outdated WordPress version with an enabled xmlrpc.php login endpoint and a vulnerable image-cropping upload feature.

Impact

An attacker could recover admin credentials and then execute commands on the server, gaining a shell.

What the attacker needed

Network access to the blog; xmlrpc.php enabled; weak user password

The fix

The blog should be updated to a current WordPress version, xmlrpc.php should be restricted, and the vulnerable upload feature patched.

How it was found

  1. Add the target domain to the hosts file and scan ports with Nmap.
  2. Run WPScan against the site to list versions and exposed directories.
  3. Enumerate usernames through the WordPress API.
  4. Brute-force the users' passwords with Metasploit's xmlrpc login module.
  5. Log in to the admin page with the recovered credentials.
  6. Run the image-upload RCE exploit to get a reverse shell.

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 WordPress blog was running old software. Its login system let someone guess passwords over and over until one worked, and the old version had a flaw in how it handled uploaded images that let an attacker run their own commands on 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.

More by David Eduardo Karpinski

View all

1 more disclosed report, best first.

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.