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

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

作者: IT_man    時間: 2015-7-19 20:45
標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕
本帖最後由 IT_man 於 2015-7-19 20:51 編輯 3 B) D: H5 ?2 ~  E  i

+ G  i/ ?2 [* |* S & X% w# o0 T4 i- p5 k# o% b1 `
: Z0 b% j/ d  a. v) }4 @
% G& h0 U: u6 p5 Q
http://www.alexa.com/  蜘蛛收錄會產生如下的問題
2 _- R, y. ]& w% h+ f# E# Y! v/ ~  P, l$ U; a" Z

6 N8 X4 J- j0 g5 z5 ~解決方法如下:; P( n+ z- ~1 r/ t
source\class\discuz的discuz_application.php找到
( I# ?* _, L. \- E2 R5 O
  1. private function _xss_check() {0 l$ a- n/ j+ ]5 R. z
  2. " t- q/ f/ f4 u$ H6 a' r
  3.   static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');
    7 J, [* I1 I4 \; N1 Y

  4. ! s1 r  {' G6 Y
  5.   if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
    ) X" ]1 l$ X+ x6 K
  6.     system_error('request_tainting');+ Q$ T9 ]: P( u( ~  _
  7.   }4 W8 F/ Q' {  ]6 J; N
  8. 0 @; G/ f/ f" T7 l# ^* ?. D
  9.   if($_SERVER['REQUEST_METHOD'] == 'GET' ) {* i' R) D  {6 i
  10.     $temp = $_SERVER['REQUEST_URI'];2 J+ d: m. e" o0 T, K  _
  11.   } elseif(empty ($_GET['formhash'])) {% \. ?9 D( _3 Z* T- B1 Z  U0 ]
  12.     $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
    ) s5 |( z5 ^. h1 M; |) E7 Y  X
  13.   } else {7 z8 u* Q% A* D; M& L8 t2 T. J
  14.     $temp = '';0 [/ h; d6 G3 U9 v7 D8 C+ K9 [
  15.   }3 J6 M# f3 j/ `8 n8 n
  16. & Q! h+ O! M9 z8 E3 @5 F
  17.   if(!empty($temp)) {& R, p1 g6 m, H6 U/ g1 r
  18.     $temp = strtoupper(urldecode(urldecode($temp)));
    - z2 U5 V7 G# E& w$ r# |4 ?
  19.     foreach ($check as $str) {
    / {3 V$ k! M' h. d9 ~
  20.       if(strpos($temp, $str) !== false) {
    1 T+ `, y  R  j0 E& X5 j
  21.       system_error('request_tainting');- h- h1 z+ c) x$ }' I
  22.     }3 Z! V6 c9 F7 |* c$ J
  23.   }4 J( |7 a+ k, c
  24.                 }- z0 ?2 U! k/ L- c( c1 {- m- `' i8 n
  25. - G$ j6 k( k1 w
  26.                 return true;
複製代碼
整段複製成:
/ b6 W2 s/ z. s( w/ G: q' A! _
  1. private function _xss_check() {! N5 p9 W: o: l0 x% x) j0 U2 \
  2.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
    8 c/ t! r6 X) i8 _' e3 ]
  3.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
    % K7 P5 p0 N& ~
  4.                         system_error('request_tainting');+ X+ i& e$ c" a6 d$ c# W3 Q# w
  5.                 }
    ) o1 ~. ~* _! V. K1 T
  6.                 return true;/ {: {' {* Q3 Y! m0 ^* G8 W4 g
  7.         }
複製代碼

% ~. K. f3 Z$ h: l& d; e
  J4 _; ]7 [5 r( m! t, q+ z# c; t* Y) [% o8 K' o- j* _$ T
1 K( y) E5 `/ c1 N1 r1 R" c





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