• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to use Burp Suite to exploit SQL Injection

AnonyViet by AnonyViet
January 1, 2023
in Security
0

SQL injection (SQLi) remains one of the most common web vulnerabilities today. But how to learn how to exploit it legally? It’s simple, you just need to download and configure Burp Suite Community Editionand create and set up an account in PortSwigger Labs.

Basic SQL Injection with Burp Suite

To exploit SQL Injection, you should first Download Burp Suite Pro to practice.

Plan

Task: Find Lab “SQL injection attack, list database contents on non-Oracle database”. I chose this Lab because it shows all the steps of basic SQLi and helps you understand Burp Suite tools.

How to use Burp Suite to exploit SQL Injection 21

In short: find the Admin login

Necessary steps:

  1. Find and confirm Entry Point in web request
  2. Learn type SQL comments Valid
  3. Find Row number in current table
  4. Find Columns that return STRING
  5. Find which Table is in the database of this web application
  6. Find the Target Table (Table with admin credentials)
  7. Specify the Column name of the Table
  8. Get content

Basic SQL Injection with Burp Suite

1. Find and confirm the Entry Point in the web request

When you visit the page, you will see a normal landing page. Our goal is to explore this page and look for parameters that are related to the database.

How to use Burp Suite to exploit SQL Injection 22

Here we obviously have two options: filters like ‘All’, ‘Clothing’… and My Account are at the top right.

Let’s focus on filters.

Clicking “All” will not invoke any filters.

So select the “Gifts” filter to get a valid response.

How to use Burp Suite to exploit SQL Injection 23

Now power up Burp and access its Proxy’s HTTP history. Make sure you have Intercept turned off. If not, it will still work but everything will be much slower… you can try it yourself.

How to use Burp Suite to exploit SQL Injection 24

Burp intercepted a Request to the Lab Application. Now we need to edit it. We send this Request to Repeater in Burp by right clicking on Request Body and selecting “Send to Repeater”.

How to use Burp Suite to exploit SQL Injection 25

Then go to the Repeater tab in Burp and find Request. You can edit it now.

Web servers only understand URL characters and only some human readable content. So enable automatic URL encoder in Burp by clicking Request body in Repeater and select URL-encode as you type. Now, whenever we enter characters that are not understood by the Web server will be encoded as URL and most of the human readable characters will be preserved.

How to use Burp Suite to exploit SQL Injection 26

The easiest way to find entry points in SQLi is to insert Bad Characters. Here is the basic list:

‘
%27
“
%22
#
%23
;
%3B
)
Wildcard (*)

Start testing them from top to bottom by including them in the “category” parameter. Eg:

?category='

How to use Burp Suite to exploit SQL Injection 27

Immediately after trying the first character ‘, an error occurred. This is a good sign because it means that the server did not filter the request. The symbol we sent caused an error in SQL.

You can automate this process with Burp Intruder.

We already have the entry point, which is the value of the “category” parameter after the = sign.

Now, we need to learn how to control this entry point as it can break valid SQL request.

The control is done using the appropriate comment. Depending on the SQL type, there are different comments. So the best way is to try all of them but most databases are MSSQL or MySQL. How to use Burp Suite to exploit SQL Injection 28

The double dash (-) comment doesn’t generate an error, so it’s valid and we can enter valid statements before it.

3. Find the number of rows in the table

To exploit a vulnerable database, you first need to find a way to pass commands to it. Note that direct commands have no effect.

‘ SELECT * FROM information_schema.tables —

The application returns SQL query results in its responses, so a UNION Injection attack can be used.

To perform the UNION attack, you need to determine the number of active table columns.

Number of columns: each SQL table has a certain number of columns. To make the UNION attack work, the request after the UNION keyword needs to contain the same amount of columns as the active table has.

Working table: not an official SQL term but I like to use it because it fits the way SQL works on the web. The active table is the one used by the application to provide expected responses to user requests.

Therefore, the number of columns can be determined using: ORDER BY. By incrementing the number after it, we can determine the exact number of columns.

You will notice that ‘ORDER BY 1 -‘ produces no error but ‘ORDER BY 1 0—’ the number of columns is greater than 1 but less than 10.

How to use Burp Suite to exploit SQL Injection 29

Tried 2 results with no errors but the 3rd one failed. There are no more than 3 columns: there are exactly 2 columns in the active table.

