This lab contains a SQL injection vulnerability in the product category filter. When the user selects a category, the application carries out a SQL query like the following:
SELECT * FROM products WHERE category = 'Gifts' AND released = 1
To solve the lab, perform a SQL injection attack that causes the application to display one or more unreleased products.
特に考えることはなしに、Pets' or 'a'='a
で終わりです。
This lab contains a SQL injection vulnerability in the login function.
To solve the lab, perform a SQL injection attack that logs in to the application as the administrator user.
これも特に考えません。
username: administrator, password=' or 'a'='a' --
を打ち込めばヨシです。
This lab contains a SQL injection vulnerability in the product category filter. You can use a UNION attack to retrieve the results from an injected query.
To solve the lab, display the database version string
以下のように送ったときだけ、200 OKが返ることから、返却カラムは2であることがわかります。
後は返却カラムのデータ型を特定して、以下のペイロードで終わりです。
This lab contains a SQL injection vulnerability in the product category filter. You can use a UNION attack to retrieve the results from an injected query.
To solve the lab, display the database version string.
返却カラムが2で、char型のカラムがあることが以下のペイロードからわかります。
となると後はやるだけです。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response so you can use a UNION attack to retrieve data from other tables.
The application has a login function, and the database contains a table that holds usernames and passwords. You need to determine the name of this table and the columns it contains, then retrieve the contents of the table to obtain the username and password of all users.
To solve the lab, log in as the administrator user.
脆弱性がある箇所は同じで、データベースはPostgreSQLっぽいです。
SQLmapを使ってデータベース、テーブルをダンプします。
public databaseには、users_lgwazd
があるみたいです。
ダンプできたので、アクセスすれば終わりです。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response so you can use a UNION attack to retrieve data from other tables.
The application has a login function, and the database contains a table that holds usernames and passwords. You need to determine the name of this table and the columns it contains, then retrieve the contents of the table to obtain the username and password of all users.
To solve the lab, log in as the administrator user.
Oracle DBで、脆弱な箇所は同じです。
PETER DATABASEが見つかります。
後はアクセスするだけです。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response, so you can use a UNION attack to retrieve data from other tables. The first step of such an attack is to determine the number of columns that are being returned by the query. You will then use this technique in subsequent labs to construct the full attack.
To solve the lab, determine the number of columns returned by the query by performing a SQL injection UNION attack that returns an additional row containing null values.
Postgresっぽいです。
以下をぶち込んだら終わりました。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response, so you can use a UNION attack to retrieve data from other tables. To construct such an attack, you first need to determine the number of columns returned by the query. You can do this using a technique you learned in a previous lab. The next step is to identify a column that is compatible with string data.
The lab will provide a random value that you need to make appear within the query results. To solve the lab, perform a SQL injection UNION attack that returns an additional row containing the value provided. This technique helps you determine which columns are compatible with string data.
上記を送り、文字型を特定したら、以下の場所にあるランダムな文字列を文字型に入れれば終わりです。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response, so you can use a UNION attack to retrieve data from other tables. To construct such an attack, you need to combine some of the techniques you learned in previous labs.
The database contains a different table called users, with columns called username and password.
To solve the lab, perform a SQL injection UNION attack that retrieves all usernames and passwords, and use the information to log in as the administrator user.
usersテーブルが見つかります。
後はこのクレデンシャルを使ってログインすれば良いです。
This lab contains a SQL injection vulnerability in the product category filter. The results from the query are returned in the application's response so you can use a UNION attack to retrieve data from other tables.
The database contains a different table called users, with columns called username and password.
To solve the lab, perform a SQL injection UNION attack that retrieves all usernames and passwords, and use the information to log in as the administrator user.
これもPostgreSQLです。
usersテーブルが見つかります。
fin
This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.
The results of the SQL query are not returned, and no error messages are displayed. But the application includes a "Welcome back" message in the page if the query returns any rows.
The database contains a different table called users, with columns called username and password. You need to exploit the blind SQL injection vulnerability to find out the password of the administrator user.
To solve the lab, log in as the administrator user.
Postgresqlっぽいです。
あとはこれでログインし、終了です。
This lab contains a blind SQL injection vulnerability. The application uses a tracking cookie for analytics, and performs a SQL query containing the value of the submitted cookie.
The results of the SQL query are not returned, and the application does not respond any differently based on whether the query returns any rows. If the SQL query causes an error, then the application returns a custom error message.
The database contains a different table called users, with columns called username and password. You need to exploit the blind SQL injection vulnerability to find out the password of the administrator user.
To solve the lab, log in as the administrator user.
Oracle DBっぽいです。
SQLmapだとおそすぎたので、手動でやります。
$$
が20の時、500 Errorが返ることから、Passwordの長さが20でありそうなことがわかります。
あと1文字ずつ比較していく必要があります。
1つめの$$
2つめの$$
result
hcs37xkbtj27y6hlagbw
がパスワードなのでこれを入れて終わりです。
上記のように、Stack Traceが出てくるタイプのラボです。
上記を脆弱な箇所に打ち込むと、
情報を得られます。
ということで、
これで終わりです。
またもやPostgresqlっぽいです。
Time-baseでデータを抜こうとするとかなり時間がかかるので、今回はusers tableに対してのみ行います。
なんとなく手動でやったほうが早そうな気がしてきたので、手動でやります
上記をTrackingId
に打ち込んで、Responseが5sほど遅延することを確認しておきます。
$$に対して、数字を増加させていくと、20で5sの遅延があることから、password長は20であることがわかります。
あとはこれに総当りするだけです。
IntruderでCluster bombを選択し、
最初の$$
はNumbersで1~20を選択
次の$$
はBrutoforce
result
lxek48194ipd2nz7y3nh
がパスワードなので打ち込んで終わりです。
またもやPostgres
TrackingIdに対して、
とすると遅延が発生します
ということで、Blind SQL injection with time delays
と同じ方法なのでそっちを参考にしてください。
{collabrator domain}
部分に自身のcollabrator domainを入れると、OOBを感じ取れ、終わりです。
{DOMAIN}
には、自身のCollaborator domainを入れて下さい。
OOBを感じ取れたら、
このような感じで送ればパスワードを取得できます。
ので、ログインして終わりです
check stockを押下すると以下のようなリクエストが飛びます。
Postgresqlっぽいです。
上記をいい感じに難読化して終わりです。