[bitfolk] Security incident: Wordpress compromise

Top Page
Author: Andy Smith
Date:  
To: users
Subject: [bitfolk] Security incident: Wordpress compromise

Reply to this message
gpg: Signature made Sun Dec 30 20:10:46 2012 UTC
gpg: using DSA key 2099B64CBF15490B
gpg: Good signature from "Andy Smith <andy@strugglers.net>" [unknown]
gpg: aka "Andrew James Smith <andy@strugglers.net>" [unknown]
gpg: aka "Andy Smith (UKUUG) <andy.smith@ukuug.org>" [unknown]
gpg: aka "Andy Smith (BitFolk Ltd.) <andy@bitfolk.com>" [unknown]
gpg: aka "Andy Smith (Linux User Groups UK) <andy@lug.org.uk>" [unknown]
gpg: aka "Andy Smith (Cernio Technology Cooperative) <andy.smith@cernio.com>" [unknown]
Hi,

On 15th December a customer asked for help in diagnosing high system
load and unusual Apache logs which contained login credentials for
MySQL.

Upon further investigation it appeared that around 30th November one
of the site's legitimate Wordpress admins had logged in from an
unexpected place (a Tor exit node) and had uploaded a PHP file which
appeared to enable full filesystem traversal, downloading of file
content, shell command execution as Apache user, etc.

This was also used to read the content of the Wordpress
configuration files thereby to gain access to the database as the
Wordpress user.

It appears that the Wordpress admin's own system was earlier
compromised and this opportunity was used to further compromise
sites they were known to have access to.

A copy of the hostile PHP upload can be found here:

    https://gist.github.com/4299683


It is difficult to strongly critique the customer's setup since the
compromise was as a result of a legitimate user account with admin
privileges being used to further attack the system.

It is easy to advise that web applications should run under limited
permissions, with little access to the filesystem or other database
content. Security measures such as SELinux could be used in order to
even limit what the root user can achieve, though no proven root
compromise was noted in this case. These recommendations are easy to
make though I suspect much harder for people to put into practice on
their own personal hosting setup.

Still, perhaps this example can spur us all to think about what the
consequences could be if privileged users of our systems get
themselves compromised.

The customer's VPS has since been fully reinstalled.

Cheers,
Andy

About this email:
https://tools.bitfolk.com/wiki/Security_incident_postings

--
http://bitfolk.com/ -- No-nonsense VPS hosting