找回密码

火车采集器软件交流官方论坛

搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 6759|回复: 6

做了个discuz3.1的采集发布规则,您当前的访问请求当中含...

[复制链接]
发表于 2014-4-24 16:11:42 | 显示全部楼层 |阅读模式
本帖最后由 蓝呆 于 2015-7-23 14:35 编辑

我做了个发布规则,可以登录获取到列表了,但是测试发布的时候显示下面内容,然后论坛没发布成功:

发布成功,成功标识码:
网页源代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
        <title>www.wulianzhen.cn - System Error</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
        <meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
        <style type="text/css">
        <!--
        body { background-color: white; color: black; font: 9pt/11pt verdana, arial, sans-serif;}
        #container { width: 1024px; }
        #message   { width: 1024px; color: black; }

        .red  {color: red;}
        a:link     { font: 9pt/11pt verdana, arial, sans-serif; color: red; }
        a:visited  { font: 9pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
        h1 { color: #FF0000; font: 18pt "Verdana"; margin-bottom: 0.5em;}
        .bg1{ background-color: #FFFFCC;}
        .bg2{ background-color: #EEEEEE;}
        .table {background: #AAAAAA; font: 11pt Menlo,Consolas,"Lucida Console"}
        .info {
            background: none repeat scroll 0 0 #F3F3F3;
            border: 0px solid #aaaaaa;
            border-radius: 10px 10px 10px 10px;
            color: #000000;
            font-size: 11pt;
            line-height: 160%;
            margin-bottom: 1em;
            padding: 1em;
        }

        .help {
            background: #F3F3F3;
            border-radius: 10px 10px 10px 10px;
            font: 12px verdana, arial, sans-serif;
            text-align: center;
            line-height: 160%;
            padding: 1em;
        }

        .sql {
            background: none repeat scroll 0 0 #FFFFCC;
            border: 1px solid #aaaaaa;
            color: #000000;
            font: arial, sans-serif;
            font-size: 9pt;
            line-height: 160%;
            margin-top: 1em;
            padding: 4px;
        }
        -->
        </style>
</head>
<body>
<div id="container">
<h1>Discuz! System Error</h1>
<div class='info'><li>您当前的访问请求当中含有非法字符,已经被系统拒绝</li></div>

<div class="info"><p><strong>PHP Debug</strong></p><table cellpadding="5" cellspacing="1" width="100%" class="table"><tr><td><ul><li>[Line: 0056]forum.php(discuz_application->init)</li><li>[Line: 0071]source\class\discuz\discuz_application.php(discuz_application->_init_misc)</li><li>[Line: 0552]source\class\discuz\discuz_application.php(discuz_application->_xss_check)</li><li>[Line: 0355]source\class\discuz\discuz_application.php(system_error)</li><li>[Line: 0023]source\function\function_core.php(discuz_error::system_error)</li><li>[Line: 0024]source\class\discuz\discuz_error.php(discuz_error::debug_backtrace)</li></ul></td></tr></table></div><div class="help"><a >www.topzhubao.com</a> 已经将此出错信息详细记录, 由此给您带来的访问不便我们深感歉意. </div>
</div>
</body>
</html>
返回的Header:
HTTP/1.1 200 OK
Connection:close
Date:Thu, 24 Apr 2014 08:02:45 GMT
Server:Microsoft-IIS/6.0
X-Powered-By:ASP.NET,PHP/5.2.5
Content-Type:text/html; charset=gbk
Set-Cookie:ZgLR_f3b4_sid=ta8A3d; expires=Fri, 25-Apr-2014 08:02:45 GMT; path=/; domain=.wulianzhen.cn,ZgLR_f3b4_lip=14.154.169.46%2C1398326502; path=/; domain=.wulianzhen.cn
Content-Length:2600


请问是什么原因,求大神指点
 楼主| 发表于 2014-4-24 16:37:12 | 显示全部楼层
噢yeah  解决了  哈哈哈
发表于 2014-4-25 11:46:42 | 显示全部楼层
蓝呆 发表于 2014-4-24 16:37
噢yeah  解决了  哈哈哈

可以给大家分享下你的解决方法
 楼主| 发表于 2014-4-26 13:13:45 | 显示全部楼层
解决方法:

FTP 进入网站根目录 找到 \source\class\discuz的discuz_application.php 编辑
查找


private function _xss_check() {
5 }2 o3 y' D  v5 j$ {, k& ]                static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');
: ^, c' c+ g( k6 N7 [                if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {  f- |$ }: \& ]1 e! j! v/ G+ d
                        system_error('request_tainting');; v$ L, A0 _3 f6 q5 J% t
                }
/ h! F7 G7 Y0 g8 U- y* z, |                if($_SERVER['REQUEST_METHOD'] == 'GET' ) {' W* G) F2 a% J0 S# s: X' A
                        $temp = $_SERVER['REQUEST_URI'];( t, K  }4 j  S- Z
                } elseif(empty ($_GET['formhash'])) {& f* {" v7 v6 }' j
                        $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
$ f# R# Q- y. [                } else {
0 F% g4 U; e& t. {% V: j* |% s  Y% l$ G                        $temp = '';0 ]0 n/ S5 V" M" R  j
                }9 _& P3 ~7 V" M
                if(!empty($temp)) {' T$ R/ ~7 ?/ l5 p  T- X: g* J
                        $temp = strtoupper(urldecode(urldecode($temp)));+ u+ R0 W, F! T/ g! x+ t
                        foreach ($check as $str) {9 E+ U9 j3 a% L* g
                                if(strpos($temp, $str) !== false) {8 ]$ z8 j( N3 }* ~% N- }: M
                                        system_error('request_tainting');
# N% \1 q% T* ]% {+ C                                }
; D; V7 k# f% w                        }+ d. U1 U( `5 ]* r: ]" M
                }
, L% l+ V( M) e( \                return true;
2 ^4 o) w+ c* p. E2 h, o        }

替换为:



private function _xss_check() {
) A* [- x+ @! ]$ s( T                $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));6 C; j# Z1 A6 r, ]; j; @3 ?6 _
                if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
) q+ g" H$ d- U" i                        system_error('request_tainting');6 \( z4 c8 K2 E
                }
  x' v; J4 z0 o" g! m& G                return true;
9 o/ g; W3 l* c- x5 Y% j        }


