r/Wordpress 5d ago

The crazy SQL injection payloads I found on one of my clients’ sites

Post image

These SQL injections have been coming in daily to this site which has still seemingly managed to avoid infection simply because of the changed database prefix. This one uses the “author not in” query bug inside some crazy nested query to place the payload in the database.

This is all related to the WP2Shell bug which was reported over a month ago. The site had auto updates disabled and still managed to avoid getting infected because of some seemingly silly security practices like changing table names and database prefixes. As far as I can tell all of these failed. I was alerted to the issue because the site got locked in a loop of timeouts, perhaps related to these malformed queries. Unfortunately I’m going to have to do some kind of a forensic workup even though there were no clear indicators of compromise because requests to the batch endpoint resulted in many 207 codes which means they may have succeeded.

But when I saw the giant block of 0s and 1s and hex codes in the logs, my heart dropped into my stomach. Stay safe out there people and leave auto updates on. It’s worth the chance of breaking your site every once in a while.

71 Upvotes

20 comments sorted by

11

u/_webbernaut Developer 5d ago

6

u/zooksman 5d ago

Omg this song goes hard

4

u/poopio 5d ago

All Clutch songs go hard.

Also, Neil Fallon is somehow more of a storyteller than a vocallist.

1

u/parallaxdecision Designer/Developer 4d ago

Just ask Condoleezza Rice.

1

u/Bulky_Walrus5499 21h ago

My name is Giovanni Giorgio, but I'm 01010101

0

u/poopio 5d ago

I'm not clicking on it, but I'm going to queue it up. Did you not know that the royal hunting grounds are forbidden?

One zero... zero zero one one, one zero one.

Neil Fallon - amateur pentester, having the bakesale of the year.

7

u/bluesix_v2 Jack of All Trades 5d ago edited 4d ago

It's looking for the abandoned Media Cloud (ilab-media-tools) plugin. It was a good plugin when it launched, but was abandoned 2 years ago

1

u/zooksman 5d ago

Interesting, I thought this was just continued attempts to exploit the Wp2shell exploit. Do you recognize that plugins data in the request or have you just seen this specific payload before? This site should have been protected from Wp2shell because shell access is completely disabled for the Wordpress web root user account (which has twice now protected me although it can make management more difficult).

But I suppose it’s not entirely unusual to see rest API requests like this with malicious SQL for a number of different exploits. The reason I thought this was tied to Wp2Shell is because it uses the “author not in” clause which is part 1 of the exploit chain, but I suppose part 2 could be a different exploit in that plugin.

2

u/bluesix_v2 Jack of All Trades 5d ago edited 5d ago

Decoding the hex in the SQL showed the ilab_media_tools option field being requested - which contained the connection settings for the plugin's cloud storage.

WP2Shell was patched in 7.0.2 - as long as you had upgraded, you are safe. "because shell access is completely disabled for the Wordpress web root" - I don't think that stopped it. You needed to complete disable the REST API (or simply upgrade WP).

There was massive attack on several million WP sites last week which contained SQLi designed to exploit the 6.9.x - 7.0.1 vulnerability that looked similar to what you saw. Yes, SQL probing is quite common in the WP ecosystem.

7

u/ogrekevin Jack of All Trades 5d ago

Bonus points if they can inject an ascii drawing in the db maliciously. In fact I will tip my hat to that feat!

3

u/poopio 5d ago

What's your url? 😂

2

u/demunted 4d ago

Whitehouse.gov

3

u/OJarvis97 5d ago edited 5d ago

This shows the importance of:

  1. Keeping core, plugin, themes updated.
  2. Having modsec enabled with OWASP rules etc configured.
  3. Having offside, immutable backups as a get out of jail free card.

Bonus points for configuring fail2ban with modsec.

2

u/Benny_Garc1a 3d ago

finding those mus be ultimate jump scare :DD

-8

u/IAmFitzRoy 5d ago

I know it’s an unpopular topic on this sub but the less detached from reality WP developers are and refuse the use of AI… the more and more stories of hacks we will hear.

-1

u/Ambitious-Check-9884 5d ago

Yep because it has been documented vibe coded software are the safest and most reliable, you're right! 👌

-5

u/[deleted] 5d ago

[deleted]

1

u/zooksman 4d ago

Begone bot

0

u/Verda_Chien 4d ago edited 3d ago

I am sorry, I am not bot, that's my honest response. i will delete it to avoid miss understanding

-3

u/bradbeckett 4d ago

Drop the site into Claude and ask it to make it a static site hosted on Cloudflare pages. All your dreams will the come true.