Re: Which SQL is that? SQL Injection question

From: Daniele Bellucci (daniele.bellucci@gmail.com)
Date: Mon Jul 17 2006 - 18:01:31 EDT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> 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

looks like target webapp, doesn't require a result set greater than 1 record

> but
>
> ' and 'a'='a
>
> does.

Yes, this is because the above injection string will result only one
record!

> '+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.

be aware , INFORMATION_SCHEMA is not available in MySQL lesser than v.5!

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

...and not postgres

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

[see below]

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

concat is ONLY available in mysql! Postgres, Oracle, M$ SQL Serve
they all have different function for strings concats.

Other DBMS uses different function to concatenatre strings ..
that's why IMHO target DBMS is MySql!

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

because in MySQL: select concat('a','a') returns 'aa'

Hope these helps ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEvAi609kcuJoOgZARAglnAJ4l2d7bt+xrknO7KkAWL21SxEluaQCeNvKn
KMFFpdU+20mxaRdOZ+99iJY=
=AbdA
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
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:19 EDT