The attacker somehow gained access to the phpBB admin panel. The admin panel allows the forum's templates to be customized. This feature was used to inject malicious PHP code to gain access to the server.
The attacker installed a large number of hidden web pages onto the server. Many of them advertised software for sale. They were probably intended to be used with spam to distribute malware.
Here are some of the things I have done about it:
- I completely wiped the server and reinstalled from the operating system up. Most of the files for 6502.org are stored in a Subversion repository and I used those files to rebuild the site. For files that were not in the repository, I inspected them manually before putting the online.
- I have tightened up the Apache and PHP configuration on the server. For PHP, I've set options to restrict filesystem access and running system commands.
- I've installed mod_security, a web application firewall. It will try to block known attacks and suspicious activity from reaching phpBB.
- phpBB stores its configuration in a MySQL database. I wrote a MySQL trigger that will not allow the "allow PHP code in templates" option to be enabled. If you try to enable this option in phpBB, the database will not allow it to be enabled.
- I've blocked an IP range in Russia containing the attacker's IP.
- The users with access to the admin panel now have much stronger passwords.
- I've modified the Apache configuration to only allow access to the admin panel from certain trusted IP addresses.
Regarding Chuck's question about encrypting the user data in the forum... phpBB does not store passwords in plain text. It does not offer encryption of real names or email addresses. However, it may not have helped in this case. Having them encrypted would mean that the forum would have to decrypt them on demand. An attacker with access to the server would have access to the decryption routines.
Some of the steps above could have helped prevent the attack and I'm sorry they were not already in place. Please understand that 6502.org is an old site and is a hobby project. This forum has been online in different versions for ten years.
I hope that it will now be significantly more difficult for another attack to succeed and that we can get back to discussing our projects. Thanks for your support and using the forum.