Website Security – How Could My Website Be Hacked

hackingSecurity

I wonder how this could happen. Someone deleted my index.php files from all my domains and puts his own index.php files with the next message:

Hacked by Z4i0n – Fatal Error – 2009
[Fatal Error Group Br]
Site desfigurado por Z4i0n
Somos: Elemento_pcx – s4r4d0 – Z4i0n – Belive
Gr33tz: W4n73d – M4v3rick – Observing – MLK – l3nd4 – Soul_Fly
2009

My domain has many subdomains, but only the subdomains that can be accessed with an specific user were hacked, the rest weren't affected.

I assumed that someone entered through SSH, because some of these subdomains are empty and Google doesn't know about them. But I checked the access log using the last command, but this didn't show any activity through SSH or FTP the day of the attack, neither seven days before.

I already changed my passwords. What do you recommend me to do?

UPDATE

My website is hosted at Dreamhost. I suppose they have the latest patches installed. But, while I was looking how they entered to my server, I found weird things. In one of my subdomains, there were many scripts for execute commands on the server, upload files, send mass emails and display compromising information. These files had been created since last December!!

I have deleted those files and I'm looking for more malicious files.

Maybe the security hold is an old and forgotten PHP application. This application has a file upload form protected by a password system based on sessions. One of the malicious scripts was in the uploads directory. This doesn't seem like an SQL injection attack.

Best Answer

Restore from known-good backups. Otherwise, you may have to wipe and reinstall. A good rule of thumb is to NEVER trust a system once it's been compromised. There's too much chance that binaries have been replaced to hide a payload or backdoor.

As for the how, it may have been an SQL injection attack. Or some other way in. You were running everything with the latest patches?

This link is from a cache of an apparent hack into twit.tv (I think it's This Week In Tech). If you google the phrase you'll get a bunch of hits. Any time there's a scripted mass attack out there you're going to find chatter on different forums discussing it.

Again...DON'T TRUST THE SYSTEM. You probably should wipe and reinstall then restore database information from a previous backup...that's the safest route.

Related Topic