What is SQL injection?
Jon Luke Harvey Nov 29 Updated on Nov 30, 2018
SQLI: Short for SQL injection.
DBMS: Short for databse management system.
Hello everyone! This is my first post so any constructive criticism would be nice! Since I have been learning about Web application hacking and a lot of people on this website are web developers, I hope to make posts on common website vulnerabilities and how to protect your self against them so you don't fall for these!
First: What is SQL injection?
According to OWASP(Open web application security project) SQL Injection is:
"A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application"(https://www.owasp.org/index.php/SQL_Injection)
What does this mean? In simple terms this is an injection(meaning typing in commands or queries) into a field with SQL code that allows the manipulation of the websites database.
So what does it do exactly?
A SQL injection can be dangerous if your website is vulnerable to it and here's some reasons why. If successful a SQL injection can:
- Exploit and read sensitive data from the database. A SQL injection if done correctly, can read sensitive data from a DB so something such as phone numbers, addresses, and even passwords (and usually the SQL command would gather ALL of these. So, ALL passwords, ALL addresses, etc. even the admin!!!)
- Another thing it has the potential to be able to mess with the actual data. This is pretty straight forward but basically it would be able to insert/update/delete. (NOTE: This can happen unintentionally if a hacker isn't aware of what they are doing. They could input a SQL injection command and not be familiar with the DB and potentially delete specific data or all of it! Same goes for insert or update. Another reason why you should protect yourself against SQLI!)
- Mess with the DBMS. A SQLI can also mess with the DBMS. It has the potential to activate administrative commands(such as shut down DBMS), it can also do things like recover files from the DBMS and even can issue commands to the OS.
It is important that you protect your website when just starting out and creating it from SQL injection! (And even if you're google or facebook!) In the next couple of posts I will be posting on what the code looks like and how to protect yourself. I certainly hope this was informing for you and again, any feedback would be nice! :)
Links: OWASP Article on SQLI
Explanation from youtube on SQLI