🌐
OWASP Foundation
owasp.org › www-project-web-security-testing-guide › latest › 4-Web_Application_Security_Testing › 07-Input_Validation_Testing › 05-Testing_for_SQL_Injection
Testing for SQL Injection
This website uses cookies to analyze ... ... SQL injection testing checks if it is possible to inject data into an application/site so that it executes a user-controlled SQL query in the database....
🌐
W3Schools
w3schools.com › sql › sql_injection.asp
SQL Injection
SQL injection is a code injection technique that can destroy your database.
Discussions

Tools for checking SQL Injection Vulnerability
There are some scanning tools you can use such as sqlmap (free) and Burpsuite Pro (paid, but not too expensive). However, using these against a system without knowing what you are doing is dangerous and can trash the database. They'll also miss lots of issues, and sometimes return false positive as well. Doing proper security testing for a web application is not a simple job. Depending on the size and complexity it could easily be a week's worth of work for an experienced professional. Without wishing to be rude, if you're having to ask this question here then you are not qualified to carry out this kind of testing, and are likely to both miss things and break things if you try. If you do some scanning of your own and conclude its safe, and then they get hacked as soon as they put it online, that's going to come back and bite you hard. I'd strongly recommend either hiring a professional pentesting company, or putting it behind a VPN as others are suggesting. Or ideally both. More on reddit.com
🌐 r/msp
6
5
May 25, 2020
[ Removed by moderator ]
We're aware, this is not news to anyone so why are using the NEWS flair to promote your no follower YouTube channel? More on reddit.com
🌐 r/cybersecurity
2
0
2 weeks ago
php - How to test my website for basic sql injection vulnerabilities? - Stack Overflow
I'm creating a basic website with a login screen for a project and I want to test it for some basic sql injection vulnerabilities. I'm using a form to read a username and a password from a user and... More on stackoverflow.com
🌐 stackoverflow.com
How do I test for SQL injection vulnerabilities on a site with input fields? - Information Security Stack Exchange
What methods are available for testing SQL injection vulnerabilities? More on security.stackexchange.com
🌐 security.stackexchange.com
April 25, 2012
People also ask

What is SQL injection?
A Structured Query Language injection (SQLi) is a type of attack in which attackers attempt to exploit vulnerabilities in an application's code by inserting an SQL query into regular input or form fields, such as a username or password. The SQL statement is then passed to the application's underlying SQL database.
🌐
fortinet.com
fortinet.com › resources › cyberglossary › sql-injection
What is SQL Injection? How to Prevent SQL Injection? | Fortinet
Is SQL injection illegal?
For the most part, SQL injection is illegal, although this depends on jurisdictional boundaries.
🌐
fortinet.com
fortinet.com › resources › cyberglossary › sql-injection
What is SQL Injection? How to Prevent SQL Injection? | Fortinet
Does SQL injection still work?
Yes, SQL injection is still very much a cybersecurity threat, especially for older applications that have not been updated.
🌐
fortinet.com
fortinet.com › resources › cyberglossary › sql-injection
What is SQL Injection? How to Prevent SQL Injection? | Fortinet
🌐
PortSwigger
portswigger.net › web-security › sql-injection
What is SQL Injection? Tutorial & Examples | Web Security Academy
You can detect SQL injection manually using a systematic set of tests against every entry point in the application.
🌐
Cloudflare
cloudflare.com › learning › security › threats › sql-injection
What Is SQL Injection?
SQL injection example form field · Where normally the query would search the database table for the matching ID, it now looks for an ID or tests to see if 1 is equal to 1. As you might expect, the statement is always true for every student in the column, and as a result, the database will return all data from the students table back to the attacker making the query.
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › relational-databases › security › sql-injection
SQL Injection - SQL Server | Microsoft Learn
Learn how SQL injection attacks work. Mitigate such attacks by validating input and reviewing code for SQL injection in SQL Server.
🌐
Reddit
reddit.com › r/msp › tools for checking sql injection vulnerability
r/msp on Reddit: Tools for checking SQL Injection Vulnerability
May 25, 2020 -

