SQL injection attack, querying the database type and version on Oracle(Portswigger Lab 07)
Path: Product Category filter
Goal: display the database version string
Step1: Determine the number of columns after the category name, we run a query
Query: ‘ order by 1 - -
then, select all and press Cntrl+U for URL encoding
![]() |
| Response 200 OK |
It shows that the status HTTP/2 200 OK. It means the server responds to the malicious query. It also means that the server has 1 column.
step 2: Then, we check the same query for the 2 columns.
Query: ‘ order by 2 - -
then, select all and press Cntrl+U for URL encoding
It shows that the status HTTP/2 200 OK. It means the server responds to the malicious query. It also means that the server has 2 columns.
Step 3: Then, we check the same query for the 3 columns.
Query: ‘ order by 3 - -
select all and press Cntrl+U for URL encoding
Step 4: Determine the datatype for the column
\
Query: ‘UNION SELECT ‘a’, ‘a’ from DUAL - - (this syntax for the Oracle version)
select all and press Cntrl+U for URL encoding
Now, we can be sure that this table has two columns that have string datatype.
Step 5: Finally, we run the SQL version query which is applied to fetching the version of the database.
Query: ‘ UNION SELECT banner, ‘a’ from v$version - -
select all and press Cntrl+U for URL encoding
Congratulations you solving the Lab 07
#HappyHacking






Comments
Post a Comment