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.

310 Chapter 6 • Exploiting the Operating System<br />

CREATE OR REPLACE FORCE VIEW "SYS"."ALL_USERS"<br />

("USERNAME", "USER_ID", "CREATED") AS<br />

select u.name, u.user#, u.ctime<br />

from sys.user$ u, sys.ts$ dts, sys.ts$ tts<br />

where u.datats# = dts.ts#<br />

<strong>and</strong> u.tempts# = tts.ts#<br />

<strong>and</strong> u.type# = 1<br />

You can find further information concerning Oracle rootkits at the following Web sites:<br />

■■<br />

■■<br />

www.red-database-security.com/wp/db_rootkits_us.pdf<br />

www.databasesecurity.com/oracle-backdoors.ppt<br />

In 2008, two additional contributing authors of this book, Marco Slaviero <strong>and</strong> Haroon<br />

Meer, showed that newer versions of <strong>SQL</strong> Server now have the native ability to expose<br />

Simple Object Access Protocol (SOAP)-based Web services through http.sys, the same kernel<br />

component that manages Internet Information Server (IIS). This means that an attacker who<br />

has obtained the necessary privileges can create an HTTP listener that is bound to an <strong>SQL</strong><br />

stored procedure. The collection of images in Figure 6.23 walks through the attack. Starting<br />

from the left, we note that /test returns a page on the Web server. The query manager<br />

windows to the right create the ENDPOINT3 endpoint on path /test. The next two frames<br />

show that the /test page has now been “virtually overwritten.”<br />

Figure 6.23 Creating SOAP Endpoints within <strong>SQL</strong> Server

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

Saved successfully!

Ooh no, something went wrong!