翻墙论坛|翻墙党社区

 找回密码
 立即注册
查看: 1148|回复: 1

discuz 常见问题解决 正版 破解 插件 非法请求

[复制链接]

0

主题

0

回帖

14

积分

新手上路

Rank: 1

积分
14
发表于 2018-8-2 17:08:37 | 显示全部楼层 |阅读模式

  1. 【不是正版应用解决方法】

  2. 修改文件:论坛根目录\source\function里面的function_cloudaddons.php
  3. 2.编辑function_cloudaddons.php,查找代码:            
  4.                                                                                                             


  5. cpmsg('cloudaddons_genuine_message', '', 'error', array('addonid' => $addonid));
  6.                                                                                                    

  7. 注释掉,X3.1及之前版本的大概在99行,X3.2版本的大概在97行,把这行修改为



  8. /*cpmsg('cloudaddons_genuine_message', '', 'error', array('addonid' => $addonid));*/

  9. ----------------------------------------------------------------------------------------------

  10. 【插件设计者启动方法】

  11. 打开 config/config_global.php 文件,在文件结尾添加以下代码开启插件设计者模式。
  12. $_config['plugindeveloper'] = 1;

  13. -----------------------------------------------------------------------------------------------

  14. 【非法请求解决方法】

  15. 解决方案如下:
  16. \source\class\discuz的discuz_application.php
  17. 查找

  18. private function _xss_check() {

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

  20.                 if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {
  21.                         system_error('request_tainting');
  22.                 }

  23.                 if($_SERVER['REQUEST_METHOD'] == 'GET' ) {
  24.                         $temp = $_SERVER['REQUEST_URI'];
  25.                 } elseif(empty ($_GET['formhash'])) {
  26.                         $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');
  27.                 } else {
  28.                         $temp = '';
  29.                 }

  30.                 if(!empty($temp)) {
  31.                         $temp = strtoupper(urldecode(urldecode($temp)));
  32.                         foreach ($check as $str) {
  33.                                 if(strpos($temp, $str) !== false) {
  34.                                         system_error('request_tainting');
  35.                                 }
  36.                         }
  37.                 }

  38.                 return true;
  39.         }

  40. 替换为:

  41. private function _xss_check() {
  42.                 $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
  43.                 if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
  44.                         system_error('request_tainting');
  45.                 }
  46.                 return true;
  47.         }

  48. ------------------------------------------------------------------------------------------------------
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0

主题

89

回帖

181

积分

注册会员

Rank: 2

积分
181
发表于 2020-1-2 00:18:21 | 显示全部楼层
爱我中华人民共和国
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|翻墙党

GMT+8, 2026-9-18 04:02 , Processed in 0.067243 second(s), 32 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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