1. function inject_check($sql_str){
  2. $check = eregi('select|insert|update|delete|\*|\/\*|\'|\.\.\/|\.\/|UNION|into|load_file|outfile',$sql_str);
  3. if($check){
  4. page_href("http://".$_SERVER['HTTP_HOST']."/home/sitemap.php");
  5. exit();
  6. }else{
  7. return $sql_str;
  8. }
  9. }
  10. //防跨站攻击
  11. function inject_check2($sql_str){
  12. $check =
  13. eregi('javascript|vbscript|expression|applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|
  14. frameset|ilayer|layer
  15. |bgsound|title|base|onabort|onact
  16. ivate|onafterprint|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus
  17. |onbeforepaste|onbeforeprint|onbeforeunload|onb
  18. eforeupdate|onblur|onbounce|oncellchange|onchange|onclick|oncontextmenu|oncontrolselect|oncopy|oncut|
  19. ondataavailable
  20. |ondatasetchanged|ondatasetcomplete|ondblc
  21. lick|ondeactivate|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|
  22. ondrop|onerror|onerrorupdate
  23. |onfilterchange|onfinish|onfocus|onfocusin|onfoc
  24. usout|onhelp|onkeydown|onkeypress|onkeyup|onlayoutcomplete|onload|onlosecapture
  25. |onmousedown|onmouseenter|
  26. onmouseleave|onmousemove|onmouseout|onmouseover|onmou
  27. seup|onmousewheel|onmove|onmoveend|onmovestart|onpaste|onpropertychange|onreadystatechange|onreset|
  28. onresize|onresizeend|onresizestart|onrowenter|onrowexit|onr
  29. owsdelete|onrowsinserted|onscroll|onselect|onselectionchange|onselectstart|onstart|onstop|
  30. onsubmit|onunload',$sql_str);
  31. if($check){
  32. page_href("http://".$_SERVER['HTTP_HOST']."/home/sitemap.php");
  33. exit();
  34. }else{
  35. //return $sql_str;
  36. }
  37. } //by bbs.it-home.org
  38. ?>
复制代码


09-19 06:15