[Realese]Anti DDOS Script

11/27/2010 09:39 ExiiaL#1
Die SQL
Code:
CREATE TABLE `antiddos` (
  `ips` char(255) NOT NULL DEFAULT '',
  `load` int(2) DEFAULT '0',
  KEY `ips` (`ips`)
) TYPE=MyISAM;
PHP Code
Code:
<?php
include("include/connect.php");
$load = file_get_contents("".$url."");
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$load,$avgs);
$current=$avgs[1];
//echo $current;
if($current >20)
{
$ip = $_ENV['REMOTE_ADDR'];
mysql_query("INSERT INTO `antiddos` (`ips`,`load`) VALUES ('$ip','$current')") or sqlerr(__FILE__, __LINE__);
echo "Der Server Load ist zu hoch, wir stehen unter einer DoS attacke. ALLE IP AKTIVITÄTEN WERDEN IN DIESER ZEIT GELOGGT";
exit;
}
else{
echo "";
}
?>
nun eine connect.php erstellen und anpassen
Code:
<?php
mysql_connect("localhost","DATABASE_USER","DB_PASS");  
mysql_select_db("DB_DATABASE");
$url = "http://www.Your-URL.com/metaltorrents/server_info.php"; // Pfad zur server_info.php
?>
nun eine ddosadmin.php
Code:
<p align="center"><a href="truncate.php">Clear Database</a><br />
<em>Its HIGHLY recomended that you clear the database on a daily basis. </em></p>
<div align="center">
  <table width="622" border="1">
    <tr>
      <td width="571"><div align="center" class="style1">Anti-DDoS Elite</div></td>
    </tr>
  </table>
  <table width="622" border="1">
    <tr>
      <td width="571"><div align="center">IP Address</div></td>
      <td width="571"><div align="center">Number Times accessed</div></td>
    </tr>
<?php
include("include/connect.php");
$result = mysql_query("SELECT ips, COUNT(ips) AS NumOccurrences FROM antiddos GROUP BY ips HAVING ( COUNT(ips) > 1 ) order by NumOccurrences desc");
while($r=mysql_fetch_array($result))
{  
   $ips=$r["ips"];
   $NumOccurrences=$r["NumOccurrences"];
   echo "<tr><td>$ips</td><td>[$NumOccurrences]</td></tr>";
}
?>
  </table>
</div>
<?
stdfoot();
?>
und eine truncate.php
Code:
<?
include("include/connect.php");
mysql_query("TRUNCATE TABLE `antiddos`");
?>
<?
    die("Clean Database<br>Database Cleared!");
?>
So :D das wars , Orginalthread bzw Post:
[Only registered and activated users can see links. Click Here To Register...]
Author unbekannt war ein gast wo das gepostet hat o.Ō
11/27/2010 15:55 Adroxxx#2
Kann man auch über IPTables machen.

btw. hats nichts mit Gamehacking zu tun.

#move