ECShop 2.7.2 API 盲注漏洞

来源 tenzy@乌云

简要描述:

该漏洞已经过本人测试存在。在服务器关闭魔法引号的情况下可以盲注,不受ECShop内核过滤影响。这次不坑爹了
问题文件在/api/client/api.php
利用方法为POST

详细说明:

/api/client/api.php 第7行

dispatch($_POST);


/api/client/includes/lib_api.php 6 -10 行

$func_arr = array('GetDomain', 'UserLogin', 'AddCategory', 'AddBrand', 'AddGoods', 'GetCategory', 'GetBrand', 'GetGoods', 'DeleteBrand', 'DeleteCategory', 'DeleteGoods', 'EditBrand', 'EditCategory', 'EditGoods'); if(in_array($post['Action'], $func_arr) && function_exists('API_'.$post['Action'])) { return call_user_func('API_'.$post['Action'], $post); }


当$_POST[‘Action’] == ‘UserLogin’的时候调用
/api/client/includes/lib_api.php 246 行

function API_UserLogin($post) { $post['username'] = isset($post['UserId']) ? trim($post['UserId']) : ''; $post['password'] = isset($post['Password']) ? strtolower(trim($post['Password'])) : ''; /* 检查密码是否正确 */ $sql = "SELECT user_id, user_name, password, action_list, last_login". " FROM " . $GLOBALS['ecs']->table('admin_user') . " WHERE user_name = '" . $post['username']. "'"; $row = $GLOBALS['db']->getRow($sql); if ($row) { if ($row['password'] != $post['password']) { client_show_message(103); } require_once(ROOT_PATH. ADMIN_PATH . '/includes/lib_main.php'); // 登录成功 set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_login']); // 更新最后登录时间和IP $GLOBALS['db']->query("UPDATE " .$GLOBALS['ecs']->table('admin_user'). " SET last_login='" . gmtime() . "', last_ip='" . real_ip() . "'". " WHERE user_id='$_SESSION[admin_id]'"); client_show_message(100, true, VERSION, 0, true, EC_CHARSET); }


其中USERID未经过滤且不受内核过滤影响,造成盲注漏洞

发表评论?

0 条评论。

发表评论