• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Code tự động lock ip khi bị ddos attack

Admin

Well-Known Member
Staff member
Administrator
PHP:
<?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'>
[b]
<h1>Temporary  Access Denial</h1>Too many quick page views by your IP address  (more than ".$ipmaxvisit." visits within ".$iptime." seconds).[/b]
";
echo  "
Please wait ".$ippenalty." seconds and reload. Warning by  KentMaster</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."\n");
fclose($fp);
$yourdomain = $_SERVER['HTTP_HOST'];
 
if($_SESSION['reportedflood'] < 1 && ($newtime < $time + $iptime + $iptime*$ipmaxvisit))
@mail('satthuvietnam@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."\n");
$_SESSION['reportedflood'] = 1;
}
exit();
}
else $_SESSION['reportedflood'] = 0;
//echo("loaded ".$cookie.$iplogdir.$iplogfile.$ipfile.$newtim e);
touch($iplogdir.$ipfile, $newtime); 
?>
1.gif
Hướng dẫn sử dụng trước khi dùng
+ Đổi địa chi 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
PHP Code:
Mã:
PHP:
include 'Anti_DDOS.php';
+ 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
 
ca sang gio bi ddos ah.lang vai
 
Sao bật fire wall vậy admin, dùng vina đã lag rồi chứ.
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin Share code leech ảnh girl xinh tự động Mã nguồn wap 0
Npnken Share Share code shop nick tự động - shopbumma.com PHP 3
tubotocdo Share code tự động refresh trang Javascript/ajax 1
Admin Share code tự động get thumbnails youtube cho xenforo Xenforo 1
Admin Share code tự động like facebook - facebook onclick auto like script Mã nguồn web 0
Admin Share code tự động tạo backlinks Mã nguồn web 0
Admin Share code scam team tự động đổi pass style đẹp Mã nguồn wap 6
Admin Share code html nghe gì hôm nay, nhạc ngẫu nhiên, tự động cập nhật HTML & CSS 0
Admin Share code wap theme tự động lấy ảnh minh họa Mã nguồn wap 0
Myshare Share Code chống spam VBB - tự động reg nick cực kỳ hiệu quả Vbb tutorial 0
Admin Share code chống spam vbb - tự động reg nick cực kỳ hiệu quả Vbulletin 0
S Code tự động lock ip khi bị ddos Bảo mật 1
boy94 Share Full code tự động get title Blog Xtgem All Shared Scripts 4
Admin Share Code Phim Tự Động cập Nhật Mã nguồn web 3
Admin Share full code tự động get title blog xtgem Wap builder, wapego, xtgem, wen.ru, wapka, wap4 2
Admin Share code up ảnh tự động đóng dấu ola***.duatop.net Mã nguồn wap 0
Admin Share code nạp thẻ tự động vtc Mã nguồn web 7
Admin Code tự động lock ip khi bị ddos Hacking 3
Admin [Share] code tự động liên kết wap Mã nguồn wap 7
Admin Code news Bantinnhanh.Vn tự động cập nhật Mã nguồn web 0
KhangSkull Share Code ChoCuaToi.Com (Hàng NÓNG VIP VIP) - Tương tự ChoDienTu.VN Mã nguồn web 21
Admin Share code fix ký tự mobile cho wap Mã nguồn wap 1
Admin Share code lấy kí 160 kí tự làm mô tả johncms Johncms 0
Admin Share code quảng cáo 2 bên forum tự biến mất khi màn hình nhỏ HTML & CSS 0
T Hướng dẫn Cách fix lỗi tự thêm \ trong mtblog , code wap game Blogger 0
Admin Share code autochat - chat với boot - chat vui tự sướng cho vbb Add-ons 0
Admin Share code tạo chữ ký tự độc đáo Wap builder, wapego, xtgem, wen.ru, wapka, wap4 1
Admin Share code tương tự kilobook sinhviennet.net Mã nguồn web 0
Admin [WAPKA] Code tự nhận dạng url và đi đến trang báo chuyển hướng Wap builder, wapego, xtgem, wen.ru, wapka, wap4 2
Admin Share code tự nhận dạng trình duyệt Mã nguồn wap 2
Admin [Share] code javascript popup tự ẩn sau trình duyệt chính Javascript/ajax 3
rockymen9999 Share GIFTCARD CODE GENERATOR BY AMBOSS NETFLIX, AMAZON, PSN, SPOTIFY & MORE Tut, tool, mmo 0
F Quét QR Code – 1 Chạm 1 Lượt Tải Tốc Độ Cao Tin tức CNTT 0
rockymen9999 Share GIFTCARD CODE GENERATOR BY AMBOSS NETFLIX, AMAZON, PSN, SPOTIFY & MORE Tut, tool, mmo 0
J E cần tối ưu code check cc,web check ạ PHP 0
cuongpro9x Share FREE Windscribe VPN 30GB Voucher Code Tut, tool, mmo 0
H Xin code twig lô đề All Shared Scripts 0
katy Android MobiFone tặng e-code 100k cho Hội viên KNDL để mua sắm trên Tiki.vn Điện thoại di động 10
katy Android Hãy cùng MobiFone thăng hạng tiếng Anh cùng e-code giảm giá tại Apax English Điện thoại di động 10
katy Android MobiFone tặng mã e-code tại APAX ENGLISH trị giá 500k cho Hội viên KNDL Thông tin các mạng di động 0
Admin [CSCN] Roman Numeral Chord BB Code Support Xenforo 0
Admin Editor & BB Code Manager Xenforo 0
Admin Share code phpBB 3.3.3 tiếng việt mới nhất Phpbb3x 2
D Giúp đỡ về code javascrip trên Ladipage Hỗ trợ sử dụng diễn đàn 1
cuongpro9x Share Code vòng quay lì xì may mắn All Shared Scripts 1
Admin Xenforo 2 - Random Ads Code Xenforo 0
Admin Yilmaz - Hide [code,php,html] content from guests (vb5.6.x) Add-ons 0
Vtkun Xin giải mã code php Thảo luận chung 0
Admin Share code dịch vụ mạng xã hội bao gồm Facebook, Youtube, Tiktok, Instagram Mã nguồn wap 30
Admin Share 15GB source code Android bao gồm Unity Android, iOS 5

Similar threads

New posts New threads New resources

Back
Top