SQL injection (SQLi) refers to an injection attack wherein an attacker can execute malicious SQL statements that control a web application's database server.
Impact
An attacker can use SQL injection to bypass a web application's authentication and authorization mechanisms and retrieve the contents of an entire database. SQLi can also be used to add, modify and delete records in a database, affecting data integrity. Under the right circumstances, SQLi can also be used by an attacker to execute OS commands, which may then be used to escalate an attack even further.
Remediation
Use parameterized queries when dealing with SQL queries that contain user input. Parameterized queries allow the database to understand which parts of the SQL query should be considered as user input, therefore solving SQL injection.
Affects
http://testphp.vulnweb.com/search.phpAttack Details
URL encoded GET input test was set to 1549782'"267538Proof of Exploit (AcuSensor)
Source file: /hj/var/www//search.php line: 60Additional details:
HTTP Request
POST /search.php?test=1549782'"267538 HTTP/1.1 Acunetix-Aspect: enabled Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c Acunetix-Aspect-ScanID: 11333651004215223499 Content-Type: application/x-www-form-urlencoded Referer: http://testphp.vulnweb.com/ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate Content-Length: 25 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4512.0 Safari/537.36 Host: testphp.vulnweb.com Connection: Keep-alive goButton=go&searchFor=theVulnerability Description
SQL injection (SQLi) refers to an injection attack wherein an attacker can execute malicious SQL statements that control a web application's database server.Impact
An attacker can use SQL injection to bypass a web application's authentication and authorization mechanisms and retrieve the contents of an entire database. SQLi can also be used to add, modify and delete records in a database, affecting data integrity. Under the right circumstances, SQLi can also be used by an attacker to execute OS commands, which may then be used to escalate an attack even further.Remediation
Use parameterized queries when dealing with SQL queries that contain user input. Parameterized queries allow the database to understand which parts of the SQL query should be considered as user input, therefore solving SQL injection.References:
SQL Injection (SQLi) - AcunetixTypes of SQL Injection (SQLi) - Acunetix
Prevent SQL injection vulnerabilities in PHP applications and fix them - Acunetix
SQL Injection - OWASP
Bobby Tables: A guide to preventing SQL injection
SQL Injection Cheet Sheets - Pentestmonkey