From 50422e28bbce5bc4cd5a521ebd2e4ba6085ac768 Mon Sep 17 00:00:00 2001 From: Clortox Date: Thu, 18 Feb 2021 15:50:30 -0500 Subject: [PATCH] Add hiddenlisting.php --- hiddenlisting.php | 124 ++++++++++++++++++++++++++++++++++++++++++++++ index.php | 2 +- listing.php | 2 +- 3 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 hiddenlisting.php diff --git a/hiddenlisting.php b/hiddenlisting.php new file mode 100644 index 0000000..0fe5103 --- /dev/null +++ b/hiddenlisting.php @@ -0,0 +1,124 @@ + + + + <?php echo $site_name ?> + "> + + + + + $dir_){ + if($dir_ == $dir){ + $exists = true; + break; + } + } + + $psk = $_GET['psk']; + $psk_correct = false; + if($hid_dir_psk[$hid_dir_index] == $psk){ + $psk_correct = true; + } + + if(!$exists || !$psk_correct){ + echo <<< errorblock +
+

INCORRECT FOLDER OR PASSKEY, PLEASE CONTACT THE SYSTEM ADMINISTRATOR

+
+ errorblock; + exit(); + } + + if(!array_key_exists('path', $_GET)){ + $path = '/'; + } else { + $path = $_GET['path']; + } + + $elements = []; + if($handle = opendir($hid_dir_dirs[$hid_dir_index] . $path)){ + while(false !== ($entry = readdir($handle))){ + //exclude . and .. + if($entry != '.' && $entry != '..'){ + $elements[] = $entry; + } + } + } else { + echo <<< erroropendir +
+

ERROR OPENING DIRECTORY, PLEASE RELOAD THE PAGE

+

IF THE ISSUE PERSISTS, PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR

+
+ erroropendir; + exit(); + } + + ?> +
+
+

+
+
+

Select a file to download, or a folder to view its contents

+ + + + + + + + + + + + + + + emptylisting; + } + foreach($elements as $i=>$currentfile){ + echo ""; + echo ""; + $fulldir = $hid_dir_dirs[$hid_dir_index] . $path . "/" . $currentfile; + if(is_dir($fulldir)){ + echo ""; + echo ""; + } else { + echo ""; + echo ""; + } + echo ""; + } + ?> + +
File NameLinkSize
Oops! This folder is empty...0
" . $currentfile . "View Directory" . foldersize($fulldir) . "Download" . listingsize($fulldir) . "
+
+
+ + + diff --git a/index.php b/index.php index d836c00..29fc2c7 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ include 'www/include.php'; include 'helpers/files.php'; - //if this is a session inside the local connection + //if debug is enabled if($isDebug){ ini_set('display_errors',1); ini_set('display_startup_errors',1); diff --git a/listing.php b/listing.php index 2ff6f99..c7f9f20 100644 --- a/listing.php +++ b/listing.php @@ -7,7 +7,7 @@ include 'www/include.php'; include 'helpers/files.php'; - //if this is a session inside the local connection + //if debug is enabled if($isDebug){ ini_set('display_errors',1); ini_set('display_startup_errors',1);