Update backups and quarantine paths
This commit is contained in:
parent
bde9863b98
commit
d2fb8250bc
1 changed files with 10 additions and 9 deletions
|
|
@ -12,7 +12,7 @@ import time
|
||||||
|
|
||||||
from subprocess import CalledProcessError, DEVNULL
|
from subprocess import CalledProcessError, DEVNULL
|
||||||
|
|
||||||
from wk.cfg.main import KIT_NAME_FULL
|
from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT
|
||||||
from wk.exe import (
|
from wk.exe import (
|
||||||
get_procs,
|
get_procs,
|
||||||
run_program,
|
run_program,
|
||||||
|
|
@ -782,10 +782,15 @@ def set_backup_path(name, date=False):
|
||||||
|
|
||||||
def set_local_storage_path(folder, name, date=False):
|
def set_local_storage_path(folder, name, date=False):
|
||||||
"""Get path for local storage, returns pathlib.Path."""
|
"""Get path for local storage, returns pathlib.Path."""
|
||||||
local_path = format_log_path(log_name=f'../{folder}/{name}').with_suffix('')
|
local_path = get_path_obj(f'{SYSTEMDRIVE}/{KIT_NAME_SHORT}/{folder}/{name}')
|
||||||
if date:
|
if date:
|
||||||
local_path = local_path.joinpath(time.strftime('%Y-%m-%d'))
|
local_path = local_path.joinpath(time.strftime('%Y-%m-%d'))
|
||||||
return local_path.resolve()
|
return local_path
|
||||||
|
|
||||||
|
|
||||||
|
def set_quarantine_path(name, date=False):
|
||||||
|
"""Set quarantine path, returns pathlib.Path."""
|
||||||
|
return set_local_storage_path('Quarantine', name, date)
|
||||||
|
|
||||||
|
|
||||||
# Tool Functions
|
# Tool Functions
|
||||||
|
|
@ -910,9 +915,7 @@ def run_kvrt():
|
||||||
"""Run KVRT scan."""
|
"""Run KVRT scan."""
|
||||||
log_path = format_log_path(log_name='KVRT', timestamp=True, tool=True)
|
log_path = format_log_path(log_name='KVRT', timestamp=True, tool=True)
|
||||||
log_path.parent.mkdir(parents=True, exist_ok=True)
|
log_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
quarantine_path = set_local_storage_path(
|
quarantine_path = set_quarantine_path('KVRT')
|
||||||
'Quarantine', 'KVRT', date=True,
|
|
||||||
)
|
|
||||||
quarantine_path.mkdir(parents=True, exist_ok=True)
|
quarantine_path.mkdir(parents=True, exist_ok=True)
|
||||||
cmd_args = (
|
cmd_args = (
|
||||||
'-accepteula',
|
'-accepteula',
|
||||||
|
|
@ -1001,9 +1004,7 @@ def run_tdsskiller():
|
||||||
"""Run TDSSKiller scan."""
|
"""Run TDSSKiller scan."""
|
||||||
log_path = format_log_path(log_name='TDSSKiller', timestamp=True, tool=True)
|
log_path = format_log_path(log_name='TDSSKiller', timestamp=True, tool=True)
|
||||||
log_path.parent.mkdir(parents=True, exist_ok=True)
|
log_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
quarantine_path = set_local_storage_path(
|
quarantine_path = set_quarantine_path('TDSSKiller')
|
||||||
'Quarantine', 'TDSSKiller', date=True,
|
|
||||||
)
|
|
||||||
quarantine_path.mkdir(parents=True, exist_ok=True)
|
quarantine_path.mkdir(parents=True, exist_ok=True)
|
||||||
cmd_args = (
|
cmd_args = (
|
||||||
'-accepteula',
|
'-accepteula',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue