好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

ThinkSNS存在sql注入,可爆库 - 网站安全 - 自学p

文件位置

apps\weibo\Lib\Action\OperateAction.class.php

 

//删除评论

    function docomments(){

    $result = D('Comment')->deleteComments( $_POST['id'] , $this->mid);

        X('Credit')->setUserCredit($info['uid'],'delete_comment');

    echo json_encode($result);

    }

deleteComments方法没有对Post进行过滤可以导致注入

1 首先注册一个帐号

2 去进行一个评论

3 到http://t.thinksns测试数据/comment?type=send&from_app=weibo通过firebug等工具可以查看到评论的那条记录ID

4 利用地址http://t.thinksns测试数据/index.php?app=weibo&mod=Operate&act=docomments

5 发送post数据 id=你评论的那条ID(POST的时候需要登录状态,之前的版本可以不登录执行)

6 其他参数 自由发挥

 

下图为本地测试结果

 

 

 

 

修复方案: 过滤参数

 

查看更多关于ThinkSNS存在sql注入,可爆库 - 网站安全 - 自学p的详细内容...

  阅读:39次