$directories = count(glob("{$folder}/*", GLOB_ONLYDIR)); mkdir('../file/' . $directories); mkdir('../file/' . $directories . '/secure'); $uploaddir = '../file/' . $directories . '/secure/'; $uploadfile = $uploaddir . $_FILES['fileToUpload']['name']; if (is_uploaded_file($_FILES["fileToUpload"]["tmp_name"])) { //Save file to Directory if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $uploadfile)) { //Succeed!! } else { echo "<h1>Normal Share - " . SITENAME . "</h1><h3>Failed to move uploaded file from cache directory to real directory!</h3>"; exit; } $fileinfo = pathinfo('../file/' . $directories . '/secure/' . $_FILES['fileToUpload']['name']); $ext = $fileinfo['extension']; $file_hash = filename_hash($_FILES['fileToUpload']['name']); rename('../file/' . $directories . '/secure/' . $_FILES['fileToUpload']['name'], '../file/' . $directories . '/secure/' . $file_hash); //To prevent Webshell Attack $hang = "<?php header('Location: ../../d/" . $directories . "');"; //Redirect Page $file = fopen('../file/' . $directories . '/index.php', 'w'); fwrite($file, $hang); fclose($file); $file = fopen('../file/' . $directories . '/filename.txt', 'w'); //Save File Name fwrite($file, $_FILES['fileToUpload']['name']); fclose($file); $file = fopen('../file/' . $directories . '/secure/ip.txt', 'w'); //Remote IP fwrite($file, get_ip()); fclose($file);
</head>'; echo "<body>\n\t<h1>" . SITENAME . "</h1>\n\t<h3>We Do Not Allow File Hotlinking. :(</h3>\n\t<footer>\n\t" . SITENAME . "'s File Sharing Service. Powered by " . PRODUCTNAME . " v" . RSHAREVER . "\n\t</footer>\n\t</body>"; exit; } if (is_file('../file/' . $file_id . '/secure/delete-reason.txt')) { echo '<head> <meta charset="UTF-8"> <title>File Not Found - ' . SITENAME . '</title> </head>'; echo "<body>\n\t<h1>" . SITENAME . "</h1>\n\t<h3>Sorry but file number" . $file_id . " was deleted.</h3>\n\t<footer>\n\t" . SITENAME . "'s File Sharing Service. Powered by " . PRODUCTNAME . " v" . RSHAREVER . "\n\t</footer>\n\t</body>"; exit; } $fp = fopen('../file/' . $file_id . '/secure/filename.txt', "r"); $fr = fread($fp, filesize('../file/' . $file_id . '/secure/filename.txt')); fclose($fp); $filepath = "../file/" . $file_id . "/secure/" . filename_hash($FileName); $fpa = fopen('../file/' . $file_id . '/secure/count.txt', "r"); $fra = fread($fpa, filesize('../file/' . $file_id . '/secure/count.txt')); fclose($fpa); $counter = $counter + 1; $file = fopen('../file/' . $file_id . '/secure/count.txt', 'w'); fwrite($file, $counter); fclose($file); //Please Do Not Edit lines below! Require for Downloading Files!!! $size = filesize($filepath); header('Content-Description: File Sharing Service by RT M Dev'); header('Content-Type: ' . mime_content_type($filepath)); header('Content-Disposition: attachment; filename=' . $fr); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0');
fclose($file); $file = fopen('../file/Secure/' . $counter . '/secure/filename.txt', 'w'); //Save file name fwrite($file, $_FILES['fileToUpload']['name']); fclose($file); $file = fopen('../file/Secure/' . $counter . '/secure/ip.txt', 'w'); //Save user IP Address fwrite($file, get_ip()); fclose($file); $file = fopen('../file/Secure/' . $counter . '/secure/.htaccess', 'w'); //To prevent Webshell Attack fwrite($file, "order deny,allow \ndeny from all"); fclose($file); $file = fopen('../file/Secure/' . $counter . '/count.txt', 'w'); //Download Counter File fwrite($file, "0"); fclose($file); $ext = $fileinfo['extension']; $file = fopen('../file/Secure/' . $counter . '/extension.txt', 'w'); //File extension fwrite($file, $ext); fclose($file); //Save Password(Hashed) for delete $file = fopen('../file/Secure/' . $counter . '/secure/pw.txt', 'w'); fwrite($file, filename_hash()); fclose($file); //Success Page echo '<h1>' . SITENAME . ' - Secure Share</h1><br><h2>Upload Completed! Here is some information of uploaded file.</h2><br><br><h3>Filen Name: ' . basename($_FILES['fileToUpload']['name']) . '<br>Link: <a href="' . SITEADDR . '/s/' . $counter . '" target="_blank">' . SITEADDR . '/s/' . $counter . '</a><br>Password(for delete): ' . $pass . '<br>password(for download): ' . $pwdown . '<br>Link(Delete File): <a href="' . SITEADDR . '/dels/" target="_blank">http://gnlshare.wink.ws/dels/</a><br><br> <input type="button" value="Upload More File!(Secure)" onclick="location.href='' . SITEADDR . '/secuu/upload.php'">'; } else { echo "<h1>" . SITENAME . " - Secure Share</h1><br><h2>Failed to Upload Your File... Please try again!</h2>"; }
function handle_query_job($user) { $wuid = get_int('wuid'); page_head("Job {$wuid}"); echo "<a href=workunit.php?wuid={$wuid}>View workunit page</a>\n"; // show input files // echo "<h2>Input files</h2>\n"; $wu = BoincWorkunit::lookup_id($wuid); $x = "<in>" . $wu->xml_doc . "</in>"; $x = simplexml_load_string($x); start_table(); table_header("Logical name<br><span class=note>(click to view)</span>", "Size (bytes)", "MD5"); $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); foreach ($x->workunit->file_ref as $fr) { $pname = (string) $fr->file_name; $lname = (string) $fr->open_name; $dir = filename_hash($pname, $fanout); $path = "../../download/{$dir}/{$pname}"; $md5 = md5_file($path); $s = stat($path); $size = $s['size']; table_row("<a href=/download/{$dir}/{$pname}>{$lname}</a>", $size, $md5); } end_table(); echo "<h2>Instances</h2>\n"; start_table(); table_header("Instance ID<br><span class=note>click for result page</span>", "State", "Output files<br><span class=note>click to view the file</span>"); $results = BoincResult::enum("workunitid={$wuid}"); foreach ($results as $result) { echo "<tr>\n <td><a href=result.php?resultid={$result->id}>{$result->id} | {$result->name} </a></td>\n <td>" . state_string($result) . "</td>\n <td>\n"; $i = 0; if ($result->server_state == 5) { $names = get_outfile_names($result); $fanout = parse_config(get_config(), "<uldl_dir_fanout>"); $i = 0; foreach ($names as $name) { $url = boinc_get_output_file_url($user, $result, $i++); $path = dir_hier_path($name, "../../upload", $fanout); $s = stat($path); $size = $s['size']; echo "<a href={$url}>{$name} </a> (" . number_format($size) . " bytes)<br/>"; } $i++; } echo "</td></tr>\n"; } end_table(); echo "<p><a href=submit.php>Return to job control page</a>\n"; page_tail(); }
header("Location: index.php?i=1"); } elseif ($pw == "") { echo 'NOT FOUND 404'; header("Location: index.php?i=1"); } if (!is_file("../file/" . $file_id . "/secure/index.php")) { header("Location: index.php?i=2"); } else { if (!file_exists("../file/" . $file_id . "/pw.txt")) { header("Location: index.php?i=4"); exit; } $fp = fopen("../file/" . $file_id . "/pw.txt", "r"); $fr = fread($fp, filesize("../file/" . $file_id . "/pw.txt")); fclose($fp); $s_key = filename_hash($pw); if ($s_key == $fr) { unlink("../file/" . $file_id . "/count.txt"); unlink("../file/" . $file_id . "/pw.txt"); unlink("../file/" . $file_id . "/extension.txt"); $filerr = fopen('../file/' . $file_id . '/index.php', 'w'); fwrite($filerr, "<h1>Sorry... File Deleted!</h1>"); fclose($filerr); $filerr = fopen('../file/' . $file_id . '/secure/delete-reason.txt', 'w'); fwrite($filerr, "User Deleted"); fclose($filerr); $filerr = fopen('../file/' . $file_id . '/filename.txt', 'w'); fwrite($filerr, "File Not Found"); fclose($filerr); echo "<h1>" . SITENAME . "</h1><br><h3>Succeed to Delete File!</h3>"; showAD();
exit; } $file_id = $_GET["fid"]; if (is_file('../file/' . $file_id . '/secure/delete-reason.txt')) { echo '<head> <meta charset="UTF-8"> <title>File Not Found - ' . SITENAME . '</title> </head>'; echo "<body>\n\t<h1>" . SITENAME . "</h1>\n\t<h3>Sorry but file number" . $file_id . " was deleted.</h3>\n\t<footer>\n\t" . SITENAME . "'s File Sharing Service. Powered by " . PRODUCTNAME . " v" . RSHAREVER . "\n\t</footer>\n\t</body>"; exit; } $fp = fopen('../file/Secure/' . $file_id . '/filename.txt', "r"); //Read File Name. $fr = fread($fp, filesize('../file/Secure/' . $file_id . '/filename.txt')); fclose($fp); $filepath = '../file/Secure/' . $file_id . '/secure/' . filename_hash($file_id); //Path of File $fp = fopen('../file/Secure/' . $file_id . '/count.txt', "r"); $fr = fread($fp, filesize('../file/Secure/' . $file_id . '/down.txt')); //Increasing Download Counter fclose($fp); $newnum++; $file = fopen('../file/Secure/' . $file_id . '/count.txt', 'w'); fwrite($file, $newnum); fclose($file); //Please Do Not Edit lines below! Require for Downloading Files!!! $size = filesize($filepath); header('Content-Description: File Sharing Service by RT M Dev'); header('Content-Type: ' . mime_content_type($filepath)); header('Content-Disposition: attachment; filename=' . $fr); header('Content-Transfer-Encoding: binary');