Old school Swatch Watches
Xin Chào: claudebot

Share code php anti ddos firewall - Truy cập trang firewall

14/10/2015 - 17:10

Code đây ae. Hứa tối qua share mà h sang ngày mới rồi mới rảnh share ae.
Code có chỗ nào sửa mình đã // trong code rồi nhé ae vào sửa.
Theo mình thấy thì nên dùng cái cloudflare nữa. Kiểu dùng 2 dns đó. Chạy ghép vào nhau => Tốt hơn.
Code dưới thì save thành file anti_ddos.php nhé. Rồi gắn vào head hoặc index hay đâu đó tuỳ code.
Hoặc gắn trực tiếp thì tuỳ. Cái này không cần hướng dẫn
Và code đây:
<?php
// Lê Quốc Việt Anh - adminvn - lqvanh - lqvanhth
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Xác nhận truy cập - Firewall</title>
</head>
<?php
//------ Phần cần phải chỉnh sửa nhé ---------------
$level = 1;
//Mức độ bảo mật: 1 là bình thường. 2 là cao nhé.
//Nếu bạn chọn 2 thì điền tên miền vào đây nhé
$yoursite = "domain.com"; //Nhập domain là domain.com nhé. Đừng nhập: http://domain.com hay http://domain.com/ hay domain.com/
$scheme = 1;
//Điền 1 hoặc 2. 1 là Chọn cách 1......-...... 2 là chọn cách thứ 2.
//Nếu chọn cách 1 thì edit:
$antidos = 1;
//Nhập 1 để on, 2 để off anti ddos
//Nếu bạn chọn 2 thì edit phần:
$determiner = "http://pro356.esy.es/dieu-khien-1.txt";
//Link tới file on với nội dung là số "1" .
//Để off thì nhập http://pro356.esy.es/dieu-khien.txt Lưu ý: Đây là link mk tạo demo nhé. Các bạn tạo 1 file này nhé rồi sửa qua đó.
//Có thể chỉnh sửa phần sau: tuỳ bạn. Mai mình gửi bản mod như SVIT nhé. SVIT thì phần dưới views code nó ra rồi paste ra đây thôi :D
$redirect = "<br><br></p><br>
</p>
<br><br><center><b>Xin vui lòng<br><br><p><a href='".$_SERVER['REQUEST_URI']."'[ Click vào đây ]</a><br>
<br><p>để chuyển đến nội dung cần xem...!</b>
<br>
<br><br></p><br> </p>
</center>";
// -------------- Hết nhiệm vụ. up code và không chỉnh sửa nhé ;) File này lưu là anti_ddos.php và include vào các file khác nhé !!! ------------
// -----------------------------Nếu có head thì include vào hay hơn. File nào cx có luôn đỡ thủ công --------------------------------------------
function url_exists($url) { $a_url = parse_url($url);
if (!isset($a_url['port'])) $a_url['port'] = 80;
$errno = 0;
$errstr = '';
$timeout = 30;
if(isset($a_url['host']) && $a_url['host']!=gethostbyname($a_url['host'])){
$fid = fsockopen($a_url['host'], $a_url['port'], $errno, $errstr, $timeout);
if (!$fid) return false;
$page = isset($a_url['path']) ?$a_url['path']:'';
$page .= isset($a_url['query'])?'?'.$a_url['query']:'';
fputs($fid, 'HEAD '.$page.' HTTP/1.0'."\r ".'Host: '.$a_url['host']."\r \r ");
$head = fread($fid, 4096);
fclose($fid);
return preg_match('#^HTTP/.*\s+[200|302]+\s#i', $head);
} else {
return false;
}
}

function on_off($file) {
$string = file_get_contents($file);
$fetch = strstr($string,"1");
if ($fetch) {
return true;
} else {
return false;
}
}

function level_1() {
global $antidos, $redirect;
if($antidos){
if(!$_SERVER['HTTP_REFERER']) {
echo $redirect; exit;
}
}
}

function level_2() {
global $antidos, $redirect, $yoursite;
if($antidos){
if(strpos($_SERVER['HTTP_REFERER'], 'http://www.'.$yoursite) !== 0) {
if(strpos($_SERVER['HTTP_REFERER'], 'http://'.$yoursite) !== 0) {
echo $redirect; exit;
}
}
}
}
if($scheme == 1) {
if($level == 1) level_1();
elseif($level == 2) level_2();
else {
echo "Ban phai chon \$level = 1 hoac \$level = 2";
exit;
}
}
elseif($scheme == 2) {
if (!url_exists($determiner)) $antidos = 1;
else {
$antidos = on_off($determiner);
}
if($level == 1) level_1();
elseif($level == 2) level_2();
else {
echo "Ban phai chon \$level = 1 hoac \$level = 2";
exit;
}
} else {
echo "Ban phai chon \$scheme = 1 hoac \$scheme = 2";
exit;
}
?>
?>

Copy Code
Sao chép/Sửa:


HOMEWapMasterShare Code PHP
Bài Viết Cùng Chuyên Mục
Xem Thêm
Từ Khoá Bài Viết

Share code php anti ddos firewall - Truy cập trang firewall hay nhất

,

Share code php anti ddos firewall - Truy cập trang firewall Độc Quyền

,

Xem Thêm Share code php anti ddos firewall - Truy cập trang firewall

Liên Hệ - Hỗ Trợ
roisekhocapp@gmail.com
SMS: 0966.715.749
Bản Quyền WapMaster Trên Xtgem
Coder By: Nhoc96
Thank To: Xtgem.com
Chuyển Qua SmartPhone
doc truyen teen
C-STAT