保存就OK了,解决了。
发表于 2014-6-21 17:14:54 | 显示全部楼层
蓝呆 发表于 2014-4-26 13:13
解决方法:

FTP 进入网站根目录 找到 \source\class\discuz的discuz_application.php 编辑

这修改了网站无法访问啊,是不是你代码错了?
发表于 2015-1-6 10:57:38 | 显示全部楼层
下页~情殇 发表于 2014-6-21 17:14
这修改了网站无法访问啊,是不是你代码错了?

查看:

http://www.luc.cn/how-to-resolve ... d-to-xss_check.html
发表于 2015-1-6 10:58:13 | 显示全部楼层
  1. /**

  2. private function _xss_check() {

  3.                 static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');

  4.                 if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  5.                         system_error('request_tainting');
  6.                 }

  7.                 if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
  8.                         $temp = $_SERVER['REQUEST_URI'];
  9.                 } elseif(empty ($_GET['formhash'])) {
  10.                         $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
  11.                 } else {
  12.                         $temp = '';
  13.                 }

  14.                 if(!empty($temp)) {
  15.                         $temp = strtoupper(urldecode(urldecode($temp)));
  16.                         foreach ($check as $str) {
  17.                                 if(strpos($temp, $str) !== false) {
  18.                                         system_error('request_tainting');
  19.                                 }
  20.                         }
  21.                 }

  22.                 return true;
  23.         }
  24. */

  25.     private function _xss_check() {  
  26.       
  27.                     $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));  
  28.       
  29.                     if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {  
  30.       
  31.                             system_error('request_tainting');  
  32.       
  33.                     }  
  34.       
  35.                     return true;  
  36.       
  37.             }  
复制代码
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

温馨提示:建议您联系官方定制服务,通过官方支付方式完成支付。您与其他非官方账号发生的交易,我方概不承担责任。网络有风险,交易需谨慎

QQ| 手机版|Archiver| 火车采集器官方站

Copyright © 2001-2013 Comsenz Inc.  Template by Comeings! All Rights Reserved.

Powered by Discuz! X3.4( 皖ICP备06000549 )

快速回复 返回顶部 返回列表