You are on page 1of 10

TUGAS ARTICLE

BAHASA INGGRIS

Dosen Pembibing : Mrs. Yusniarsi Primasari

Oleh

Kelompok 1

Nur Roqim
Lucky Ardiansyah
Heri Santoso

UNIVERSITAS ISLAM BALITAR


FACULTAS INFORMATIKA
September 2017
SQL Injection

Introduction

Structured Query Language (SQL) is used to query, operate, and administer database systems
such as Microsoft SQL Server, Oracle, or MySQL. The general use of SQL is consistent
across all database systems that support it; however, there are intricacies that are particular to
each system.

Database systems are commonly used to provide backend functionality to many types of web
applications. In support of web applications, user-supplied data is often used to dynamically
build SQL statements that interact directly with a database. A SQL injection attack is an
attack that is aimed at subverting the original intent of the application by submitting attacker-
supplied SQL statements directly to the backend database. Depending on the web application,
and how it processes the attacker-supplied data prior to building a SQL statement, a
successful SQL injection attack can have far-reaching implications. The possible security
ramifications range from authentication bypass to information disclosure to enabling the
distribution of malicious code to application users.

SQL Injection Explained

A SQL injection attack involves the alteration of SQL statements that are used within a web
application through the use of attacker-supplied data. Insufficient input validation and
improper construction of SQL statements in web applications can expose them to SQL
injection attacks. SQL injection is such a prevalent and potentially destructive attack that
the Open Web Application Security Project (OWASP) lists it as the number one threat to web
applications.

Ramifications of Successful SQL Injection Attacks

Although the effects of a successful SQL injection attack vary based on the targeted
application and how that application processes user-supplied data, SQL injection can
generally be used to perform the following types of attacks:

 Authentication Bypass: This attack allows an attacker to log on to an application,


potentially with administrative privileges, without supplying a valid username and
password.
 Information Disclosure: This attack allows an attacker to obtain, either directly or
indirectly, sensitive information in a database.
 Compromised Data Integrity: This attack involves the alteration of the contents of a
database. An attacker could use this attack to deface a web page or more likely to insert
malicious content into otherwise innocuous web pages. This technique has been
demonstrated via the attacks that are described in Mass exploits with SQL Injection at
the SANS Internet Storm Center.
 Compromised Availability of Data: This attack allows an attacker to delete
information with the intent to cause harm or delete log or audit information in a
database.
 Remote Command Execution: Performing command execution through a database
can allow an attacker to compromise the host operating system. These attacks often
leverage an existing, predefined stored procedure for host operating system command
execution. The most recognized variety of this attack uses the xp_cmdshell stored
procedure that is common to Microsoft SQL Server installations or leverages the ability
to create an external procedure call on Oracle databases.
An Example of SQL Injection for Authentication Bypass

One of the many possible uses for SQL injection involves bypassing an application login
process. The following example illustrates the general operation of a SQL injection attack.
The following HTML form solicits login information from an application user. Although this
example uses an HTTP POST request, an attacker could also use HTML forms that use the
HTTP GET method.
<form action="/cgi-bin/login" method=post>
Username: <input type=text name=username>
Password: <input type=password name=password>
<input type=submit value=Login>

When a user enters his or her information into this form and clicks Login, the browser
submits a string to the web server that contains the user's credentials. This string appears in
the body of the HTTP or HTTPS POST request as:
username=submittedUser&password=submittedPassword

An application with a vulnerable login process may accept the submitted information and use
it as part of the following SQL statement, which locates a user profile that contains the
submitted username and password:
select * from Users where (username = 'submittedUser' and password =
'submittedPassword');
Unless an application uses strict input validation, it may be vulnerable to a SQL injection
attack. For example, if an application accepts and processes user-supplied data without any
validation, an attacker could submit a maliciously crafted username and password. Consider
the following string sent by an attacker:
username=admin%27%29+--+&password=+

Once this string is received and URL-decoded, the application will attempt to build a SQL
statement using a username of admin') -- and a password that consists of a single space.
Placing these items into the previous SQL statement yields:
select * from Users where (username = 'admin') -- and password = ' ');

