Die SQL
PHP Code
Alles anzeigen
nun eine connect.php erstellen und anpassen
nun eine ddosadmin.php
Alles anzeigen
und eine truncate.php
So :D das wars , Orginalthread bzw Post:
Kleines Anti DDoS Skript - Das Hilfe, HTML und Webmaster Forum
Author unbekannt war ein gast wo das gepostet hat o.Ô
PHP Code
PHP-Quellcode
- <?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
nun eine ddosadmin.php
PHP-Quellcode
- <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
So :D das wars , Orginalthread bzw Post:
Kleines Anti DDoS Skript - Das Hilfe, HTML und Webmaster Forum
Author unbekannt war ein gast wo das gepostet hat o.Ô