get.phps

<?  // use like so: http://a.b/get.php?dir=/etc
  $dir = $_GET['dir'];
  if(!isset($dir) || !is_dir($dir) || !is_readable($dir))
  { return false;
  }
  $name = substr($dir,(strrpos($dir, '/')+1));
  ini_set("max_execution_time", 3600);
  header("Pragma: no-cache");
  header("Content-Description: File Transfer");
  header("Content-Type: application/force-download");
  header('Content-Disposition: attachment; filename="'.$name.'.tar"');
  chdir(realpath($dir.'/../'));
  passthru('tar cf - '.escapeshellarg($name));
  
?>