基於報錯的sql注入
- 字符型注入
- 數字型
- 括號型
推測sql語句
select username, password from table where id = 1 limit 0,1;
**union ** 聯合查詢的方法,主要利用mysql的 information_schema 數據庫記錄的關於整個數據庫的信息.
查詢數據庫信息
1利用 order by 判斷字段數字
order by [num]
2.聯合查詢
聚合函數
user()
version()
database()
select database()
select group_concat(schema_name) from information_schema.schemata;
查詢表名(表名字用十六進制編碼)
select table_name form informarion_schema.tables where table_schema=database();
table_schema 數據庫的名字
table_name 表名字
查詢列名信息
select group_concat(column_name) from information_schema.columns where table_name=(表名的十六進制編碼)
sqlmap使用
-u 指定 url
--dbs
--batch
-D <databseName>
--tables
-T
--columns
-C
--dump
基於時間進行盲注
ppt錯誤:length() 前面不需要加 select,因爲 length() 要放入sql語句中.