# How to Check For SQL Injection Easily

> We'll show you how to use one of online and free tools to test your web-app for SQL injection vulnerability.

- Published: 3 September 2022
- Updated: 17 May 2025
- Author: S4E Expert
- URL: https://s4e.io/blog/how-to-check-for-sql-injection-easily

In this blog post, we will learn how to check for SQL Injection easily using an online and free tool.

Before we get into how to check SQL Injection vulnerability online, let's cover some elementary topics.

- Summary For SQL Injections
- What is SQL Injection
- Some SQL Injection Types
- Risk of SQL Injection Attacks

If you don't need it, feel free to skip directly "How to Check For SQL Injection Easily".

## Summary For SQL Injections

If you need a refresher on SQL injections or are learning about them for the first time, this information will help give you a complete understanding of the topic.

### What is SQL Injection?

SQL stands for Structured Query Language. It is a standard language for accessing databases.

SQL injection is a type of attack where the attacker inserts malicious SQL code into an input field in order to execute a malicious query on the database.

This can be done by inserting a SQL code into an input field that is used in a SQL query. If the input field is not properly sanitized, then the attacker can execute a malicious query on the database.

### Some SQL Injection Types

The five types of SQL injections we want to mention are:

**1. Blind SQL Injection:** In this type of attack, the attacker does not know the structure of the database. The attacker can only insert a SQL code into an input field and then see the response from the server.

**2. Error-based SQL Injection:** In this type of attack, the attacker can easily learn the structure of the database. The attacker can insert a SQL code into an input field and then see the error message from the server.

**3. Union-based SQL Injection:** The attacker uses the UNION operator to combine the results of two or more SQL queries.

**4. Time-based SQL Injection:** The attacker can use some functions to make the server wait for a certain amount of time.

**5. Out-of-band SQL:** The attacker can use some functions to make the server communicate with another system.

### Risk of SQL Injection Attacks

SQL injection attacks can be very dangerous. The attacker can insert a SQL code that can delete all the data in the database. The attacker can also insert a SQL code that can change the data in the database or get sensitive information from the database.

Also, depending on vulnerability types attackers can upload a file, read a file from the file system or run commands at operating system level.

## How to Check For SQL Injection Easily

We will use one of our free and online tools named [Online Generic SQL Injection Vulnerability Scanner](https://app.s4e.io/scans/tools/sql-injection-vulnerability-scanner)

Our SQL Injection scanner can quickly check for SQL Injection vulnerability at your app \*. Here are the 3 simple stages you may take.

Let's assume you have a website named s4e.io. And you wish to scan some of its pages for SQL Injection vulnerabilities using an online tool.

### 1. Using Single Scanner

The simple and easiest way is using Single Scan features only if you want to scan a GET parameter.

For example, if you have a web page such as https://s4e.io/test?id=3 you can write it to URL area and click start scan. Our scanner will start in seconds and check SQL Injection vulnerability for ' id ' parameter.

**2. Advanced Mode**

The Advanced Mode is designed for scenarios requiring greater flexibility and precision when scanning for SQL Injection vulnerabilities. This mode combines automated detection and manual customization, ensuring you can test all input types effectively, even those not accessible directly from a webpage.

Here’s how to make the most of it:

- **Automated Detection for Input Fields**
  Simply provide the URL of your target page, and the scanner will automatically detect and parse form parameters. This feature ensures all potential inputs are included in the testing process without requiring manual selection.
- **Customizable Request Generation**
  For more advanced situations, you can create special requests appropriate to the structure of your application. Click the "Turn on Expert Mode" button to access options such as setting specific HTTP methods, adding custom headers, or defining request bodies. This allows you to test hidden or complex input fields that might otherwise go unchecked.

In the Request List, every request row has a "Scan" button and a "Use Expert Mode" button next to it.

Select the necessary request information you want to check for SQL Injection online.

The Expert Mode form has these fields: HTTP Version (HTTP/1.1 or HTTP/2.0), URL, HTTP Method, Headers and Request Body.

Click "Start scan" button.

Scan may take 10 minutes depending on your web app.

If there is a SQL Injection vulnerability on your page, you will see a report similar to the one below:

### Compact Section

```text
Vulnerable
```

### Detail Section

```text
Your asset is vulnerable, Anyone can exploit this vulnerability danger

Parameter: cat (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: cat=1 AND 7950=7950
Type: error-based
Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: cat=1 AND (SELECT 4756 FROM (SELECT(SLEEP(5)))uPTN)
Type: UNION query
Title: Generic UNION query (NULL) - 11 columns
```

The error-based and UNION payloads are too long for the detail view. They appear in full in the video output below.

### Video Section

```text
k@s4e.io:~$sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1 --method=GET --headers='Server:nginx/1.19.0 Date:Wed,04Dec202411:21:53GMT Content-Type:text/html;charset=UTF-8 Transfer-Encoding:chunked Connection:keep-alive X-Powered-By:PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1 Content-Encoding:gzip' -p cat --risk 3 --level 5 --random-agent --batch --flush-session --dbs
Parameter: cat (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: cat=1 AND 7950=7950
Type: error-based
Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
Payload: cat=1 AND GTID_SUBSET(CONCAT(0x71707a7171,(SELECT (ELT(7946=7946,1))),0x71766b7a71),7946)
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: cat=1 AND (SELECT 4756 FROM (SELECT(SLEEP(5)))uPTN)
Type: UNION query
Title: Generic UNION query (NULL) - 11 columns
Payload: cat=1 UNION ALL SELECT NULL,CONCAT(0x71707a7171,0x45787956416b747a7570625461646b68767144704c765a4f6c5a6f487263466a6a7950487a6a4576,0x71766b7a71),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- -
```

If there is no a SQL Injection vulnerability on your page, you will see a report similar to the one below:

### Compact Section

```text
Not vulnerable
```

### Detail Section

```text
Your asset is not affected by this vulnerability. It's OK
```

### Video Section

```text
k@s4e.io:~$sqlmap -u http://testphp.vulnweb.com/pictures/8.jpg* --method=GET --headers='Server:nginx/1.19.0 Date:Thu,05Dec202415:59:14GMT Content-Type:image/jpeg Content-Length:50299 Last-Modified:Wed,11May201110:27:45GMT Connection:keep-alive ETag:"4dca64a1-c47b" Accept-Ranges:bytes' --risk 3 --level 5 --random-agent --batch --flush-session --dbs
Not vulnerable
```

\* Because of both ethical and legal issues, you must prove that you own the web application by verifying it.
