Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Pen-Test
[Top] [All Lists]

SQLInjecting DB2

Subject: SQLInjecting DB2
Date: Wed, 16 Feb 2005 19:51:35 +0000
Hi, I'm currently testing a Websphere/DB2 Web Application of one of our clients.
I've found that it is vulnerable to SQL Injection.
I 've also discovered that there is a table named SYSTABLES with a NAME column in it.


Using the "GROUP by 1--" trick I've discovered two columns in the table over which the query is being executed.
After doing "GROUP by A, B--", I get no more errors, so I asume that only these two columns are taking part on the query..(is that ok?)


Column A is probaby CLOB or VARCHAR and B probably and INTEGER. (any whay to confirm this?)

I can say this because I've tried this query: ' AND A=CLOB('A')--
and it returns no error
when this one: ' AND A=BIGINT(132123)--
returns error on type comparison

So then I proceeded to do a: ' UNION ALL SELECT 1 FROM SYSTABLES--
Then I get "Error 500: java.sql.SQLException: [SQL0415] Operandos UNION no compatibles."


I suppose that the column types are different.

Anyway, I submit this query: ' UNION ALL SELECT 1,1 FROM SYSTABLES--
Then I get "Error 500: java.sql.SQLException: [SQL0421] Número de operandos UNION no igual."
Meaning that the number of columns are not equal...


Here are my questions:
1). Is there any way to get the "original" table name (the one where the original query executes)?
2). I've done a script that checks for different column numbers and it have already tested with about 200 columns, and it keep saying that number of operands is not equal. What could be happening?


Any ideas would be greatly appreciated!!

Thanks, Andy

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349


<Prev in Thread] Current Thread [Next in Thread>