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.

84 Chapter 2 • Testing for <strong>SQL</strong> <strong>Injection</strong><br />

but it doesn’t include a tool for exploitation as does WebInspect. Table 2.8 shows the injection<br />

strings sent by AppScan during the inference process.<br />

Table 2.8 Signatures Used by AppScan for <strong>SQL</strong> <strong>Injection</strong> Identification<br />

Testing Strings<br />

WF’<strong>SQL</strong>”Probe;A--B ‘ + ‘somechars ‘ ‘ <strong>and</strong><br />

‘barfoo’=’foobar’) --<br />

‘ having 1=1-- somechars’ + ‘ ‘; ‘ <strong>and</strong><br />

‘barfoo’=’foobar<br />

1 having 1=1-- somechars’ || ‘ ) ‘ or ‘foobar’=’foobar’<br />

--<br />

\’ having 1=1-- ‘ || ‘somechars \’ ‘ or ‘foobar’=’foobar’)<br />

--<br />

) having 1=1-- ‘ || ‘ ; ‘ <strong>and</strong><br />

‘foobar’=’foobar<br />

%a5’ having 1=1-- or 7659=7659 \” ‘ <strong>and</strong><br />

‘foobar’=’foobar’) --<br />

|vol <strong>and</strong> 7659=7659 “‘ ‘ exec master..<br />

xp_cmdshell ‘vol’--<br />

‘ | ‘vol <strong>and</strong> 0=7659 “ ‘; select * from dbo.<br />

sysdatabases--<br />

“ | “vol /**/or/**/<br />

7659=7659<br />

||vol<br />

/**/<strong>and</strong>/**/<br />

7659=7659<br />

‘ + ‘‘ + ‘ /**/<strong>and</strong>/**<br />

/0=7659<br />

‘ <strong>and</strong> ‘barfoo’=<br />

’foobar’ --<br />

‘ or ‘foobar’=<br />

’foobar<br />

‘ <strong>and</strong> ‘foobar’=<br />

’foobar’ --<br />

‘; select @@<br />

version,1,1,1--<br />

‘; select * from<br />

master..sysmessages--<br />

‘; select * from<br />

sys.dba_users--<br />

AppScan also provides macro recording functionality to simulate user behavior <strong>and</strong> enter<br />

authentication credentials. The platform supports basic HTTP <strong>and</strong> NTLM authentication as<br />

well as client-side certificates.<br />

AppScan offers a very interesting functionality called a privilege escalation test.<br />

Essentially, you can conduct a test to the same target using different privilege levels—for<br />

example, unauthenticated, read-only, <strong>and</strong> administrator. After that, AppScan will try to access<br />

from a low-privileged account information available only for higher-privileged accounts,<br />

flagging any potential privilege escalation issue.<br />

Figure 2.18 shows a screenshot of AppScan during the scanning process.

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

Saved successfully!

Ooh no, something went wrong!