Current location - Education and Training Encyclopedia - Graduation thesis - RulingSite-S system leads to random access to many university databases in Taiwan Province Province, China.
RulingSite-S system leads to random access to many university databases in Taiwan Province Province, China.
There is no technical content, very simple arbitrary file download vulnerability, source file decoding is as follows:

& lt? Server-side programming language (abbreviation of professional hypertext preprocessor)

include(" init . Inc . PHP ");

get _ referer(false);

If (empty( $_GET[' file name']) || empty( $_GET[' title']) ||| empty ($ _ get ['directory']))

{

Error_display( t_ ("Missing file download parameters");

} www.2cto.com

$ file _ name = $ _ GET[' filename '];

$file_download = uploadpath()。 "/".$_GET['dir']。 "/".$ file _ name

$ file _ extension = get _ file _ extension($ file _ name);

if(strpos($ _ SERVER[' HTTP _ USER _ AGENT ']," MSIE "))

{

$ file _ save = ut F8 tobig 5($ _ GET[' title '])。 "."。 $ file _ extension

}

other

{

$file_save = $_GET['title']。 "."。 $ file _ extension

}

$ file _ save = ereg _ replace("[\ \/:*? \ " & lt& gt|]"," _ ",$ file _ save);

if ( $file_extension == "php ")

{

Exit ("& ltstrong & gt cannot be used". $file_extension。 "file! & lt/strong >; );

}

$ mime type = get _ file _ mime type($ file _ name);

if(strpos($ _ SERVER[' HTTP _ USER _ AGENT ']," MSIE 5 ")| | strpos($ _ SERVER[' HTTP _ USER _ AGENT ']," Opera 7)))

{

$ mime type = " application/x-download ";

}

ob _ end _ clean();

header(" Pragma:public ");

header(" Expires:0 ");

header(" Cache-Control:must-revalidate,post-check=0,pre-check = 0 ");

header(" Cache-Control:public ");

Header ("Content-Description: File Transfer");

Title ("Content Type:". $ mime type);

Header ("Content-Disposal: Attachment; File name = ". $ file _ save);

Header ("content-transmission-encoding: binary");

header( "Content-Length:"。 filesize($ file _ download));

@ readfile(@ $ file _ download);

& gt