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

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

作者: IT_man    時間: 2015-7-19 20:45
標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕
本帖最後由 IT_man 於 2015-7-19 20:51 編輯
* @7 l. \9 n, @/ P4 v
+ b/ O! f3 Y* U* X* G4 G1 X/ _+ f+ [7 ] 1 q$ c$ t. a0 B1 A( A+ U
9 z% W! x3 c0 c1 \" u- L$ D
4 G: r5 e7 E! Y5 G9 _% ~( }9 f
http://www.alexa.com/  蜘蛛收錄會產生如下的問題$ C! z1 g9 Y; O; s9 d- z$ Z

* }0 f+ K& s6 w! u1 \5 v/ w; O 6 Z4 U" _( H; y* ^. K8 \# g
解決方法如下:
; n+ k+ m  L) L/ Asource\class\discuz的discuz_application.php找到0 I% c  }+ [0 }" N
  1. private function _xss_check() {# L6 c" e+ P5 `4 m( N

  2. * k& R& U9 H* Y2 O9 n2 y8 \
  3.   static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');
    . b, f: h% f! s. O  f
  4. " D" f9 \+ y' R- n: ]) I4 u. E. Z
  5.   if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
    & j0 X% Z; v9 u; O4 ?
  6.     system_error('request_tainting');
    8 L7 t! P6 |8 o$ Q
  7.   }
    3 }/ [5 P8 N$ C- g9 d7 y! _$ b

  8. : |7 m: J3 v0 k9 {6 f! ]+ I- X
  9.   if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
    + \( Q# [# u0 k/ [- P8 L
  10.     $temp = $_SERVER['REQUEST_URI'];
    , _6 K, Z3 a& X# s
  11.   } elseif(empty ($_GET['formhash'])) {* z, x( j+ j* a3 U- ?0 U5 W
  12.     $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
    7 x/ R0 T2 r. K- T/ d5 W3 l
  13.   } else {7 m+ r( B& X. l2 k  A/ u; h. u% ?
  14.     $temp = '';
    $ p3 }6 `. J7 w+ Q
  15.   }
    8 @# m  S, g7 V/ o

  16. # p+ M! e9 y/ l( M6 B/ L
  17.   if(!empty($temp)) {4 P* u0 p0 Y+ @/ |8 y4 g1 W' C
  18.     $temp = strtoupper(urldecode(urldecode($temp)));% n! T  K1 H& \3 O( ^3 C! l
  19.     foreach ($check as $str) {
    9 w9 s( X( N4 C! J6 u9 ^
  20.       if(strpos($temp, $str) !== false) {- ?% W- T: }( n# k- }- ]
  21.       system_error('request_tainting');1 o2 |: p) [" g9 F5 w4 v6 z9 A. o
  22.     }& U, n) J) _+ K2 Z! w
  23.   }
    # Y! W" Q; @! \
  24.                 }
    ) [/ ^8 v6 Z$ b0 {7 a
  25. . ~$ K+ e& x% ~% s% N, \5 O4 w
  26.                 return true;
複製代碼
整段複製成:

: a8 y  ^# ?7 S, I1 R
  1. private function _xss_check() {
      H- @8 W/ {2 R2 s
  2.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
    $ B3 A/ P! M* G3 H9 I( d! c; ^
  3.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {3 z( _. i& Z3 t+ G
  4.                         system_error('request_tainting');
      U  h" I% g$ [0 ^  c$ ~8 j; _  e+ h
  5.                 }
    0 ]5 P7 i9 Y* F! R  I9 f
  6.                 return true;6 s. s( Q0 q- R. R- F
  7.         }
複製代碼
) s9 n* g/ N; Q

8 a, P+ q0 i# C5 ^$ c. R: L. V
+ v$ E+ v: Y% c' c
4 i6 w% a5 F/ _' x" O# f





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