My Website Keeps Getting Hacked

OK, so this is an embarrassing post, but I need some help.

I have a Linode that I host a bunch of dockers on. I’m pretty good about security but I gave a friend of mine a WordPress blog after some begging. He immediately installed a bunch of plugins, which I then immediately uninstalled because I’m not mentally insane and know that’s a surefire way to get hacked.

However, after lots of arguing, I agreed to let him have this one specific one, Crayon Syntax Highlighter. A couple weeks later, I noticed that my CPU usage is at 99% all the time. Sure enough, in the wp-content/plugins folder is 3f232a6f and 3f232a6f.tar.gz. There’s a process running with the command 3f232a6f using 97% CPU. Pretty obviously some kind of miner or something. My dumb fault for hosting WordPress to begin with, and forgetting to set the permissions more restrictively after I deleted all the plugins.

I have since nuked Crayon Syntax Highlighter. I’ve also set the wp-content permissions to 644. Every time I delete the binary though, it reappears elsewhere. How the heck do I track this thing down? I haven’t found any script files, any more .tar.gz files, yet somehow this virus keeps reappearing in random folders in the wp-content section.

None of my other dockers or wordpress sites are having any issues, and the binary is being run by the www-data user. Any suggestions would be appreciated.

If you’re running turd press and not using word fence you’re basically asking for trouble. Can’t recommend it enough.

5 Likes

With no actual analysis in hand I’m guessing it’s a memory worm.
Assuming your system isn’t a mission critical setup you should power the server down to flush the RAM, then dive in to the filesystem to remove the binaries from an external source.

Check any end user generated files. If that blog allows posting images, any image can be a disguised script that can be triggered with a simple HTTP GET request.

Dont feel bad, even big sites get hacked, encyclopedia dramatica got hacked because the site owner had the root password [insert n-word]123, God Zaiger was a muppet

Also letting a buddy install a wordpress site on your server is like letting a crackhead stay in your house, you only have your self to blame when you come home and find your tv missing

1 Like

Yes, absolutely install wordfence first thing and setup email notifications.

I also suggest whitelisting access to the /wp-admin directory by IP, using 2-factor auth, and putting your site behind Cloudflare. These steps will block pretty much everybody doing random scans rattling your doorknob, which should be your main concern.

If someone specifically targets you and knows what they’re doing, you’re generally screwed. That applies to every site.

1 Like

So I tried this, but every hour or so later, it’d keep popping back up.

Yup. Hence why I hang my head in shame.

Pretty slick plugin. Found 194 vulnerabilities. Most of them were php scripts to allow file execution. I’m hoping (but not exactly expecting) that fixing those and deleting the binary and restarting the server has solved the problem, but I’ll know in a couple of hours. All it takes is to miss one…

1 Like