Have a new client with a SQL DB application from a vendor and app I'm not familiar with. The application has a web interface and my client would like it internet accessible for his staff to use. Right now it's LAN-side only.

Before I do that I wanted to check the server security settings. I have some tools that look for web vulnerabilities and general server security, but I also wanted to explicitly check this for SQL injection vulnerability. Was hoping there was some tools that can be used that can do this.

Can anyone point me in the right direction?

Find elsewhere
🌐
Hackviser
hackviser.com › sql injection
SQL Injection Attack Guide | Hackviser
Learn how to test and exploit SQL injection vulnerabilities including detection, attack methods and post-exploitation techniques.
🌐
TryHackMe
tryhackme.com › room › sqlilab
SQL Injection Lab
You need to enable JavaScript to run this app
🌐
Reddit
reddit.com › r/cybersecurity › [ removed by moderator ]
SQL injection changed the web. Prompt ...
2 weeks ago - 1.4M subscribers in the cybersecurity community. This subreddit is for discussing cybersecurity topics, research, and emergent threats/findings.
🌐
IEEE Xplore
ieeexplore.ieee.org › document › 8169902
Testing techniques and analysis of SQL injection attacks | IEEE Conference Publication | IEEE Xplore
To overcome the SQL injection problems, there is a need to use different security systems. In this paper, we will use 3 different scenarios for testing security systems. Using Penetration testing technique, we will try to find out which is the best solution for protecting sensitive data within ...
🌐
Kinsta®
kinsta.com › home › resource center › blog › wordpress development › sql injection: a detailed guide for wordpress users
SQL Injection: A Detailed Guide for WordPress Users - Kinsta®
March 19, 2026 - To mitigate the vulnerability of SQL Injection in your WordPress theme or plugin, the single rule that you must follow is to always use existing WordPress functions when interacting with the database. These functions are thoroughly tested for SQL injection vulnerabilities during the WordPress ...
🌐
W3Schools
w3schools.com › sql › sql_prepared_statements.asp
SQL Prepared Statements
SQL prepared statements can be used to protect a web site from SQL injections.
🌐
Stack Overflow
stackoverflow.com › questions › 41637545 › how-to-test-my-website-for-basic-sql-injection-vulnerabilities
php - How to test my website for basic sql injection vulnerabilities? - Stack Overflow
if(isset($_POST['username'])&&$_POST['username']!=""&&isset($_POST['pass'] )&&$_POST['pass']!=""){ $sql="SELECT username,pass,email,name,surname,ADT,tel,address,bdate,gender FROM myusers WHERE username='".$_POST['username']."' AND pass='".$_POST['pass']."'";} Thanks in advance for your help. If you need any additional info about my code, please ask. ... I can tell you that your code is vulnerable right away, without any tests.
🌐
Pentest-Tools.com
pentest-tools.com › home
Breaking down the 5 most common SQL injection attacks | Pentest-Tools.com Blog
I’ll go through these 7 hands-on techniques you can use to exploit SQL injections in web applications in your ethical hacking engagements. ... DVWA (an open-source web app) to test payloads and give practical SQL injection examples.
Top answer
1 of 3
54

There are a number of ways of testing an application for vulnerabilities such as SQL Injection. The tests break down into three different methodologies:

Blind Injection:

MySQL example:

http://localhost/test.php?id=sleep(30)

If this SQL statement is interpreted by the database then it will take 30 seconds for the page to load.

Error Messages:

http://localhost/test.php?id='"

If error reporting is enabled and this request is vulnerable to sql injection then the following error will be produced:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"' at line 5

Tautology Based Injection:

http://localhost/test.php?username=' or 1=1 /*&password=1

In this case supplying a Tautology, or a statement that is always true provides a predictable result. In this case the predictable result would be logging in the attacker with the first user in the database, which is commonly the administrator.

