However an exercise I do not manage to resolve, I have to bypass a check of extension of a form in PHP.
It turns out that just the extension is verified, but certain special characters are replaced what makes that even by trying the following combinations, it does not work.
test.php%00.png test.php:.png test.php$.png
I specify, these names of files bypass well and truly the check of files. But as this one is then renamed, he returns to the state of PNG.
For example, with one of the examples higher, the file is going to be renamed as follows:
The purpose is relatively simple... I am supposed to send on the server a executable file PHP. But I have to admit that I do not find. I have a part of sources to use, here is :
This line clearly indicates that any characters other than letters, numbers and points will be replaced by a dash.
$name_file = preg_replace('/([^.a-z0-9]+)/i', '-', $name_file);
As it is an exercise, there is necessarily a way to exploit it. But I do not find..