File size: 1,322 Bytes
3a5cf48 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # -*- coding: UTF-8 -*-
"""
@FileName:cron_file.py\n
@Description:\n
@Author:Bacon-Wu\n
@Time:2024/1/20 11:17\n
"""
import sys, os
import time
os.chdir('/www/server/panel')
sys.path.insert(0, "class/")
sys.path.insert(0, '/www/server/panel')
import public
import PluginLoader
from mod.base.push_mod import push_by_task_keyword
class main:
def __check_auth(self):
try:
from pluginAuth import Plugin
plugin_obj = Plugin(False)
plugin_list = plugin_obj.get_plugin_list()
if int(plugin_list['ltd']) > time.time():
return True
return False
except:return False
def run(self):
pay = self.__check_auth()
args = public.dict_obj()
args.model_index = 'project'
res = PluginLoader.module_run('safe_detect', 'file_detect', args)
if isinstance(res, dict) and "err_list" in res and len(res['err_list']) > 0:
msg_list = ["检测到以下关键执行文件被篡改:"]
for i in res['err_list']:
msg_list.append(i['Path'])
msg_list.append("请及时处理。")
push_by_task_keyword("file_detect", "file_detect", {"msg_list": msg_list})
if __name__ == '__main__':
channels = sys.argv[1]
main = main()
main.run()
|