SQL Injections

S.L.
cybernoob
Published in
2 min readFeb 7, 2021

--

What is SQL injection?
It is an attack method on data-driven apps or software via webpage input. A SQL statement is entered into the entry field to attempt the malicious activity. The code input allows additional access to read, modify, and delete data such as unauthorized data access or data manipulation. Both can be damaging to the organization depending on the type of data is available.

https://www.veracode.com/blog/intro-appsec/sql-injection-attacks-and-how-prevent-them-infographic

Why is it performed and what is stolen?
Attackers targeted you as the victim. It can be for many reasons such as stealing your intellectual property, damage your reputation, bring down your organization, or simply just for fun depending on the type of black hat hackers. Depending on their reasoning. Specific data such as usernames can be stolen then a privileged escalation can be performed. If bank data is accessed, money can be stolen. It can alter balances, void transactions, or transfer more money into their accounts.

How is it performed?
There are many ways but here is a simple explanation from W3schools.com. For example. It usually happens during a user input like username and password. In the background, it runs a SQL statement on the user database to see if the input of username and password as the example below. However, there is nothing to prevent code injections.

W3school

The SQL code valid and will return “ALL” rows from the “Users” table, since OR 1=1 is always “TRUE”. Now after getting the user tables. Attackers can see or try which users might have additional access to other areas of the network if they did reconnaissance against servers and networks.

W3school

How to prevent it?
There needs to be input validations and also enforcing least privilege.

Note: Not an expert. If anything is incorrect or unclear. Will fix upon notifcation.

https://www.w3schools.com/sql/sql_injection.asp

--

--