Duck hunt
Đăng: 2015-09-29 04:58
AdminPichu    [Admin]
<?php
$cookie 
$_COOKIE['yourcookie'];
$othercookie $_COOKIE['yourothercookie'];
$othercookie $_COOKIE['1211598493'];
$othercookie $_COOKIE['2c07863737b385b4c3567f0ecfa6d480'];
$othercookie $_COOKIE['3bc52aba5f6ed8a19cfafdc777ad1b1f'];
if(
$cookie && $othercookie 0$iptime 20//so giay toi thieu giua cac lan truy cap.
else $iptime 10// so giay toi thieu cho moi lan truy cap cho tat ca moi nguoi
$ippenalty 60// So giay truoc khi nguoi truy cap dc phep truy cap lai
if($cookie && $othercookie 0)$ipmaxvisit 30//toi da truy cap tho $iptime
else $ipmaxvisit 20// toi da cho moi lan truy cap $iptime 
$iplogdir "./iplog/";
$iplogfile "iplog.dat";
$oldtime 0;
if (
file_exists($iplogdir.$ipfile)) $oldtime filemtime($iplogdir.$ipfile);
$time time();
if (
$oldtime $time$oldtime $time;
$newtime $oldtime $iptime;
if (
$newtime >= $time $iptime*$ipmaxvisit)
{
touch($iplogdir.$ipfile$time $iptime*($ipmaxvisit-1) + $ippenalty);
$oldref $_SERVER['HTTP_REFERER'];
header("HTTP/1.0 503 Service Temporarily Unavailable");
header("Content-Type: text/html");
echo 
"<html><body bgcolor=#999999 text=#ffffff link=#ffff00>
<font face='Verdana, Arial'>
<h1>Temporary Access Denial</h1>Too many quick page views by your IP address (more than "
.$ipmaxvisit." visits within ".$iptime." seconds).
"
;
echo 
"
Please wait "
.$ippenalty." seconds and reload. Warning by Pichu</p></font></body></html>";
touch($iplogdir.$iplogfile); //create if not existing
$fp fopen($iplogdir.$iplogfile"a");
$yourdomain $_SERVER['HTTP_HOST'];
if (
$fp)
{
$useragent "<unknown user agent>";
if (isset(
$_SERVER["HTTP_USER_AGENT"])) $useragent $_SERVER["HTTP_USER_AGENT"];
fputs($fp$_SERVER["REMOTE_ADDR"]." ".date("d/m/Y H:i:s")." ".$useragent."
"
);
fclose($fp);
$yourdomain $_SERVER['HTTP_HOST'];
if(
$_SESSION['reportedflood'] < && ($newtime $time $iptime $iptime*$ipmaxvisit))
@
mail('xxlililxx95@gmail.com''Website is being flooded-DDOS from address '.$cookie.' '
.$_SERVER['REMOTE_ADDR'],''.$yourdomain.' are attacked refuse services from IP addresses '.$_SERVER['REMOTE_ADDR'].' attack to '.$yourdomain.$_SERVER['REQUEST_URI'].' Attaker is '.$oldref.' agent '.$_SERVER['HTTP_USER_AGENT'].' '
.$cookie.' '.$othercookie"From: ".$yourdomain."
"
);
$_SESSION['reportedflood'] = 1;
}
exit();
}
else 
$_SESSION['reportedflood'] = 0;
//echo("loaded ".$cookie.$iplogdir.$iplogfile.$ipfile.$newtim e);
touch($iplogdir.$ipfile$newtime); 
?>

Copy code

Hưỡng dẫn sử dụng trước khi dùng
+ Đổi địa chỉ mail thành của bạn
+ Save lại thành Anti_DDOS.php đặt vào thư
mục gốc của forum (hoặc portal hay muzic,
blog site ...).
+ Mở file cần bảo vệ ra
dưới thẻ <?php
PHP Code:
<?php
include ('Anti_DDOS.php'); 
?>

Copy code

+ Sau đó tạo 1 thư mục có tên là /iplog/ và CHMOD là 777, bạn tạo tiếp 1 files iplogfile.dat trong thư mục iplog và CHMOD là 666
Đã chỉnh sửa bởi pichu
Like: 0
Hãy Đăng nhập để bình luận và viết bài nhé
Tổng số bình luận 1
Chia sẻ bài viết đến bạn bè
Chia sẻ:SMS Google Zing Facebook Twitter
Link:
BBcode:
Từ khoá: Code anti ddos tham khảo, xem Code anti ddos tham khảo hay nhất , tải Code anti ddos tham khảo miễn phí , đọc Code anti ddos tham khảo hay nhất , chơi Code anti ddos tham khảo cực hay
Trực tuyến:
khách: 1
23 Chat - 65 member - 1225630 Views
-
Trang chủ
Google Robots Sitemap
Country : pokemon chim
IP : 3.133.123.193
Host : ec2-3-133-123-193.us-east-2.compute.amazonaws.com
Bây giờ là : 08:02:31 29/04/2024
Thanks to Xtgem.com Load xtscript: 0.000001s.
Timeload : 0.0004/s Timeout : 0.6%