Whenever user input is required it can either be in a text box username and password field feedback
field comment fields etc. There is a risk that an injection attack can occur injection flows and particulary
Eskil injections are common in most web applications.
It happens when the attacker puts data or injects data to trick the interpreter into executing unintended
commands.
Thus by modifying changing or even deleting data from the database itself.
This way the attacker will have full control of the back end from just inputting couple of keys from
the front end.
What can be injected.
We can inject as cruel queries which is the most famous type of injection BHP queries held up queries
and operating system queries which will make calls to the operating system functions itself.
Any Web application that relies on the use of an interpreter has the potential to fall victim to this
type of flow.
This is a simple example how an escaped injection attack take place.
Suppose that we have a text books where a user I.D. is required and then a search button.
The usual SPL query behind that is select star from users where user i.e. the equal the text that is
fetched from the text box itself.
Now suppose that instead of a user idea we just put 1 0 5 Col on semicolon DROP TABLE learners.
So what will the squirrel query turn to.
It will be select start from users where user i.e. equal one or fine.
This will be executed and the other query that will be executed is dropped.
Table learners you will delete the learners table.
Another example that you can use is put 1 0 5 or one equal one as you know one equal one is always true.
So the query will turn into select start from users where user i.e. equal 1 or 5 or 1 equal 1.
This query is true so it will return all users know how to protect our self from such kind of injection.
Well we need to design and review our code appropriately.
We need to do input sanitization to make sure that no malicious code hits the back end.
We need to use safe APIs and we always need to run commands in minimal privileges so that the drop table
command that we've seen earlier wouldn't wouldn't be executed if the account being used is a normal
user.