Leek Site Admin Joined: 13 Aug 2006 Posts: 5
|
Posted: Sun Aug 13, 2006 3:35 pm Post subject: Thiết láºp firewall bằng PHP |
|
|
1 firewall đơn giản nhằm ngăn chặn ddos = xflash ngoà i cách dùng .htaccess rưá»m rà + vướng vÃu . Trước tiên bạn phải include trong file index.php cá»§a site bạn đến filewall . Nếu dùng IBF thì add nó ngay dưới .
CODE
//===========================================================================
// MAIN PROGRAM
//===========================================================================
$INFO = array();
CODEinclude "firewall.php";
Sau đó tạo 1 file .php có tên là firewall.php như sau
CODE
<?php
//echo "<pre>";
//print_r($_SERVER);
if (!isset($_SERVER['HTTP_REFERER']))
{
// print error message and
die( "
<html>
<head>
<title>Anti-DoS</title>
</head>
<body style='background-color:black;color:white'>
<center><br/><br/><br/><br/><br/>
Click here :<br/>
<a style='color:yellow' href='{$_SERVER['REQUEST_URI']}'>http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}</a><br>
<font color='ffffff'><b>W e l c o m e t o</b></font><br>
<font color='white'><b> . : : Yahoo-69 : : .</b></font><br>
</center><br>
</body>
</html>
");
}
?>
Chúc thà nh công |
|