Windows Defender - 以编程方式添加排除文件夹

Ogg*_*las 9 windows windows-10 windows-defender

为了研究目的,我正在检查不同的键盘记录器,偶然发现了Refog:

https://www.refog.com/keylogger/

这个程序可以捕获很多系统事件,但真正引起我注意的是其他东西.该程序创建了一个名为Mpk的隐藏文件夹,路径为C:\ Windows\SysWOW64\Mpk.它被标记为操作系统文件文件夹,因为在我取消标记之前它是不可见的Hide protected operating system files (recommended).我想,这可以通过像这样的attrib命令完成,attrib +s +h "C:\Windows\SysWOW64\Mpk"所以没有什么革命性的.

隐藏

但是,他们还为Windows Defender添加了此文件夹的排除项.他们怎么能以编程方式执行此操作?我正在运行Windows 10 Pro x64.

排除

gav*_*koa 14

在提升的 shell 中运行(在开始菜单中搜索 cmd 并点击Ctrl+Shift+Enter)。

powershell -Command Add-MpPreference -ExclusionPath "C:\tmp"
powershell -Command Add-MpPreference -ExclusionProcess "java.exe"
powershell -Command Add-MpPreference -ExclusionExtension ".java"

powershell -Command Remove-MpPreference -ExclusionExtension ".java"
Run Code Online (Sandbox Code Playgroud)


小智 12

执行此操作的正确方法是使用Add-MpPreference PowerShell cmdlet.使用此cmdlet可为文件扩展名,路径和进程添加排除项,并为高,中和低威胁添加默认操作.

您可以使用以下命令行从Windows 10中的高架cmd shell轻松执行此操作:

powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath "C:\Windows\SysWOW64\Mpk"
Run Code Online (Sandbox Code Playgroud)

  • 工作完美,但是如果文件路径中有空格,则需要转义命令,如下所示: `powershell -inputformat none -outputformat none -NonInteractive -Command "Add-MpPreference -ExclusionPath 'C:\Program Files (x86) \sysconfig'"` (4认同)

Ogg*_*las 8

经过一番挖掘后,我找到了以下文件夹:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths
Run Code Online (Sandbox Code Playgroud)

我无法在我的用户处添加密钥.我收到以下错误:Cannot create key: You do not have the requisite permissions to create a new key under Paths

但是,SYSTEM,WinDefend和TrustedInstaller都具有完全控制权.最好的猜测是他们使用了类似DevxExec的东西devxexec.exe /user:TrustedInstaller cmd并将密钥写入注册表.

在此输入图像描述

  • 如果您投反对票,请说明原因。否则很难改进答案 (2认同)