There are tools that automate the use of the methods above to detect SQL Injection in a web application. There are free and open source tools such as Wapiti and Skipfish that do this. Sitewatch provides a free service that is a lot better than these open source tools. I can say that because I am a developer for Sitewatch.

2 of 3
13

Its best to not test your site for SQL injection. Its best to just avoid the potential SQL injection. Never forming SQL queries by doing string processing yourself when there's user input. Use bound parameters in all queries (also sanitize all user data if it could be used in any harmful way and put sensible limits on queries). That is the query sql_execute("select user from user_db where id="+input_id) is unsafe (imagine if its input_id = "1 OR 1==1 --"), but stored_procedure = "select user from user_db where id = ? LIMIT 1;", sql_execute_with_param(stored_procedure, input_id); is safe.

Obviously, this is only if you are trying to make your own site safe. If you are trying to find flaws in other applications its another story, and potentially against the FAQ which states this site is not for black hats. But OWASP has a very good article on testing for SQL injection.

🌐
Medium
asafsahar25.medium.com › testing-for-sql-injection-vulnerabilities-using-owasp-zap-62488b5805f0
Testing For SQL Injection Vulnerabilities using OWASP ZAP | by Assaf Sahar | Medium
June 16, 2023 - In this blog post, I will explain SQL Injection (SQLi) and how to test for it using the OWASP ZAP tool. OWASP ZAP is one of the leading tools for testing web security vulnerabilities.
🌐
SentinelOne
sentinelone.com › cybersecurity-101 › cybersecurity › types-of-sql-injection
7 Types of SQL Injection Attacks & How to Prevent Them?
October 2, 2025 - Track page behavior: Monitor your ... that you did not request. Test: Conduct security tests, such as penetration testing, on your application to understand if it has SQLi vulnerabilities....
🌐
Intruder
intruder.io › product › sql-injection-scanner
SQL Injection Scanner Online | Get started for free
Scan for SQL injection vulnerabilities with ease. Intruder is simple to understand and always on so you can fix vulnerabilities faster. Try it for free with a 14 day free trial.
Top answer
1 of 6
24

SQL injection is the attempt to issue SQL commands to a database through a website interface, to gain other information. Namely, this information is stored database information such as usernames and passwords.

First rule of securing any script or page that attaches to a database instance is Do not trust user input.

Your example is attempting to end a misquoted string in an SQL statement. To understand this, you first need to understand SQL statements. In your example of adding a ' to a paramater, your 'injection' is hoping for the following type of statement:

SELECT username,password FROM users WHERE username='$username'

By appending a ' to that statement, you could then add additional SQL paramaters or queries.: ' OR username --

SELECT username,password FROM users WHERE username='' OR username -- '$username

That is an injection (one type of; Query Reshaping). The user input becomes an injected statement into the pre-written SQL statement.

Generally there are three types of SQL injection methods:

  • Query Reshaping or redirection (above)
  • Error message based (No such user/password)
  • Blind Injections

Read up on SQL Injection, How to test for vulnerabilities, understanding and overcoming SQL injection, and this question (and related ones) on StackOverflow about avoiding injections.

Edit:

As far as TESTING your site for SQL injection, understand it gets A LOT more complex than just 'append a symbol'. If your site is critical, and you (or your company) can afford it, hire a professional pen tester. Failing that, this great exaxmple/proof can show you some common techniques one might use to perform an injection test. There is also SQLMap which can automate some tests for SQL Injection and database take over scenarios.

2 of 6
7

SQL Injection can be done on any input the user can influence that isn't properly escaped before used in a query.

One example would be a get variable like this:

http//www.example.com/user.php?userid=5

Now, if the accompanying PHP code goes something like this:

$query = "SELECT username, password FROM users WHERE userid=" . $_GET['userid'];
// ...

You can easily use SQL injection here too:

http//www.example.com/user.php?userid=5 AND 1=2 UNION SELECT password,username FROM users WHERE usertype='admin'

(of course, the spaces will have to be replaced by %20, but this is more readable. Additionally, this is just an example making some more assumptions, but the idea should be clear.)