403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.148.106.31
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/migrations/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/migrations/126_move_malware_hits_list.py
import logging
import shutil

from defence360agent.files import FILES_DIR
from defence360agent.utils import importer, antivirus_mode

logger = logging.getLogger(__name__)


def _move(src, dst):
    try:
        shutil.move(src, dst)
    except FileNotFoundError:
        pass
    except Exception as err:
        logger.error(
            "Failed to move HackerTrap list to the new location: %r", err
        )


@antivirus_mode.skip
def migrate(migrator, database, fake=False, **kwargs):
    if fake:
        return

    try:
        from defence360agent.contracts.config import HackerTrap

        HackerTrapHitsSaver = importer.get(
            module="imav.malwarelib.subsys.malware",
            name="HackerTrapHitsSaver",
            default=None,
        )
    except ImportError:
        return

    HackerTrapHitsSaver.BASE_DIR = str(FILES_DIR)

    src1 = HackerTrapHitsSaver._filepath()
    src2 = HackerTrapHitsSaver._clean_filepath()
    for src in src1, src2:
        _move(str(src), HackerTrap.DIR)


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

Youez - 2016 - github.com/yon3zu
LinuXploit