The SQL injection attacks of recent months
Date : June 04, 2008
They involved the
release of two potential dangers (CERT-IST/DG-2008.003 and CERT-IST/DG-2008.005), a "VulnCoord" (VulnCoord-2008.010) and the hub of crisis management [Infections web].
Principle of SQL
injection attacks
https: / / site-web/dossier? user
name and password = = xxxxx
SELECT * FROM users WHERE user =
'$ user' AND password = '$ password'
If a malicious person
who knows a user named 'Martin', submits the following string in the username
field:
Martin '/ /'
The request is then
processed as the following one:
SELECT * FROM users WHERE user =
'Martin' / /''AND password = '$ password'
Specificity of
attacks in recent months
- they are
built around a database that stores editorial content that the web server uses
to generate dynamic web pages.
-
they have been
developed in a Windows environment (ASP pages, MS-SQL database)
- they are
vulnerable to SQL injection vulnerabilities.
Once the database is
altered, the dynamically generated web pages contain data with the
<script> or <iframe> tags chosen by the hackers. They are therefore
able to exploit any vulnerability (Windows, Internet Explorer,…) on the system
of victims who try to view them.
In the second phase of
the attack, it targets users who consult infected websites.
The vulnerable websites
are not directly targeted, but they are used as attack vectors against victims browsing
them.
Note: SQL injection used in the first phase of the attack exploits vulnerabilities in web applications and not a vulnerability in the software tools used by these applications (IIS, SQL server,…).
These attacks have
surprised by their scale (tens or even hundreds of thousands infected
websites). This is due to two reasons:
- The existence of a malicious tool that
automates these attacks.
The SANS has retrieved such a tool and has analyzed it.
This tool contains a search engine (which can be customized) which uses Google to identify vulnerable web sites. Once vulnerable websites have been identified, this tool performs SQL injection attacks against them and injects malicious tags (also configurable) in webpages.
- A tool of this type has been inserted in
the "Asprox" botnet.
This allows it to infect vulnerable websites in such a way to spread in a second step on the system of victims who visit these sites.
For more
information:
- Microsoft (recent attacks): http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx
- Microsoft (SQL injections): http://msdn.microsoft.com/en-us/library/ms161953.aspx
- SANS: http://isc.sans.org/diary.html?storyid=4294
- Asprox: http://www.secureworks.com/research/threats/danmecasprox/