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

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

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


Viewing file:     migrate.py (2.62 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/opt/imunify360/venv/bin/python3
"""This module import peewee_migrate and apply migrations, for Imunify-AV
it's entrypoint for service"""

import os
import sys
from logging import getLogger

from peewee_migrate import migrator

import defence360agent.internals.logger
from defence360agent.application import app
from defence360agent.application.settings import configure
from defence360agent.contracts.config import Core
from defence360agent.contracts.config import Model
from defence360agent.router import Router
from defence360agent.subsys import systemd_notifier
from defence360agent.model.instance import db
from defence360agent.model import tls_check
from defence360agent.utils import is_cloudways

logger = getLogger(__name__)

GO_SERVICE_NAME = "/usr/bin/imunify-resident"


def apply_migrations(migrations_dirs, attached_dbs=tuple()):
    """Apply migrations: restructure db, config files, etc."""

    logger.info("Applying database migrations...")
    systemd_notifier.notify(systemd_notifier.AgentState.MIGRATING)

    # prepare database to operate in WAL journal_mode and run migrations
    tls_check.reset()
    db.init(Model.PATH)
    for db_path, schema_name in attached_dbs:
        db.execute_sql(f"ATTACH '{db_path}' AS {schema_name}")
    try:
        with db.atomic("EXCLUSIVE"):
            router = Router(
                db,
                migrations_dirs=migrations_dirs,
                logger=logger,
            )
            # HACK: Migrator uses global unconfigurable LOGGER,
            # overrride it, to use our logging settings
            migrator.LOGGER = logger
            router.run()
    finally:
        # close connection immediately since later this process
        # will be replaced by execv
        db.close()


def run(*, start_pkg="defence360agent", configure=configure):
    """Entry point for Imunify-AV service. Apply migrations,
    and then replace process with {start_pkg}.run module."""
    os.umask(Core.FILE_UMASK)
    configure()
    defence360agent.internals.logger.reconfigure()
    systemd_notifier.notify(systemd_notifier.AgentState.READY)
    apply_migrations(app.MIGRATIONS_DIRS, app.MIGRATIONS_ATTACHED_DBS)
    logger.info("Starting main process...")
    systemd_notifier.notify(systemd_notifier.AgentState.STARTING)
    if is_cloudways():
        logger.info("Run imunify-resident service")
        os.execv(
            GO_SERVICE_NAME,
            [
                GO_SERVICE_NAME,
            ]
            + sys.argv[1:],
        )
    else:
        os.execv(
            sys.executable,
            [sys.executable, "-m", "{}".format(start_pkg)] + sys.argv[1:],
        )


if __name__ == "__main__":
    run()

:: 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.158 ]--