faiz14

sqli_anti(s57)

May 3rd, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. public function __construct()
  2.     {
  3.         $dissalow_useragent = ['sqlmap','bot','curl'];
  4.         if(preg_match("/".implode("|",$dissalow_useragent)."/",$_SERVER['HTTP_USER_AGENT']))
  5.         {
  6.             exit('Error.');
  7.         }
  8.         public function filter_xss($filter)
  9.         {
  10.         $str = addslashes(stripslashes(strip_tags(htmlspecialchars($filter))));
  11.         return $str;
  12.         }
  13.         public function filter_sqli($id)
  14.         {
  15.         $tolak = ['union','select','group','concat','order by'];
  16.         $p = str_replace(implode("|",$tolak),"",$id);
  17.         $p = abs($id);
  18.         return $p;
  19.         }
  20.         function filter_ua(){
  21.         $useragent = array("sqlmap","curl","wget");
  22.         $getuseragent = $_SERVER['HTTP_USER_AGENT'];
  23.         if(preg_match("/".implode("|",$useragent)."/",$getuseragent)){
  24.         header('HTTP/1.0 404 Not Found');
  25.         exit;
  26.         }
  27.     }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment