What type of vulnerability scan would be most likely to detect a SQL injection issue

Snort is an open-source, free and lightweight network intrusion detection system (NIDS) software for Linux and Windows to detect emerging threats. Snort can be used to detect SQL injection attacks.
Identify the correct Snort rule to detect SQL injection attacks.

alert tcp $EXTERNAL_NET any -> 172.16.66.23 443 (msg:""SQL Injection attempt on Finance Dept. webserver""; flow:to_server,estahlished; uricontent:"".pl"";pcre:""/(\%27)|(\')|(\-\-)|(%23)|(#)/i""; classtype:Web-application-attack; sid:9099; rev:5;) rule SQLiTester {

meta: description = ""SQL Injection tester"" author = ""Ellaria Sand"" date = ""2016-04-26"" hash = ""dc098f88157b5cbf3ffc82e6966634bd280421eb"" strings: $s0 = "" SQL Injection tester"" ascii $s17 = ""/Blind SQL injection tool"" fullword ascii $s18 = ""SELECT UNICODE(SUBSTRING((system_user),{0},1))"" fullword wide condition: uint16(0) == 0x5a4d and filesize < 1040KB and all of them }

ule SQLiTester { meta: description = ""SQL Injection tester"" author = ""Ellaria Sand"" date = ""2016-04-26"" hash = ""dc098f88157b5cbf3ffc82e6966634bd280421eb"" strings: $s0 = "" SQL Injection tester"" ascii $s17 = ""/Blind SQL injection tool"" fullword ascii $s18 = ""WAITFOR DELAY '0:0:10' --"" fullword wide condition: uint32(0) == 0x5a4d and filesize < 1040KB and all of them }

alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:""SQL Injection attempt on Finance Dept. webserver""; flow:stateless; ack:0; flags:S; ttl:>220; reference:arachnids,439; classtype:attempted-recon; sid:613; rev:6;)"

Contents

  • Vital information on this issue
  • Scanning For and Finding Vulnerabilities in SQL Injection
  • Penetration Testing (Pentest) for this Vulnerability
  • Security updates on SQL Injection
  • Disclosures related to Vulnerabilities in SQL Injection
  • Confirming the Presence of Vulnerabilities in SQL Injection
  • False positive/negatives
  • Patching/Repairing this vulnerability
  • Exploits related to Vulnerabilities in SQL Injection

Vital Information on SQL Injections

Vulnerabilities in SQL Injection is a high risk vulnerability that is one of the most frequently found on networks around the world. This issue has been around since at least 1990 but has proven either difficult to detect, difficult to resolve or prone to being overlooked entirely.

Vulnerability Name:Vulnerabilities in SQL Injection
Test ID: 602
Risk: High
Category: Server Side Scripts
Type: Attack
Summary: The scripts below are vulnerable to an SQL injection attack. Below is the technical information. Next to each script, there is a description of the type of attack that is possible, and the way to recreate the attack. If the attack is a simple HTTP GET request, you can usually paste it into your browser to see how it works. If it’s a POST attack, the parameters for the POST request will be listed in square parenthesis. 
    • Poorly Filtered Strings
    • Incorrect type handling
    • Signature Evasion
    • Different Encoding
    • White Space multiplicity
    • Arbitrary String Patterns
    • Filtered Bypassing
    • addslash() & magic_quotes_gpc
    • mysql_real_escape_string()
    • Blind SQL Injection
    • MySQL BENCHMARK
    • MSSQL WAITFOR DELAY
              PostgreSQLpg_sleep()

Note that the SQL Injection attack was done without changing anything on the database side. To do this, the test uses an incomplete (or incorrect) SQL statement which will cause the SQL server to return an error. An attacker can then modify the payload to perform an actual attack.

Impact: Since SQL commands are injected from an application form into the database, it is possible in some cases to change the database content or dump the database information (like credit card data or passwords) so that they will be visible to the attacker. SQL injection is mostly known as an attack vector for websites but can be used to attack any type of SQL database. It can also be used to delete data, change data, or allow attackers to bypass a login form without needing to guess the password.
Solution: Use stored procedures to prevent attackers from altering the queries, and filter user input to discard invalid characters such as ‘ 
CVE: CVE-2012-4178
More Information: https://www.exploit-db.com/exploits/20123/
Nist NVD (CVSS): CVE-2012-2574
CVSS Score: 7.5

How to Fix SQL Injection Vulnerabillities

Use of Vulnerability Management tools, like AVDS, are standard practice for the discovery of this vulnerability. The primary failure of VA in finding this vulnerability is related to setting the proper scope and frequency of network scans. It is vital that the broadest range of hosts (active IPs) possible are scanned and that scanning is done frequently. We recommend weekly. Your existing scanning solution or set of test tools should make this not just possible, but easy and affordable. If that is not the case, please consider AVDS.

Penetration Testing (pentest) for SQL Injection

The Vulnerabilities in SQL Injection is prone to false positive reports by most vulnerability assessment solutions. AVDS is alone in using behavior based testing that eliminates this issue. For all other VA tools security consultants will recommend confirmation by direct observation. In any case penetration testing tools for discovery of Vulnerabilities in SQL Injection produces the highest discovery accuracy rate, but the infrequency of this expensive form of testing degrades its value. The ideal would be to have pentesting accuracy and the frequency and scope possibilities of VA solutions, and this is accomplished only by AVDS.

Security Updates on Vulnerabilities in SQL Injection

Given that this is one of the most frequently found vulnerabilities, there is ample information regarding mitigation online and very good reason to get it fixed. Hackers are also aware that this is a frequently found vulnerability and so its discovery and repair is that much more important. It is so well known and common that any network that has it present and unmitigated indicates “low hanging fruit” to attackers.

Confirming the Presence of Vulnerabilities in SQL Injection

AVDS is currently testing for and finding this vulnerability with zero false positives. If your current set of tools is indicating that it is present but you think it is probably a false positive, please contact us for a demonstration of AVDS. 

False positive/negatives

The secret killer of VA solution value is the false positive. There was an industry wide race to find the most vulnerabilities, including Vulnerabilities in SQL Injection ,and this resulted in benefit to poorly written tests that beef up scan reports by adding a high percentage of uncertainty. This may have sold a lot of systems some years ago, but it also stuck almost all VA solutions with deliberately inaccurate reporting that adds time to repairs that no administrator can afford. Beyond Security did not participate in this race to mutually assured destruction of the industry and to this day produces the most accurate and actionable reports available.

Patching/Repairing this Vulnerability

Vulnerabilities in SQL Injection is a high risk vulnerability that is also high frequency and high visibility. This is the most severe combination of security factors that exists and it is extremely important to find it on your network and fix it as soon as possible.

What is the most common SQL vulnerability?

For instance, in the case of a financial application, an attacker can use SQL injection to change account balances. Even worse, attackers can gain administrative rights to an application database. The most common risk of an SQL injection attack is the theft of user data.

How are SQL injection vulnerabilities detected?

Blind SQL injection is used where a result or message can't be seen by the attacker. Instead, the technique relies on detecting either a delay, or a change in the HTTP response, to distinguish between a query resolving to TRUE or FALSE .

Which application can be used to detect SQL injections?

SQLMap is the open source SQL injection tool and most popular among all SQL injection tools available. This tool makes it easy to exploit the SQL injection vulnerability of a web application and take over the database server.

Which type of vulnerability is demonstrated by an SQL injection?

SQL injection (SQLi) is a web security vulnerability that allows an attacker to interfere with the queries that an application makes to its database. It generally allows an attacker to view data that they are not normally able to retrieve.