One Hat Cyber Team
Your IP :
216.73.217.131
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
/
tasks
/
Edit File:
CheckTask.php
<?php /** * CheckTask, Loginssl check task * * @copyright Copyright (c) 2007 DotRoll Kft. (http://www.dotroll.com) * @author Zoltán Istvanovszki <zoltan.istvanovszki@dotroll.com> * @since 2018.02.15. * @package CXS_2.0 */ class CheckTask extends \CommonTask { /** * Check Loginsssl hooks and manage it */ public function mainAction() { $hooks = \json_decode(\exec('/usr/local/cpanel/bin/manage_hooks list --output=JSON'), true); $related = []; if (!empty($hooks['Whostmgr']['Accounts::Modify'])) { foreach ($hooks['Whostmgr']['Accounts::Modify'] as $hook) { $related[] = "{$hook['exectype']} {$hook['hook']} --manual --category Whostmgr --event 'Accounts::Modify' --stage {$hook['stage']}"; } } if (!empty($hooks['Whostmgr']['Accounts::Create'])) { foreach ($hooks['Whostmgr']['Accounts::Create'] as $hook) { $related[] = "{$hook['exectype']} {$hook['hook']} --manual --category Whostmgr --event 'Accounts::Create' --stage {$hook['stage']}"; } } if (!empty($hooks['Whostmgr']['Accounts::Remove'])) { foreach ($hooks['Whostmgr']['Accounts::Remove'] as $hook) { $related[] = "{$hook['exectype']} {$hook['hook']} --manual --category Whostmgr --event 'Accounts::Remove' --stage {$hook['stage']}"; } } $need = [ "script /opt/cxs2/loginssl.php --manual --category Whostmgr --event 'Accounts::Create' --stage pre", "script /opt/cxs2/loginssl.php --manual --category Whostmgr --event 'Accounts::Modify' --stage pre", "script /opt/cxs2/loginssl.php --manual --category Whostmgr --event 'Accounts::Create' --stage post", "script /opt/cxs2/loginssl.php --manual --category Whostmgr --event 'Accounts::Modify' --stage post", "script /opt/cxs2/loginssl.php --manual --category Whostmgr --event 'Accounts::Remove' --stage pre", ]; $notNeed = [ "script /opt/cxs2/loginssl/account.php --manual --category Whostmgr --event 'Accounts::Create' --stage pre", "script /opt/cxs2/loginssl/account.php --manual --category Whostmgr --event 'Accounts::Modify' --stage pre", ]; $todo = []; foreach ($related as $hook) { if (\in_array($hook, $notNeed)) { $todo[] = "/usr/local/cpanel/bin/manage_hooks del $hook"; } } foreach ($need as $hook) { if (!\in_array($hook, $related)) { $todo[] = "/usr/local/cpanel/bin/manage_hooks add $hook"; } } foreach ($todo as $cmd) { $retval = 0; $output = []; \exec($cmd, $output, $retval); $this->log("'$cmd' " . ($retval !== 0 ? 'failed' : 'success')); } } }
Simpan