As the previous example demonstrates, the attacker-crafted username changes the logic of the
SQL statement to effectively remove the password check. In the above example, an attacker
could successfully log in to the application using the admin account without knowledge of the
password to that account.

The string of two dash characters (--) that appears in the crafted input is very important; it
indicates to the database server that the remaining characters in the SQL statement are a
comment and should be ignored. This capability is one of the most important tools that is
available to an attacker and without it, it would be difficult to ensure that the malicious SQL
statements were syntactically correct.

Although the crafted field, which is the username field in the previous example, must be
tailored to the vulnerable application, a large set of documented strings that are readily
available on the Internet have proven successful at enabling SQL injection attacks. The
previous example may be simplistic, but it illustrates the effectiveness of SQL injection
attack techniques.

Blind and Second Order SQL Injection

In situations where data from a backend SQL database is not returned directly to the user or
attacker, it may be necessary for an attacker to use the Blind SQL Injection technique. With
this technique, an attacker can determine whether a SQL statement was executed using means
other than the direct presentation of data. Using Blind SQL Injection, an attacker could
perform reconnaissance, obtain sensitive information, or alter database contents, including
authentication credentials.
One example of the Blind SQL Injection technique is the introduction of a delay as part of a
malicious SQL statement. Depending on the database software in use, an attacker could build
a SQL statement that is designed to cause a database server to perform a time-consuming
action. With the MySQL database software, it may be possible to craft a SQL statement using
thesleep() function. For example, incorporating sleep(10) into a malicious query will create a
10-second delay. An attacker could induce a recognizable delay on database servers that do
not contain the sleep() function by executing an operating system command or time-
consuming sub-query or attempting to establish an outbound HTTP connection. Should the
time-consuming SQL statement be executed, the web application may take noticeably longer
to respond than is typical. This method allows attackers to determine whether their SQL
statements are being executed with some level of certainty.

Second Order SQL Injection attacks involve user-submitted data that is first stored in the
database, then retrieved and used as part of a vulnerable SQL statement. This class of
vulnerability is more difficult to locate and exploit, but Second Order SQL Injection attacks
justify data validation prior to the execution of all SQL statements in an application, as well
as the comprehensive use of parameterized queries.

Referrer : https://www.cisco.com/c/en/us/about/security-center/sql-injection.html
Question

1. What is SQL Injection ?

2. How many type is there of SQL Injection ?

3. What is the effect of successful SQL Injection ?


Answer

1. A SQL injection attack involves the alteration of SQL statements that are used within

a web application through the use of attacker supplied data.

2. Blind SQL Injection and second order SQL Injection

3. Authentic bypass, information disclosure compromise data integrity


Kata Sulit

1. there are intricacies 18. Innocuous

2. particular 19. Exploits

3. statements 20. Variety

4. at subverting the original intent 21. Bypassing

5. ramifications range 22. Vulnerable

6. disclosure 23. Strict

7. malicious 24. Effectively

8. Insufficient 25. Crafted

9. Validation 26. Syntactically

10. Improper 27. Previous

11. Potentially 28. must be tailored to the vulnerable

12. Privileges application

13. Disclosure 29. simplistic

14. Obtain 30. effectiveness

15. Either 31. necessary

16. Indirectly 32. determine

17. Compromised
Kata Sulit

1. ada seluk-belukparticular 18. Tidak berbahaya

2. khusus 19. Eksploitasi

3. pernyataan 20. Ragam

4. saat menumbangkan niat asli 21. Melewati

5. rentang ramifications 22. Rentan

6. pengungkapan 23. Ketat

7. berbahaya 24. Efektif

8. Tidak mencukupi 25. Dibuat

9. Validasi 26. Syntactically

10. tidak pantas 27. Sebelumnya

11. Berpotensi 28. harus disesuaikan dengan aplikasi

12. Hak Istimewa yang rentan

13. Pengungkapan 29. sederhana

14. Dapatkan 30. efektivitas

15. Entah 31. perlu

16. Secara tidak langsung 32. Menentukan

17. Kompromi

You might also like