Discuz教程网

Discuz X3涂鸦板无法使用问题解决

[复制链接]
authicon dly 发表于 2016-2-5 14:04:35 | 显示全部楼层 |阅读模式
现象:
224527epd7f2qgaspq7cus.png

调查思路:
浏览器F12或右键查看Flash展示处的html源码:
  1. <embed width="438" height="304"
  2. src="static/image/common/doodle.swf?fid=a_magic_doodle&oid=comment_message&from=&config=http%3A%2F%2Fbbs.tsingfun.com%2Fhome.php%3Fmod%3Dmisc%26ac%3Dswfupload%26op%3Dconfig%26doodle%3D1"
  3. quality="high" wmode="transparent" allowscriptaccess="always" type="application/x-shockwave-flash">
复制代码

config参数url解码后:http://域名/home.php?mod=misc&ac=swfupload&op=config&doodle=1
访问可以看到是一些配置项,包括上面按钮本应显示的文字。

由此可以初步判定,Flash没有正确加载url中的配置项。

doodle.swf进行反编译,查看加载配置相关的代码,如下:
  1. internal function loadConfig():void
  2.         {
  3.             var loc1:*=new RegExp("^(https?|ftp|gopher|news|telnet|mms|rtsp):\/\/", "i");
  4.             if (this.configURL.match(loc1) === null && this.configURL.indexOf("://") == -1)
  5.             {
  6.                 this.xmlRequest = new flash.net.URLRequest(this.configURL);
  7.                 this.xmlLoader = new flash.net.URLLoader(this.xmlRequest);
  8.                 this.xmlLoader.addEventListener(flash.events.Event.COMPLETE, parseConfig);
  9.             }
  10.             return;
  11.         }
复制代码

上面这个if逻辑是:url不以http开头且不包含“://”字符串才能解析,但是外面config传值又是以“http://”开头的,这里不得不吐槽一下Discuz团队,是否是两个小组的人员没有商量好接口,还是判断逻辑有误呢?

由于修改Flash代价稍高,因此笔者决定修改config传值,去掉前面的“http://”:
修改sourceclassmagicmagic_doodle.php
$config = urlencode(getsiteurl().'home.php?mod=misc&ac=swfupload&op=config&doodle=1');
改为:
$config = urlencode('home.php?mod=misc&ac=swfupload&op=config&doodle=1');

现在运行,如图:
225858xfmftqnpjqxxqz7f.png


不过,此时保存按钮功能还是有些问题,下次再细调了。

今天继续研究点击“保存”按钮没有任何反应的问题。

分析思路:
没错,继续反汇编doodle.swf调试as源代码,别无他法了。这里搞个便民反编译源文件供大家参考 zip.gif doodle反编译源文件.zip (72.38 KB, 下载次数: 1)
我们跟踪数据post后的响应数据:
  1. internal function makeComplete(arg1:flash.events.Event):void
  2.         {
  3.                         trace("makeComplete");
  4.             var event:flash.events.Event;
  5.             var result:XML;
  6.             var msg:String;
  7.             var loader:flash.net.URLLoader;
  8.             var request:flash.net.URLRequest;
  9.             var variables:flash.net.URLVariables;

  10.             var loc1:*;
  11.             result = null;
  12.             msg = null;
  13.             loader = null;
  14.             request = null;
  15.             variables = null;
  16.             event = arg1;
  17.             try
  18.             {
  19.                                 trace(event.currentTarget.data);
  20. ......
复制代码

结果是一个html文件,效果如下:
163811weubizbuigxigsug.png

继续查找错误原因,发现是由于post数据中没有带hash值,_xss_check()失败导致。
这里,再次吐槽Discuz团队,你们做了充分测试了吗?
还是之前那句话,修改Flash源码代价蛮高,笔者不想弄。
临时去掉xss检验解决问题。
home.php 顶部加上一个定义就ok了,代码如下:
  1. if ($_GET['mod'] == 'misc' && $_GET['ac'] == 'swfupload' && $_GET['op'] == 'doodle') {
  2.         define('DISABLEXSSCHECK', '1');
  3. }
复制代码
解决后截图如下:
164217sbx121xbx20qjq3m.jpg

原文:http://bbs.tsingfun.com/thread-457-1-1.html






上一篇:Discuz教程网签到记录贴-2016年2月5日
下一篇:Discuz主题如何合并?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-4-25 00:20

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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