52AV手機A片王|52AV.ONE

標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕 [打印本頁]

作者: IT_man    時間: 2015-7-19 20:45
標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕
本帖最後由 IT_man 於 2015-7-19 20:51 編輯
2 O3 `4 w: ]" z+ S4 T
3 v3 }+ [! A; q7 s" o! Z/ C 0 @! J- h. G3 ^, R) K9 k

" e9 L  e& K, S! Z" T2 k+ L8 j
# I% _# {) Q( S! t/ ahttp://www.alexa.com/  蜘蛛收錄會產生如下的問題; Y, T8 b% A5 ~
0 m4 X1 S1 q, [7 L
: C" I5 X+ d  ?8 f
解決方法如下:
+ X4 W3 v2 X+ ?3 q8 O; d, ^source\class\discuz的discuz_application.php找到
% A( e+ U( r, i- x! t
  1. private function _xss_check() {8 e- p- f  A* H9 r5 s3 K
  2. 1 Q( t) J5 j9 q; |; V
  3.   static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');# ?- k+ G  b$ x- k, e1 j
  4. - v/ ~+ s6 ]: Q7 n  L; A0 l+ A
  5.   if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {' o8 W  u! I' f
  6.     system_error('request_tainting');7 Z5 v% G, F, }9 A# z# ~
  7.   }
    : t! a0 D' A& N) C
  8. 1 _9 p: n3 p2 C
  9.   if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
    7 E  k; v1 q9 l9 s5 ?
  10.     $temp = $_SERVER['REQUEST_URI'];4 Z3 N  G/ O! {" \
  11.   } elseif(empty ($_GET['formhash'])) {
    0 X8 y% M4 X0 t, F+ N- m' q
  12.     $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');& S  {/ ~$ g( p1 {4 h1 b# {; r* F
  13.   } else {
    # \1 M) {  F# H4 o
  14.     $temp = '';9 Q. F  K  ?' D; J" W# T  `, o
  15.   }/ Y5 d. R5 U& Y8 B$ u' ^

  16. ! k4 H2 K( s! w! d: \
  17.   if(!empty($temp)) {% e3 e5 }6 L8 Y$ z; M' _! R9 ?2 A
  18.     $temp = strtoupper(urldecode(urldecode($temp)));! b7 m5 U8 E5 H
  19.     foreach ($check as $str) {
    4 o" f0 \5 m4 V+ w$ d
  20.       if(strpos($temp, $str) !== false) {
    + n  Y) o; l8 v- Q6 O  A7 f. u
  21.       system_error('request_tainting');* t& }* T/ m5 B% [. m
  22.     }( r4 d  u$ ^, l! {0 D* L
  23.   }
    1 h7 d  B! Q6 z9 c! k! l( p9 a
  24.                 }
    5 J7 ~8 {0 ^! J! j/ ~+ z
  25. & N! S1 q, z2 c7 {* g; w/ ?
  26.                 return true;
複製代碼
整段複製成:

3 j3 d: j- t5 x1 A, \7 R
  1. private function _xss_check() {
    ; D! c  i5 b' ?5 q
  2.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
    + R  L0 v5 d& T/ T. b7 a5 d
  3.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {  v' m7 Z( J* F& y6 y
  4.                         system_error('request_tainting');
    + y' N# Z7 M) ~# \  K
  5.                 }- n+ Z6 e) ]% S  U0 I1 G& {
  6.                 return true;- _- h3 [' n3 \' {% |4 Y0 f  `8 F
  7.         }
複製代碼
+ ?% ?4 ]* ^; l: ^% z- e
/ l+ K: h  {8 p  o

& C1 w, B3 e4 J" I( M* t6 m

' J) U% k4 L' k% w. m$ w. }% Z




歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/) Powered by Discuz! X3.2