Support

Admin Tools

#9832 Index.php hack on all sites

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 12 April 2011 15:32 CDT

user1965
I just installed ATP on my main site and I'm checking my other sites and finding the same thing. that my index.php on the frontend and Admin end was hacked on 4/10 and they had this in the top line



I don't know much about hacks but if my PHP is set to 644. how can this get written to it?

I know ATP can't prevent everything, but is there anything I can do to it to help at least avoid this type of hack?

Anything I can tell my hosting company that they need to turn on..because when it comes to joomla they don't seem to know alot.

I also notice some of my permissions was changed to 666 (not a good #) right now I have folders set to 755 and files set to 644.

nicholas
Akeeba Staff
Manager
Hi,

When your site gets hacked you should follow some necessary steps to restore it to working order, identify the attack vector and resolve the vulnerability so that you don't get hacked easily over again:
  • Immediately use ATP's Emergency Off-Line Mode to make sure that the hacker can't get back into your site
  • Change your database password and your hosting account password. You should consider them compromised even though we don't know if they are really compromised (better be safe than sorry).
  • Check your access logs +/- 15 minutes from the last modified time of your hacked index.php file. This should tell you how the hacker got in. If you see an exploit targeting a specific component please be advised that the version of that component is vulnerable.
  • Wipe out all of the files in your site. It is very likely that the hacker has left a "back door" script which makes it easy for him to come back and hack your site again.
  • Restore the site from a backup. While restoring use a different password for your Super Administrator user. Make sure you use Kickstart's FTP mode while restoring! This will ensure that the ownership of the file matches your hosting account (they are not owned by the system-wide PHP) which adds an extra -yet thin- layer of security to your site.
  • Take the restored site off-line using the Emergency Off-Line mode.
  • Make sure you're using the latest Joomla! release (1.5.23 at the time of this writing). Using an outdated Joomla! release is a security mortal sin. Hackers are very keen on exploiting known vulnerabilities in old Joomla! releases.
  • Check all of your extensions and make sure that they are not in the Vulnerable Extensions List. If they are and they are marked in green, upgrade them to their latest release. If they are marked in red immediately uninstall them.
  • Enable all of the options in Admin Tools' WAF Configuration.
  • Use the .htaccess Maker to produce a security enhanced .htaccess file which will block access to rogue PHP files, commonly used by hackers to gain access to your site.
  • Make sure the permissions of your files and directories are sane (0755 for directories, 0644 for files). Do note that permissions all by themselves do not mean anything for security; it's a combination of ownership and permissions that does the trick. That's why I told you to use Kickstart's FTP mode. Of course, this means that you will have to enable the FTP mode in your site to allow it to function properly.


As you will notice, most items on this list can be applied to site before being hacked. In fact, that's the "secret sauce" to security: enable all protection measures and keep all your extensions (component, modules, plugins and templates) up-to-date.

IMPORTANT: See how I stressed templates above? Most people don't realize it, but modern templates -especially those based on a template framework- are PHP applications on their own right. Many templates have known security vulnerabilities and their authors have provided updates to address them. Make sure you do install such updates. While templates will never appear on the Vulnerable Extensions List it doesn't mean they are secure. Consult your template developer for upgrade information.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!