PDA

View Full Version : Anti xss và sql inj.



linhbatinh
12-09-2009, 02:50 PM
Điều kiện: RewriteEngine On

Nội dung file .htaccess


Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\"|%22).*(\>|%3E|<|%3C).* [NC]
RewriteRule ^(.*)$ report.php [NC]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC]
RewriteRule ^(.*)$ report.php [NC]
RewriteCond %{QUERY_STRING} (javascript:).*(\;).* [NC]
RewriteRule ^(.*)$ report.php [NC]
RewriteCond %{QUERY_STRING} (\;|\'|\"|\%22).*(union|select|insert|drop|update|md5|bench mark|or|and|if).* [NC]
RewriteRule ^(.*)$ report.php [NC]
RewriteRule (,|;|<|>|'|`) /report.php [NC]Nội dung file report.php


$r= $_SERVER['REQUEST_URI'];
$q= $_SERVER['QUERY_STRING'];
$i= $_SERVER['REMOTE_ADDR'];
$u= $_SERVER['HTTP_USER_AGENT'];
$mess = $r . ' | ' . $q . ' | ' . $i . ' | ' .$u;
mail("your_email@site.com","bad request",$mess,"from:bot@site.com");
echo "Warning !";
?>Việc cuối cùng đặt 2 file .htaccess và report.php ngang hàng nhau. Goodluck !
Nguồn VHCTEAM

hau_ooo
12-09-2009, 02:57 PM
Cái nội dung file .htaccess bị lỗi hiển thị thành smiles nên em up file txt lên :MatCuoi (38):
Kèm theo sửa thành mã PHP

DaiThanh
12-09-2009, 10:20 PM
Thay vì sử dụng QUOTE thì sử dụng CODE!

hackerkinhcan_lha
14-09-2009, 12:00 PM
RewriteCond %{QUERY_STRING} (\;|\'|\"|\%22).*(union|select|insert|drop|update|md5|bench mark|or|and|if).* [NC]
RewriteRule ^(.*)$ report.php [NC]


Nhỡ em dùng uNIOn hay SelEcT để truy vấn thì sao nhỉ có bypass đc hem

linhbatinh
14-09-2009, 08:33 PM
RewriteCond %{QUERY_STRING} (\;|\'|\"|\%22).*(union|select|insert|drop|update|md5|bench mark|or|and|if).* [NC]
RewriteRule ^(.*)$ report.php [NC]


Nhỡ em dùng uNIOn hay SelEcT để truy vấn thì sao nhỉ có bypass đc hem
chú cứ thử xem :D