28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

268 Chapter 5 • Blind <strong>SQL</strong> <strong>Injection</strong> Exploitation<br />

˛˛<br />

˛˛<br />

Usually time is used as an inference method on <strong>SQL</strong> Server; Oracle <strong>and</strong> My<strong>SQL</strong><br />

are less reliable <strong>and</strong> the mechanisms are more prone to failure.<br />

Time is inherently unreliable as an inference method, but you can improve that by<br />

increasing the timeouts or with other tricks.<br />

Using Response-Based Techniques<br />

˛˛ You can extract data through a bit-by-bit method or via a binary search method<br />

with response content indicating the value. Typically, existing queries have a clause<br />

inserted that keeps the query as is or returns no results based on the inferred value.<br />

˛˛ Response-Based Techniques can be used with great success on a wide variety of<br />

databases.<br />

˛˛ In some cases, it may be possible to return more than one bit of information<br />

per request.<br />

Using Alternative Channels<br />

˛˛ Out-of-b<strong>and</strong> communication has the advantage that data can be extracted in<br />

chunks rather than in bits, providing a noticeable speed improvement.<br />

˛˛ The most common channel is DNS, where an attacker persuades the database to<br />

perform a name lookup containing a domain name controlled by the attacker <strong>and</strong><br />

prefixed by a piece of data that is to be extracted. When the request arrives at the<br />

DNS name server, the attacker views that data. Other channels are HTTP <strong>and</strong><br />

SMTP.<br />

˛˛ Support for alternative channels is highly database-specific, <strong>and</strong> the number of tools<br />

that support alternative channels is significantly lower than those that support<br />

inference.<br />

Automating Blind <strong>SQL</strong> <strong>Injection</strong> Exploitation<br />

˛˛ Absinthe’s strength is its support for database mapping <strong>and</strong> retrieval through error<strong>and</strong><br />

response-based inference exploits against a number of popular databases, both<br />

commercial <strong>and</strong> open source. The h<strong>and</strong>y GUI is a nice touch, but the lack of<br />

signature support limits its effectiveness.<br />

˛˛ B<strong>SQL</strong> Hacker is another graphical tool that uses both time <strong>and</strong> response-based<br />

inference techniques as well as classic errors to extract items from the database in<br />

question. Although still in beta <strong>and</strong> therefore unstable, the tool has promise <strong>and</strong><br />

provides many opportunities for fiddling.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!