An attacker enters a long nasty looking string into the date field. The input overwrites parts of the running program and executes commands on the server. What type of attack just took place?
SQL Injection attack
Buffer Overflow attack
Cross Site Scripting attack
The correct answer is 2) Buffer Overflow attack
In a SQL Injection attack, an attacker inputs specially crafted value in an input field that the application uses to construct a dynamic query to the database. This results in the query getting manipulated and more information being revealed to the attacker. We discuss the basics of SQL injection in the Learning Center. In Jun we analyzed how they affect stored procedures too, in the pages of Palisade.
In a buffer overflow attack, the input takes more space than allocated for the variable. It overflows the allocated buffer and overwrites adjacent memory locations. When the input is carefully crafted, it lets the attacker run commands of his choice. Here's one such input, courtesy the Metasploit project. It executes the command: