Eazy To Understand About SQL Injection - SQL injection technique is use a vulnerability at the validation for input form from a website page. the website which is connected to database, sometimes without conscious allow user to access sql query using the website. this vulnerability can use by an prohibited user to access database or damaging your data from database.
usually a website from web programming language like asp, php, html, and others. some programming language like php can otomatically execute data from user input. election a kind of DBMS type must be more careful because there's a possibility or a risk that the database you have choosen give permission to low-privilaged-users for access user password from database so possibility of stealing user account in the table of database.
SQL injection which is use manually method can do with add some comments or special characters at the website. the caracter that added can be like single quote(') or strip(-) with comments like(/*) or double strip(--). result from SQL injection can use form SQL field input. for example:
make a URL request with GET method (or POST):
http://[website address]/login.php?passwd=’ or userid=’ admin’ ;-
if this request have a mistake request, so SQL server will show the error message, error message that is not hidden cause unauthorized users to take advantage from the script to access admin page.
SQL injection can do with write a syntax:
$userid=DB(“select userid from users where password=’$passwd’ and username=$user’”);
then the result of SQL code that given will be like it:
select userid from user where password=’ ’ or userid=’admin’;–‘ and username =’ ’;
moreover, if the result of query code like password 1=1 will always give true:
http://[website address]/login.php?passwd=’ or 1=1;–
this syntax can make attacker through the login form with insert SQL query intruction at form login.php:
select userid from user where password=’ ’ or 1=1;–‘ and username=’ ‘;
in generally, website programmer will save login page at /admin, /admin.asp, /admin/login.asp, /admin-login, dll. predictable storage method can use by user to access admin site. if user get the credential login, then database kan be stolen or changed by user. other. beside that if the SQL syntax can be execute from website, then unauthorized user can change, add, or delete the table or procedure from the database.
sql injetion is not only intended to access database on your server. SQL injection also can used for access the system at the database server. this is possible when SQL server allows execution via database with procedure xp, cmdshell, dan make OS compromise. however SQL injection is depends on the creativity of the attacker. if the attacker can find the right SQL syntax, then so much information can accepted by attacker.
sql injetion is not only intended to access database on your server. SQL injection also can used for access the system at the database server. this is possible when SQL server allows execution via database with procedure xp, cmdshell, dan make OS compromise. however SQL injection is depends on the creativity of the attacker. if the attacker can find the right SQL syntax, then so much information can accepted by attacker.
How to prevent SQL injection:
- validation of user input, should do filtering from input SQL comments and special character (‘;:”)
- give the limit of input box(if possible), by limiting it from the program code. so that input box can be injected with long syntax of intruction.
- deactivate the standard facilities like Procedures, Extended Stored Procedures on SQL queries.
- limiting access database from website. SQL query should not can be accessed from the website.
- deactivate or hidden of error message SQL server on the website.
- monitoring log error message SQL server.
Komentar
Posting Komentar