SQL Injection is a technique that utilizes blemish h security are contained in the database an application .
Attacks that can be done by utilizing the column input on the web or by manipulating url that use methods get in shipment data . The get method isnot suitable for sending Data a form that contains the data that is important , because all of the input that already we enter into the web that will be visible in the url . Then of the method of delivery of post is more advisable to transmit data that is sensitive .
In essentially SQL Injection can penetrate the database when the form input is not filtered character of what course that may be in the insert by the user, so it can be in minimized the occurrence of SQL Injection. The database itself is the thing that is most important in a development website, if already penetrating then the data of customers and products that exist in the database it will leak and can only be used by people who do not take responsibility .
There are several goals for people who do SQL Injection including :
- Bypass Authentication
Attack This allows the attacker to sign in to the app with the right of access to administrative , without using the username and password are valid.
- Information Theft
Attack This allows the attacker to acquire , either by direct or not direct the information is sensitive in the database.
- Compromised Data Integrity
Attacks of this involves a change in the contents of the database, an attacker could use the attack is to deface page web or insert the content harmful to the page web.
- Compromised Data Availability
This attack allows the attacker to delete information with the intent to damage or delete the log or audit information in the database.
- Remote Command Execution
Doing command execution via the database which allows an attacker to perform compromise on system operation host or a target.
Minimize SQL Injection
To minimize the attack SQL injection, there are several actions y ang can you do , namely :
1. Using Parameterized Queries
Using parameterized queries or prepared statement is a way that is simple and easy to do . Parameterized will define all SQL code before sending it to the query layer .
The database will be able to recognize which input is entered by the user , whether it belongs to the category of SQL code or user data . With that , the attacker will not be able to change the contents of the query, although have to enter a code SQL when doing input.
2. Doing Validation Input User
Perform validation of input the user to prevent the occurrence of SQL injection. If you filter all the input made by users , such as type , length , format and so on . By so , simply input the pass vaidasi which is processed by the database.
3. Provide Limitation of Access Rights
Providing limitation the right access to limit the damage that occurs due to SQL injection. Do not occasionally you log into the database using admin access as root. However , you can use the access privilege that has been determined to limit the space the scope of the system.
4. Hiding Error Messages
Usually , there are error messages that appear from the database when the user makes an incorrect input . To avoid the occurrence of SQL injection is , you are asked to hide or even turn off the message error so that the user does not continue mempelaari architecture of the database used.
Therefore , can only users that an attacker system you . If you want to display the message , then display a message that states that should users contact support technical to overcome problems such.
5. Provide Database Encryption
You can store data that is credential is separate to make it difficult for attackers to perform SQL injection, even you can provide encryption to better safeguard the data are.
6. Locking the Database
Preferably , SQL queries can not be accessed through user pages (websites). You can leave a restriction that not all users can perform access to a table specific , namely to lock the table which is very vital.
Type SQL Injection
Having previously we know what it is SQL Injection, so now we know the type – the type of attack SQL Injection is performed in injecting url in them :
– Classical SQL Injection
Classical SQL Injection is a way that is most often done by using the methods of the UNION in combining the two queries to display the information critical of the database. Before you perform the injection using the UNION, the attacker already had to understand how the query will be executed to get information that is important in it . an attacker could insert malicious charater like single quote tag, double minus and forth to produce a message error, where the message of error that will be used to exploit the web such .
– Blind SQL Injection
Blind SQL Injection is often referred also to the true / false , namely when the injection is done successfully , but does not display the message error to the attacker, but go back to the page it themselves or display the majority , the entire content and does not display the content of any of the web. Mechanical This requires a time that is long due to guess the information that is contained in the database and the response from the request in the form of true / false. if the url being manipulated produces true value , it will display the content but if the url being manipulated produces a false value , it will not process requests from the attacker.
- Double Blind SQL Injection / Time- based
Injection of the url failed to use the technique of blind sql injection, does not close the possibility of a web that has a gap against sql injection. The Injection is likely to be successful but can be handled in the database so that when the injection is done successfully , but the results can not be seen in the application and are not visible to the attacker. Double blind sql injection technique is a combination of blind sql injection / classical sql injection with a time delay . if url that is coupled with the time delay will result in the order in accordance with the request that requested , then the application web proficiency level can be in injection using attack sql injection.