Thứ Hai, Tháng Hai 6, 2023
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
No Result
View All Result
Home Tech

How to use Burp Suite to exploit SQL Injection

5 Tháng Mười Một, 2022
in Tech
0
How to use Burp Suite to exploit SQL Injection
585
SHARES
3.2k
VIEWS
Share on FacebookShare on Twitter

Các bài viết liên quan:

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022

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. For example:

?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 table 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 in there.

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.

Previous Post

Instructions on how to play the most easy-to-win Keno Vietlott in 2023

Next Post

FIFA urges to stop ‘promoting morality’ at Qatar World Cup

Megusta

Megusta

Related Posts

5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
Instruction how to use OBS streaming software

Features, settings and how to use OBS streaming software through 9 simple steps

25 Tháng Mười Hai, 2022
What is Trans woman?  What is Transgender Women?

What is Trans woman? What is Transgender Women?

23 Tháng Mười Hai, 2022
Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

22 Tháng Mười Hai, 2022
How to get 50 free coins of SkyJoy App to redeem

How to get 50 free coins of SkyJoy App to redeem

21 Tháng Mười Hai, 2022
Load More
Next Post
FIFA urges to stop ‘promoting morality’ at Qatar World Cup

FIFA urges to stop 'promoting morality' at Qatar World Cup

Trả lời Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Bài viết mới

How to get travel insurance
Đời sống

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly
Phần mềm

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games
Software

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power
Software

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 
Tech

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software
Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022
W3Schools

Ads

Contact: [email protected]

DMCA.com Protection Status

Categories

  • Android
  • Cạm bẫy tâm lí
  • Chưa được phân loại
  • Đồ họa
  • Đời sống
  • Gen Z
  • Health
  • iOS
  • Kĩ năng mềm
  • News
  • Nhà mạng
  • Phần mềm
  • Phần mềm đồ họa
  • Review sách
  • Software
  • Tech
  • Thiết kế ảnh
  • Thiết kế video
  • Thủ thuật
  • Travel
  • Văn hóa Nam Bộ
  • Văn học
  • Window

Browse by Tag

ai là triệu phú android Apple browser Bullet Journal bản thân chai pin Chỉnh ảnh data domain download fshare game game show giả lập màu hosting IKEA ios khuyến mãi kinh doanh kiến thức kiểm tra pin messenger miễn phí mua sắm Máy ảnh mạng network nghệ thuật ngôn ngữ nhà Trần pin laptop quảng cáo tiếng anh trạng thái Trần Thủ Độ tên miền tắt hoạt động từ vựng video viettel window 10 word zalo Đơn giản

Recent News

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023

Trang tin nóng hổi - vừa thổi vừa xem

No Result
View All Result
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z

Trang tin nóng hổi - vừa thổi vừa xem