BLACKSITE
:
18.219.208.51
:
103.154.184.216 / www.astitvaad.com
:
Linux vps.readyhost.in 4.18.0-553.6.1.el8.x86_64 #1 SMP Thu May 30 04:13:58 UTC 2024 x86_64
:
/
bin
/
Upload File:
files >> //bin/setzadmin
#!/usr/bin/php <?php /** * @copyright 2014-2015 Sentora Project (http://www.sentora.org/) * Sentora is a GPL fork of the ZPanel Project whose original header follows: * * SETZADMIN - ZPanel tool to set inital zadmin account password, salt and random API key. * @package zpanelx * @subpackage core -> setzadmin * @author Bobby Allen (ballen@bobbyallen.me) * @copyright ZPanel Project (http://www.zpanelcp.com/) * @link http://www.zpanelcp.com/ * @license GPL (http://www.gnu.org/licenses/gpl.html) */ $rawPath = str_replace("\\", "/", dirname(__FILE__)); $rootPath = str_replace("/bin", "/", $rawPath); chdir($rootPath); set_time_limit(0); //ini_set('memory_limit', '256M'); ini_set('error_reporting', E_ALL | E_STRICT); ini_set('display_errors', 'On'); ini_set('log_errors', 'Off'); require_once 'dryden/loader.inc.php'; require_once 'cnf/database.php'; require_once 'inc/dbc.inc.php'; if( $argc != 4) { echo "send the parameter properly"; exit; } if (!runtime_controller::IsCLI()) exit(1); $generate = true; $password = null; if ((isset($argv[1])) && ($argv[1] == '--noregen')) { $generate = false; } if ((isset($argv[1])) && ($argv[1] == '--regen')) { $generate = true; } if ((isset($argv[2])) && ($argv[2] == '--set')) { if (isset($argv[3])) { $password = $argv[3]; } } function SetPassword($password, $generate) { global $zdbh; print "\n"; if ($password != null) { if ($generate == true) { $system_hash = new runtime_hash; $new_hash = $system_hash->RandomSalt(); $securityfile = "<?php\n" . "/**\n" . "* Security configuration file.\n" . "* @package zpanelx\n" . "* @subpackage core -> config\n" . "* @author Bobby Allen (ballen@bobbyallen.me)\n" . "* @copyright ZPanel Project (http://www.zpanelcp.com/)\n" . "* @link http://www.zpanelcp.com/\n" . "* @license GPL (http://www.gnu.org/licenses/gpl.html)\n" . "*/\n" . "global \$security;\n" . "\n" . "\$security['server_crypto_key'] = \"" . $new_hash . "\";" . "\n"; fs_filehandler::UpdateFile('cnf/security.php', 0755, $securityfile); print "> New server crypto key written to cnf/security.php\n"; } if ($generate == true) { $chars = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $randomkey = (string) null; for ($i = 0; $i < 32; $i++) $randomkey.=$chars[rand(0, 63)]; ctrl_options::SetSystemOption('apikey', md5($randomkey)); print "> New API key has been generated!\n"; } $crypto = new runtime_hash; $crypto->SetPassword($password); $randomsalt = $crypto->RandomSalt(); $crypto->SetSalt($randomsalt); $new_secure_password = $crypto->CryptParts($crypto->Crypt())->Hash; $sql = $zdbh->prepare("UPDATE x_accounts SET ac_pass_vc = '" . $new_secure_password . "', ac_passsalt_vc = '" . $randomsalt . "' WHERE ac_id_pk = '1'"); $sql->execute(); print "> Account password for 'zadmin' has been updated!\n"; } else { print "Error: No password was specified, no actions have been carried out!\n"; } print "\n"; } if ((!isset($argv[1])) || ($argv[1] == 'help') || ($argv[1] == '-h') || ($argv[1] == '--help')) { fwrite(STDOUT, "\nSentora 'zadmin' account tool\n"); fwrite(STDOUT, "Copyright (c) 2014 Sentora Project\n"); fwrite(STDOUT, "http://sentora.org/\n"); fwrite(STDOUT, "Copyright (c) 2008 - 2014 ZPanel Project\n"); fwrite(STDOUT, "http://www.zpanelcp.com/\n"); fwrite(STDOUT, "Usage: setzadmin [options]\n"); fwrite(STDOUT, "Options:\n"); fwrite(STDOUT, " --regen - generation of a new API key and system hash.\n"); fwrite(STDOUT, " --noregen - Suppresses generation of a new API key and system hash.\n"); fwrite(STDOUT, " --set [password] - Sets the new password for the 'zadmin' account.\n"); fwrite(STDOUT, " --help - Displays this text.\n\n"); exit(0); } SetPassword($password, $generate); ?>