!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/   drwxr-xr-x
Free 294.09 GB of 429.69 GB (68.44%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     129_fixed_cagefs_unmount.py (1.36 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import subprocess
import time
import os
from functools import lru_cache
from defence360agent.utils import retry_on, run_with_umask

_SERVICE_NAME = "cagefs"
_COMMAND = "restart"
_CAGEFSCTL_TOOL = "/usr/sbin/cagefsctl"
_WAIT_LOCK = "--wait-lock"


@lru_cache(1)
def systemctl_present(paths=["/usr/bin", "/bin"]):
    """Return whether we can find systemctl in given *paths*."""
    return any(os.path.isfile(os.path.join(p, "systemctl")) for p in paths)


def _restart_cagefs(exc, i):
    if systemctl_present():
        cmd = ["systemctl", _COMMAND, _SERVICE_NAME]
    else:
        cmd = ["service", _SERVICE_NAME, _COMMAND]
    try:
        subprocess.check_call(cmd)
    except Exception:
        pass
    time.sleep(5)


@retry_on(
    subprocess.CalledProcessError,
    max_tries=3,
    on_error=_restart_cagefs,
    silent=True,
)
def _execute_command(cmd):
    subprocess.check_output(cmd, shell=False, stderr=subprocess.STDOUT)


def migrate(migrator, database, fake=False, umask=0o022, **kwargs):
    if fake:
        return
    cmd_list = [
        [_CAGEFSCTL_TOOL, _WAIT_LOCK, "--force-update-etc"],
        [_CAGEFSCTL_TOOL, _WAIT_LOCK, "--remount-all"],
    ]
    with run_with_umask(umask):
        if os.path.exists(_CAGEFSCTL_TOOL):
            for cmd in cmd_list:
                _execute_command(cmd)


def rollback(migrator, database, fake=False, **kwargs):
    pass

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0935 ]--