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

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

作者: IT_man    時間: 2015-7-19 20:45
標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕
本帖最後由 IT_man 於 2015-7-19 20:51 編輯
& }5 ^6 M4 A2 _8 s( n# V' {9 C4 K/ b
5 O; e$ J: V0 F" z# n/ E# y+ O
# P6 [7 Y( @3 I  Z9 d+ b0 L: O

4 u! [# t! w# X+ \9 q" Chttp://www.alexa.com/  蜘蛛收錄會產生如下的問題; f& p) K# s: T! Q, C' }

' w9 Y" t) c, r+ t* A, t
7 a6 l6 D, T" R, c, B) X4 U3 I解決方法如下:
! h( L) Q/ n6 @source\class\discuz的discuz_application.php找到
, i! \$ Z3 Z; i  s8 M% t: D
  1. private function _xss_check() {; K1 {) N4 k% i8 q/ R6 T! ?

  2. 8 j% [) K" r4 k
  3.   static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');
    4 h, ]' M* p2 C- Z* f( c
  4. % D% c7 H0 l- L8 j& `# o( b9 s
  5.   if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
      h! M5 R, L' Y7 N; A
  6.     system_error('request_tainting');3 \8 t# t+ L4 [9 N' i7 O
  7.   }
    % v" b, {5 T6 p8 ?, ^
  8. % P- u4 {' \, i3 d# _
  9.   if($_SERVER['REQUEST_METHOD'] == 'GET' ) {4 u7 s; s& [! Z- F4 J
  10.     $temp = $_SERVER['REQUEST_URI'];7 I# t: r% W$ Z# g* L
  11.   } elseif(empty ($_GET['formhash'])) {
    - u+ j; t# Q, d5 ?* B
  12.     $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');  D; f% X7 L7 u" ?. g# S& h4 ^4 {
  13.   } else {
    + f" R; p# g& ]0 \/ D
  14.     $temp = '';. l2 p$ e7 v8 F& g% Z
  15.   }
    ' X9 W) N5 _. t! o: j; d

  16. . K9 e6 T! v" g) A8 g1 y9 I) J
  17.   if(!empty($temp)) {- H# |1 T" y( i- N- Q9 ?, n8 h
  18.     $temp = strtoupper(urldecode(urldecode($temp)));, g  H! O0 s9 B7 l
  19.     foreach ($check as $str) {3 ?' B, ]. x1 n( h! _( Z
  20.       if(strpos($temp, $str) !== false) {0 ~7 V) d) F6 ?3 t7 ?
  21.       system_error('request_tainting');2 B* m* K* v+ P
  22.     }# i! R# W6 U0 |* V$ R/ J( N
  23.   }7 A: E# a) G# Z3 X& u% n
  24.                 }9 Q0 c; Q7 F2 x. G6 V

  25. ) X/ M: j- J4 U* M
  26.                 return true;
複製代碼
整段複製成:
4 n' y# f% h' w% j* S( d* u
  1. private function _xss_check() {4 l* c5 O1 C3 R1 e
  2.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));0 d- }$ e9 e0 E1 W/ I/ w. J+ t
  3.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {1 J* s6 i$ @4 r3 P6 d/ D
  4.                         system_error('request_tainting');! m  }9 V+ V, L
  5.                 }' c$ t9 b8 M1 x, i0 _
  6.                 return true;
    - z7 W  P( d5 o/ h
  7.         }
複製代碼

9 o' X. h* K9 U1 {1 D4 J* P( s
' N2 U2 f+ a. Y& e; x' @- _5 i+ }1 `" L% K
; \' A& g) J9 H1 \. O! n$ ?





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