One Hat Cyber Team
Your IP :
216.73.216.194
Server IP :
185.33.55.30
Server :
Linux cl30.webspacecontrol.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
cxs2
/
app
/
libs
/
CXS
/
Edit File:
Unsuspend.php
<?php /** * Unsuspend, Unsuspend a user * * @copyright Copyright (c) 2007 DotRoll Kft. (http://www.dotroll.com) * @author Zoltán Istvanovszki <zoltan.istvanovszki@dotroll.com> * @since 2017.06.15. * @package CXS_2.0 */ namespace CXS; class Unsuspend extends CommonComponent { /** * Init */ public function onConstruct() { } /** * Execute user unsuspend * * @param string $hash Username */ public function execute(string $hash) { $uid = $this->checkHash($hash); if ($uid === false) { return; } if (\is_file("/usr/local/apache/conf/userdata/cxs/$hash.conf") || \is_file("/usr/local/directadmin/data/users/$hash/cxs.conf")) { $this->push("Unsuspend $hash"); // Restore e-mail limit to package value /* @var $limit \CXS\Limit */ $limit = $this->di->get('limit'); $limit->restore($hash); $limit = null; unset($limit); // Restore cron $this->restoreCron($hash); // CSF allow $this->csfAllow($hash, $uid); // Remove suspend redirect $this->removeSuspendRedirect($hash); // Graceful restart apache // $this->gracefulApache(); } \Reports::findByHash($hash)->delete(); \Suspended::findByHash($hash)->delete(); } /** * Graceful restart apache */ public function gracefulApache() { \exec('/usr/sbin/apachectl graceful'); } /** * Restore Cron * * @param string $hash User */ public function restoreCron(string $hash) { if ($this->checkHash($hash) === false) { return; } $this->log("restoreCron $hash"); $output = \explode(\PHP_EOL, \shell_exec("crontab -l -u $hash")); $changesCount = 0; foreach ($output as &$line) { if (empty(\trim($line)) || \preg_match('/^\s*#/', $line)) { continue; } if (\preg_match('/^(\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+)exit;\s+(.+)$/', $line, $matches)) { $line = $matches[1] . $matches[2]; $changesCount++; } } $newOutput = \implode(\PHP_EOL, $output); if (\strpos($newOutput, 'SHELL="/bin/false"') !== false || \strpos($newOutput, '#CXS#') !== false) { $newOutput = \str_replace(['SHELL="/bin/false"', '#CXS#'], ['SHELL="/usr/local/cpanel/bin/jailshell"', ''], $newOutput); $changesCount++; } if ($changesCount > 0) { $tempFile = \tempnam(\sys_get_temp_dir(), 'crontab_'); \file_put_contents($tempFile, $newOutput . \PHP_EOL); \exec("crontab -u $hash $tempFile"); \unlink($tempFile); } $this->push("User: $hash Cron restored"); $output = null; $newOutput = null; $changesCount = null; $tempFile = null; unset($output); unset($changesCount); unset($newOutput); unset($tempFile); } /** * Allow CSF * * @param string $hash User * @param int $uid UID */ public function csfAllow(string $hash, int $uid) { $this->log("csfAllow $hash"); \exec('/usr/sbin/csf --denyrm "tcp|out|any|any|u=' . $uid . '"'); \exec('/usr/sbin/csf --denyrm "udp|out|any|any|u=' . $uid . '"'); $this->push("User: $hash CSF allowed"); $uid = null; unset($uid); } /** * Remove suspended redirect * * @param string $hash User */ public function removeSuspendRedirect(string $hash) { if ($this->checkHash($hash) === false) { return; } if (\is_file("/usr/local/apache/conf/userdata/cxs/$hash.conf") || \is_file("/usr/local/directadmin/data/users/$hash/cxs.conf")) { if (\is_file("/usr/local/apache/conf/userdata/cxs/$hash.conf")) { \unlink("/usr/local/apache/conf/userdata/cxs/$hash.conf"); } if (\is_file("/usr/local/directadmin/data/users/$hash/cxs.conf")) { \unlink("/usr/local/directadmin/data/users/$hash/cxs.conf"); } \exec('/usr/sbin/apachectl graceful 2> /dev/null'); $this->push("User: $hash Suspend redirect removed"); } } }
Simpan