[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.144.117.19: ~ $
import subprocess
import os
import xml.etree.ElementTree as etree
from logging import getLogger

logger = getLogger(__name__)
MU_PLUGIN_INSTALLATION = "mu_plugin_installation"
ADVICE_EMAIL_NOTIFICATION = "advice_email_notification"
MU_PLUGIN_KEYS = [MU_PLUGIN_INSTALLATION, ADVICE_EMAIL_NOTIFICATION]

XRAY_MANAGER = "/usr/sbin/cloudlinux-xray-manager"


def get_rhn_value(name):
    try:
        rhn_systemid_xml = etree.parse("/etc/sysconfig/rhn/systemid")
        for member in rhn_systemid_xml.iter("member"):
            if member.find("name").text == name:
                return member.find("value")[0].text
    except (IOError, IndexError, KeyError, etree.ParseError):
        return None
    return None


class WordPressMuPlugin:
    @staticmethod
    def _setup_agent():
        system_id = get_rhn_value("system_id")
        if system_id:
            proc = subprocess.run(
                [
                    "/usr/sbin/cloudlinux-xray-manager",
                    "enable-user-agent",
                    "--system_id",
                    system_id.replace("ID-", ""),
                ],
                capture_output=True,
                text=True,
            )
            logger.info(
                "Activation xray manager captured out: %s, err: %s",
                proc.stdout,
                proc.stderr,
            )

    def prepare_for_mu_plugin_installation(
        self, activation_status, mu_plugin_status
    ):
        """
        Must use plugin works only if xray-user-agent is running
        So it is a requirement to be sure it is turned on
        It is expected to be turned on by default after conversion to Cloulinux Pro edition
        """
        if not all([activation_status == "active", mu_plugin_status]):
            logger.warning(
                "Nothing to prepare for Must Use plugin as settings "
                "are not turned on, activation status=%s mu_plugin_status=%s",
                str(activation_status),
                str(mu_plugin_status),
            )
            return

        if not mu_plugin_status:
            logger.warning(
                "Nothing to prepare for Must Use plugin "
                "as mu_plugin_status=%s",
                str(mu_plugin_status),
            )
            return

        if not os.path.exists(XRAY_MANAGER):
            raise ValueError(
                "alt-php-xray rpm package is not installed "
                "in the system, please install it and try again"
            )

        self._setup_agent()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 51.54 KB 0644
_shutil.py File 795 B 0644
antivirus_mode.py File 497 B 0644
benchmark.py File 576 B 0644
buffer.py File 1.24 KB 0644
check_db.py File 7.35 KB 0644
cli.py File 7.08 KB 0644
common.py File 14.41 KB 0644
config.py File 999 B 0644
cronjob.py File 902 B 0644
hyperscan.py File 149 B 0644
importer.py File 2.29 KB 0644
json.py File 953 B 0644
kwconfig.py File 1.56 KB 0644
parsers.py File 11.1 KB 0644
resource_limits.py File 2.29 KB 0644
safe_fileops.py File 7.96 KB 0644
safe_sequence.py File 363 B 0644
serialization.py File 1.72 KB 0644
subprocess.py File 1.53 KB 0644
support.py File 5.19 KB 0644
threads.py File 1005 B 0644
whmcs.py File 7.6 KB 0644
wordpress_mu_plugin.py File 2.47 KB 0644