How to use Burp Suite to exploit SQL Injection 30

4. Find columns that return STRING

Now, we know the number of columns, but we need to know which columns should provide the response. Only columns with data type CHAR and the like can return human readable information.

This can be checked with a UNION SELECT query. It works by combining the results of multiple select statements. The first select statement provides information from the active table, but since we are locking down the first query, it provides nothing. After UNION is the next select statement. This statement is just an empty query but it gets the output along with the empty results from the latest query.

Enter a random string in each column:

‘ UNION SELECT ‘a’, ‘b’ —

How to use Burp Suite to exploit SQL Injection 31

The answer prints both a and b. So both columns are mineable.

Let’s use the first column for the response and nullify the second column with NULL.

What we need in response is the table name, which in normal conditions would be identified with:

SELECT table_name FROM information_schema.tables

information_schema is an important table in any SQL Database. It contains all the table names, columns and other cool stuff.

So we ask it to give us all the tables that can be stored in the DB so that we can manually choose the most suitable ones.

Integrating the select query above into the UNION SELECT statement yields:

How to use Burp Suite to exploit SQL Injection 32

The injected query will find multiple tables. Normally, you would select the Search field in Burp’s response to find keywords like admin, users, credentials, passwords…

The first keyword is Administrable_role_authorizations due to the word admin contained in it. Let’s see what the column names in this table are.

How to use Burp Suite to exploit SQL Injection 33

Nothing stands out… So let’s skip this table.

The next table is users_spkopw due to the word users Inside.

How to use Burp Suite to exploit SQL Injection 34

Query column names.

How to use Burp Suite to exploit SQL Injection 35

It’s better. Please output the contents of the columns in this table. This time, we’ll output the response in both UNION columns.

How to use Burp Suite to exploit SQL Injection 36

There are several logins, but admin is what we need. Now go to the login page and use them.

How to use Burp Suite to exploit SQL Injection 37

So that’s a success.

The article achieved: 5/5 – (100 votes)

Tags: BurpexploitInjectionSQLSuite
Previous Post

How to use FlyingProxy against DDoS using Cloudflare Enterprise’s infrastructure

Next Post

How to create a virtual balance on Mbbank to show off to your friends

AnonyViet

AnonyViet

Related Posts

How to use hackers use Splitfus to execute PowerShell malicious code
Security

How to use hackers use Splitfus to execute PowerShell malicious code

July 20, 2025
How to implement Shellcode Injection attack technique with Autoit
Security

How to implement Shellcode Injection attack technique with Autoit

March 14, 2025
How to exploit the holy hole of Hijacking on Windows
Security

How to exploit the holy hole of Hijacking on Windows

March 8, 2025
Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery
Security

Hamamal: Shellcode execution technique from afar to overcome Antivirus's discovery

February 10, 2025
Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile
Security

Snov.io Email Finder: Search emails with only company name/domain name/LinkedIn profile

December 14, 2024
Capsolver: Automatic solution solution for business
Security

Capsolver: Automatic solution solution for business

December 12, 2024
Next Post
How to create a virtual balance on Mbbank to show off to your friends

How to create a virtual balance on Mbbank to show off to your friends

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

How to install GPT-suns on who do not need the Internet

How to install GPT-suns on who do not need the Internet

August 12, 2025
Instructions for using AI chatbot of the Ministry of Public Security

Instructions for using AI chatbot of the Ministry of Public Security

August 12, 2025
How to avoid being monitored on Android: Turn off these 3 features!

How to avoid being monitored on Android: Turn off these 3 features!

August 12, 2025
How to increase your favorite score with Ani Grok to unlock NSFW

How to increase your favorite score with Ani Grok to unlock NSFW

August 11, 2025
How to install GPT-suns on who do not need the Internet

How to install GPT-suns on who do not need the Internet

August 12, 2025
Instructions for using AI chatbot of the Ministry of Public Security

Instructions for using AI chatbot of the Ministry of Public Security

August 12, 2025
How to avoid being monitored on Android: Turn off these 3 features!

How to avoid being monitored on Android: Turn off these 3 features!

August 12, 2025
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

How to install GPT-suns on who do not need the Internet

How to install GPT-suns on who do not need the Internet

August 12, 2025
Instructions for using AI chatbot of the Ministry of Public Security

Instructions for using AI chatbot of the Ministry of Public Security

August 12, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply