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

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

作者: IT_man    時間: 2015-7-19 20:45
標題: Discuz! System Error---您當前的訪問請求當中含有非法字符,已經被系統拒絕
本帖最後由 IT_man 於 2015-7-19 20:51 編輯
6 z4 ~* ]3 O/ o& K1 H
: L" m3 w# \7 I2 x
) r' y( i- g3 m  S; Y( |; W. C6 A6 V& ~! |: J/ P" F
3 P' Q( f- q$ M1 G' ~* Z6 ^
http://www.alexa.com/  蜘蛛收錄會產生如下的問題
* M, L7 a- g3 f, a; ^$ a. ~" M4 q9 }

8 E- V& {, f% {5 c5 A6 Y* J+ a- y解決方法如下:8 D. ~0 ?4 b# m( g0 g% ]. D. z0 v
source\class\discuz的discuz_application.php找到
* W3 z9 f4 w/ h6 w! n* ~3 {& n
  1. private function _xss_check() {+ y& p9 M. u: `# y& N7 ]* ?9 W

  2. & {( n- Z5 Q! b
  3.   static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');
    - ~+ h* }. n2 X
  4. 9 U3 r% X9 ^& @3 w% }
  5.   if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {- G2 E/ Z+ R) q/ v1 o$ C0 d
  6.     system_error('request_tainting');
    + f* o( V) @: i5 ~. I8 n
  7.   }: Y1 [, o2 u# T* d( @0 O
  8. 3 Z1 Q( t3 _  a% S0 J
  9.   if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
    + l2 t. y/ J( H+ H$ K
  10.     $temp = $_SERVER['REQUEST_URI'];" e+ C9 |' x) C
  11.   } elseif(empty ($_GET['formhash'])) {
    9 E4 x% d4 D/ l; Q9 o  _
  12.     $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');0 Y7 _1 n0 c* T  E0 M, a; ?0 v
  13.   } else {
    0 J5 h' Y( Z; X; c  f& E# J0 q
  14.     $temp = '';
    , s# r: o) ]3 N/ a3 V! H, {
  15.   }
    8 ~5 f7 E4 E/ M: c: l: E, m
  16. ; n* ], k) F- x( ?
  17.   if(!empty($temp)) {
    1 F1 w2 x& u6 r0 w9 S9 O- h
  18.     $temp = strtoupper(urldecode(urldecode($temp)));, e3 s" C# d2 y3 e' t
  19.     foreach ($check as $str) {
    % [* J6 }. f+ v: p5 s
  20.       if(strpos($temp, $str) !== false) {
    1 M9 }1 |: h4 d, v4 H) j; y
  21.       system_error('request_tainting');
    5 ^- C- z3 Q1 l# n
  22.     }
    ( `/ i& R- l0 d8 }3 `7 R' Q! O( A# @
  23.   }( O0 ]" T) U# e* {9 t/ u
  24.                 }
    & a+ M! M0 ?: b

  25. 3 F" U4 Q' B4 ]! _: e) r# w4 n) |
  26.                 return true;
複製代碼
整段複製成:
7 |/ w/ g1 t/ T0 X( R. D
  1. private function _xss_check() {
      E5 @2 b4 M7 K( P$ g# [
  2.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));0 ^+ i& C! H8 n- W+ x/ [: V% Z- |
  3.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {/ Z$ i0 C$ H! a. t" a1 `: Y
  4.                         system_error('request_tainting');# W. i& z/ N% |6 Z3 H5 i
  5.                 }- X. h* w0 l; C0 k
  6.                 return true;# e$ y( L9 Z" ~! i3 q
  7.         }
複製代碼
. ]# g$ L5 p$ Q4 ~. F4 ^+ }, O  A3 W9 F
, r* Y6 \; N6 M6 S
+ K! K; f$ G& i5 }8 S
$ Q9 x( x& v" D& ^





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