In the previous section, you witnessed the results of an attack on a vulnerable piece of code. It's very evident that if the user input is used without prior validation, and it is concatenated directly into a SQL query, a user can inject different values or code that will be processed and executed by the SQL interpreter in the database. But, what if you don't have access to the source code? This is the most likely scenario in penetration testing; so, how do you identify such a flaw?
The answer is by trying out simple injection strings and analyzing the server's response. Let's look at a simple example using Damn Vulnerable Web Application (DVWA). In the SQL Injection section, if you input any number in the ...