Bulk SQL Injection Using Burp To Sqlmap
Bulk SQL Injection Using Burp To Sqlmap
1|Page
Contents
INTRODUCTION .......................................................................................................................... 3
What is QL Injection Attack ....................................................................................................... 3
What is SQLMap ......................................................................................................................... 3
What is Burp Suite Scanner ....................................................................................................... 4
Exporting Packets from Burp Suite ............................................................................................ 4
Installing Burp-to-SQLMap Script .............................................................................................. 6
Running Burp-To-SQLMap Script ............................................................................................... 7
Refrences ................................................................................................................................... 8
2|Page
INTRODUCTION
As you know, SQL Injection is a security vulnerability with critical severity. If you are a hacker you
know it as well that it takes a lot of times to find a sql injection vulnerability on a target. It will be
worse if you are a penetration tester. You must check this vulnerability on all of target URLs by
intercepting packets using Burp Suit or other tools and in big Portals it’s not easy.
I have good news for hackers and pen testers. I made it easier by my new python script. The only
thing you should do, is exporting your packets as a burp suit state file. The rest of steps will done by
my script. I called me script “Burp-TO-SQLMap” and I will explain the test process from the
beginning.
What is SQLMap
Sqlmap is an open source software that is used to detect and exploit database vulnerabilities and
provides options for injecting malicious codes into them. It is a penetration testing tool that
automates the process of detecting and exploiting SQL injection flaws providing its user interface in
the terminal. The software is run at the command line and is available to download for different
operating systems: Linux distributions, Windows and Mac OS operating systems.
In addition to mapping and detecting vulnerabilities, the software enables access to the database,
editing and deleting data, and viewing data in tables such as users, passwords, backups, phone
numbers, e-mail addresses, credit cards and other confidential and sensitive information.
Sqlmap has full support for multiple DBMSs, including MySQL, Oracle, PostgreSQL, Microsoft SQL
Server, Microsoft Access, IBM DB2, SQLite, Firebird and SAP MaxDB And full support for all injection
techniques: Boolean, Error, Stack, Time, Union.
3|Page
What is Burp Suite Scanner
Burp or Burp Suite is a graphical tool for testing Web application security. The tool is written in Java
and developed by PortSwigger Security. It was developed to provide a comprehensive solution for
web application security checks. In addition to basic functionality, such as proxy server, scanner and
intruder, the tool also contains more advanced options such as a spider, a repeater, a decoder, a
comparer, an extender and a sequencer.
Click on Proxy > HTTP history to see your Burp Suite Packet history.
Note: if you browse other websites during the test process, you should click on HOST header culomn
to set order on that. So you will have all of your target packets in one place.
Based on out explanation in INTRODUCTION, Burp-TO-SQLMap script performs SQL Injection test
using SQLMAP and SQLMap needs URLs with valid Parameters (POST/GET). So you should only select
parametrized requests. Fortunately, this is easy and you can filter parametrized packets with just
two clicks.
4|Page
As you see Now we only have parametrized requests.
Select all of your target packets for performing SQL Injection Test. Right Click and Click on Save
items.
5|Page
In the new windows, uncheck Base64-encode requests and responses. Choose a name for your burp
state file and save it. Now its done and you only need to run script, give this file as input and get the
vulnerability result in output.
1) Download and Install python 2.7 (you can download it from bellow URL)
https://www.python.org/download/releases/2.7/
3) Download and install latest version of Burp Suite from bellow URL.
https://portswigger.net/burp/communitydownload
4) Download and Install sql map. (you can download it from sqlmap website)
http://sqlmap.org/
6|Page
Running Burp-To-SQLMap Script
Run Script with bellow command.
Note:
Script will extract all of GET/POST request and save each request in separate file in output directory.
After that script will run sqlmap and test request files one by one and print the result. For vulnerable
requests it print URL is not Vulnerable and for other URLs it print URL is not Vulnerable.
Also it will print the complete sqlmap output for each request in a separate file beside the request
file in output directory.
7|Page
Also if you open your Output direcoty, you can see list of requests ans result file. You can use it for
your exploit evidence or POC.
Refrences
1. https://www.owasp.org/index.php/SQL_Injection
2. https://en.wikipedia.org/wiki/SQL_injection
3. https://en.wikipedia.org/wiki/Burp_suite
4. https://en.wikipedia.org/wiki/Sqlmap
8|Page