configuring-windows-defender-advanced-settings

配置 Microsoft Defender for Endpoint(MDE)高级防护设置,包括攻击面缩减规则、受控文件夹访问、 网络保护和漏洞利用防护。适用于在默认 Defender 设置基础上加固 Windows 端点、部署企业级端点防护 或满足高级恶意软件防御合规要求的场景。

9 stars

Best use case

configuring-windows-defender-advanced-settings is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

配置 Microsoft Defender for Endpoint(MDE)高级防护设置,包括攻击面缩减规则、受控文件夹访问、 网络保护和漏洞利用防护。适用于在默认 Defender 设置基础上加固 Windows 端点、部署企业级端点防护 或满足高级恶意软件防御合规要求的场景。

Teams using configuring-windows-defender-advanced-settings should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/configuring-windows-defender-advanced-settings/SKILL.md --create-dirs "https://raw.githubusercontent.com/killvxk/cybersecurity-skills-zh/main/skills/configuring-windows-defender-advanced-settings/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/configuring-windows-defender-advanced-settings/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How configuring-windows-defender-advanced-settings Compares

Feature / Agentconfiguring-windows-defender-advanced-settingsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

配置 Microsoft Defender for Endpoint(MDE)高级防护设置,包括攻击面缩减规则、受控文件夹访问、 网络保护和漏洞利用防护。适用于在默认 Defender 设置基础上加固 Windows 端点、部署企业级端点防护 或满足高级恶意软件防御合规要求的场景。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 配置 Windows Defender 高级设置

## 使用场景

在以下情况下使用本技能:
- 在默认设置基础上配置 Microsoft Defender for Endpoint(MDE)以增强防护
- 实施攻击面缩减(ASR)规则以阻断常见攻击手法
- 启用受控文件夹访问以防护勒索软件
- 配置网络保护和漏洞利用防护功能
- 通过 Intune、SCCM 或组策略在企业范围内部署 Defender 设置

**不适用于**第三方 EDR 部署(CrowdStrike、SentinelOne)或 Microsoft Defender for Cloud(Azure 工作负载保护)。

## 前置条件

- 已启用 Microsoft Defender 防病毒的 Windows 10/11 企业版
- Microsoft 365 E5 或 Microsoft Defender for Endpoint Plan 2 许可证(使用完整 MDE 功能)
- 用于企业策略部署的 Microsoft Intune 或 SCCM
- Microsoft 365 Defender 门户访问权限(security.microsoft.com)
- 端点上未以主动模式运行第三方杀毒软件(否则 Defender 将进入被动模式)

## 操作流程

### 步骤 1:配置攻击面缩减(ASR)规则

ASR 规则阻断恶意软件和攻击者常用的特定行为:

```powershell
# 通过 PowerShell 启用 ASR 规则(或通过 Intune/GPO 部署)
# 模式:0=禁用, 1=阻断, 2=审计, 6=警告

# 阻断来自电子邮件客户端和 Webmail 的可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断所有 Office 应用程序创建子进程
Set-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EFC-AADC-AD5F3C50688A `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 应用程序创建可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536-B80A7769E899 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 应用程序向其他进程注入代码
Set-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 JavaScript 或 VBScript 启动已下载的可执行内容
Set-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A917-57927947596D `
  -AttackSurfaceReductionRules_Actions 1

# 阻断执行可能混淆的脚本
Set-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC `
  -AttackSurfaceReductionRules_Actions 1

# 阻断 Office 宏调用 Win32 API
Set-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B `
  -AttackSurfaceReductionRules_Actions 1

# 阻断从 Windows LSASS 窃取凭据
Set-MpPreference -AttackSurfaceReductionRules_Ids 9E6C4E1F-7D60-472F-BA1A-A39EF669E4B2 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断通过 PSExec 和 WMI 命令创建进程
Set-MpPreference -AttackSurfaceReductionRules_Ids D1E49AAC-8F56-4280-B9BA-993A6D77406C `
  -AttackSurfaceReductionRules_Actions 1

# 阻断来自 USB 的不受信任和未签名进程
Set-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 `
  -AttackSurfaceReductionRules_Actions 1

# 阻断通过 WMI 事件订阅实现的持久化
Set-MpPreference -AttackSurfaceReductionRules_Ids E6DB77E5-3DF2-4CF1-B95A-636979351E5B `
  -AttackSurfaceReductionRules_Actions 1

# 阻断滥用易受攻击的已签名驱动程序
Set-MpPreference -AttackSurfaceReductionRules_Ids 56A863A9-875E-4185-98A7-B882C64B5CE5 `
  -AttackSurfaceReductionRules_Actions 1
```

### 步骤 2:配置受控文件夹访问(勒索软件防护)

```powershell
# 启用受控文件夹访问
Set-MpPreference -EnableControlledFolderAccess Enabled

# 默认受保护文件夹:文档、图片、视频、音乐、桌面、收藏夹
# 添加自定义受保护文件夹
Add-MpPreference -ControlledFolderAccessProtectedFolders "C:\CriticalData"
Add-MpPreference -ControlledFolderAccessProtectedFolders "D:\SharedDrives"

# 允许特定应用程序访问受保护文件夹
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\CustomApp\app.exe"
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\Backup\backup.exe"

# 先设为审计模式,识别需要访问权限的合法应用程序
Set-MpPreference -EnableControlledFolderAccess AuditMode
# 事件 ID 1124 记录在 Microsoft-Windows-Windows Defender/Operational 日志中
```

### 步骤 3:配置网络保护

```powershell
# 启用网络保护(阻断到恶意域/IP 的连接)
Set-MpPreference -EnableNetworkProtection Enabled

# 网络保护利用 Microsoft SmartScreen 情报
# 阻断:钓鱼网站、漏洞利用托管域、C2 域名、恶意软件下载 URL

# 先设为审计模式:
Set-MpPreference -EnableNetworkProtection AuditMode
# 事件日志:Microsoft-Windows-Windows Defender/Operational,事件 ID 1125

# 配置 Web 内容过滤(需要 MDE P2 许可证)
# 通过 Microsoft 365 Defender 门户管理:
# 设置 → 端点 → Web 内容过滤 → 添加策略
# 需要阻断的类别:恶意软件、钓鱼、成人内容、高带宽
```

### 步骤 4:配置漏洞利用防护

```powershell
# 导出当前漏洞利用防护设置
Get-ProcessMitigation -RegistryConfigFilePath "C:\Defender\current_mitigations.xml"

# 配置系统级缓解措施
Set-ProcessMitigation -System -Enable DEP, SEHOP, ForceRelocateImages, BottomUp

# 配置每个应用程序的缓解措施
# 示例:加固 Microsoft Office 防止漏洞利用
Set-ProcessMitigation -Name "WINWORD.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

Set-ProcessMitigation -Name "EXCEL.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

Set-ProcessMitigation -Name "POWERPNT.EXE" `
  -Enable DEP, SEHOP, ForceRelocateImages, CFG, StrictHandle

# 从 XML 模板导入漏洞利用防护配置
Set-ProcessMitigation -PolicyFilePath "C:\Defender\exploit_protection_template.xml"
```

### 步骤 5:配置云提供的防护

```powershell
# 启用云提供的防护(实时威胁情报)
Set-MpPreference -MAPSReporting Advanced
Set-MpPreference -SubmitSamplesConsent SendAllSamples

# 启用首次见即阻断(BAFS)
# 前提:已启用云防护 + 已启用样本提交
Set-MpPreference -DisableBlockAtFirstSeen $false

# 将云阻断超时设置为最大值(60 秒)
Set-MpPreference -CloudBlockLevel High
Set-MpPreference -CloudExtendedTimeout 50

# 启用潜在不需要的应用程序(PUA)防护
Set-MpPreference -PUAProtection Enabled
```

### 步骤 6:配置扫描和更新设置

```powershell
# 配置实时保护
Set-MpPreference -DisableRealtimeMonitoring $false
Set-MpPreference -DisableBehaviorMonitoring $false
Set-MpPreference -DisableIOAVProtection $false
Set-MpPreference -DisableScriptScanning $false

# 配置计划扫描
Set-MpPreference -ScanScheduleQuickScanTime 12:00:00
Set-MpPreference -ScanParameters QuickScan
Set-MpPreference -ScanScheduleDay 0  # 每天
Set-MpPreference -RemediationScheduleDay 0

# 配置特征库更新
Set-MpPreference -SignatureUpdateInterval 1  # 每小时检查一次
Set-MpPreference -SignatureFallbackOrder "MicrosoftUpdateServer|MMPC"

# 启用防篡改保护(防止对 Defender 设置进行未授权更改)
# 通过 Microsoft 365 Defender 门户管理:
# 设置 → 端点 → 高级功能 → 防篡改保护:开启
```

### 步骤 7:通过 Intune 部署(企业版)

```
Intune 部署路径:
1. 端点安全 → 攻击面缩减 → 创建配置文件
   - 平台:Windows 10 及更高版本
   - 配置文件:攻击面缩减规则
   - 将每条 ASR 规则配置为阻断或审计

2. 端点安全 → 防病毒 → 创建配置文件
   - Microsoft Defender 防病毒
   - 配置:云保护、PUA、实时保护

3. 端点安全 → 防病毒 → 创建配置文件
   - Microsoft Defender 防病毒排除项
   - 为业务应用程序添加路径/进程/扩展名排除项

4. 设备 → 配置文件 → 创建配置文件
   - 端点保护 → Microsoft Defender Exploit Guard
   - 配置:受控文件夹访问、网络保护
```

### 步骤 8:在 Microsoft 365 Defender 门户中监控

```
仪表板监控:
1. security.microsoft.com → 报告 → 端点
   - 设备健康状况:整个部署范围内的防护状态
   - ASR 规则检测:哪些规则被触发
   - 存在漏洞的设备:缺少安全更新的设备

2. 威胁分析:
   - 活跃威胁活动及 Defender 覆盖情况
   - 推荐的安全操作

3. 高级搜寻(KQL):
   DeviceEvents
   | where ActionType startswith "Asr"
   | summarize Count=count() by ActionType, FileName
   | sort by Count desc

   DeviceEvents
   | where ActionType == "ControlledFolderAccessViolationBlocked"
   | project Timestamp, DeviceName, FileName, FolderPath
```

## 关键概念

| 术语 | 定义 |
|------|------|
| **ASR 规则** | 攻击面缩减规则,在端点级别阻断特定高风险行为 |
| **受控文件夹访问** | 勒索软件防护功能,防止未授权应用程序修改受保护文件夹中的文件 |
| **网络保护** | 利用 SmartScreen 情报阻断到低信誉或已知恶意域名的出站连接 |
| **漏洞利用防护** | 系统和每个应用程序的内存缓解措施(DEP、ASLR、CFG),防止漏洞利用 |
| **BAFS(首次见即阻断)** | 基于云的零日防护,在允许执行前将可疑文件提交云端分析 |
| **防篡改保护** | 防止对 Defender 安全设置进行未授权更改,即使是本地管理员也不行 |

## 工具与系统

- **Microsoft 365 Defender 门户**:security.microsoft.com,用于集中管理和报告
- **Microsoft Intune**:基于云的端点管理,用于 Defender 策略部署
- **PowerShell(Set-MpPreference)**:本地配置 Defender 设置
- **WDAC(Windows Defender 应用程序控制)**:配套的应用程序控制技术
- **Microsoft Defender for Endpoint API**:用于自动化和自定义集成的 REST API

## 常见误区

- **立即以阻断模式启用所有 ASR 规则**:某些 ASR 规则与合法软件(Office 宏、管理脚本)会产生误报。始终先在审计模式下部署,监控 2-4 周。
- **未配置受控文件夹访问排除项**:备份软件、数据库应用程序和开发工具可能被阻止写入受保护文件夹。提前添加排除项。
- **忽视防篡改保护**:没有防篡改保护,恶意软件或内部人员可通过 PowerShell 或注册表编辑禁用 Defender。通过 M365 Defender 门户启用防篡改保护。
- **同时运行 Defender 和第三方杀毒软件**:存在第三方杀毒软件时,Defender 进入被动模式。确保使用预期的杀毒方案,并适当配置 Defender(如保留第三方杀毒软件则使用仅 EDR 模式)。
- **忽视云连接要求**:云提供的防护和 BAFS 需要端点能够访问 Microsoft 云服务。验证代理/防火墙规则允许 Defender 云流量通过。

Related Skills

scanning-network-with-nmap-advanced

9
from killvxk/cybersecurity-skills-zh

使用 Nmap 的脚本引擎、时序控制、规避技术和输出解析,对授权目标网络执行高级网络侦察, 发现主机、枚举服务、检测漏洞并识别操作系统。

performing-windows-artifact-analysis-with-eric-zimmerman-tools

9
from killvxk/cybersecurity-skills-zh

使用 Eric Zimmerman 的开源 EZ Tools 套件(包括 KAPE、MFTECmd、PECmd、LECmd、JLECmd 和 Timeline Explorer)执行全面的 Windows 取证制品分析,解析注册表 hive、预取文件、事件日志和文件系统元数据。

implementing-github-advanced-security-for-code-scanning

9
from killvxk/cybersecurity-skills-zh

配置 GitHub Advanced Security 与 CodeQL,在企业级别对仓库执行自动化静态分析和漏洞检测。

implementing-azure-defender-for-cloud

9
from killvxk/cybersecurity-skills-zh

实施 Microsoft Defender for Cloud,为虚拟机、容器、数据库和存储启用云安全态势管理和工作负载保护,配置安全建议,并通过自动修复设置自适应安全控制。

hunting-for-persistence-mechanisms-in-windows

9
from killvxk/cybersecurity-skills-zh

系统性地狩猎 Windows 终端中的攻击者持久化机制,涵盖注册表、服务、启动文件夹和 WMI 事件订阅。

hunting-advanced-persistent-threats

9
from killvxk/cybersecurity-skills-zh

在企业环境中使用基于假设的搜索,跨终端遥测、网络日志和内存产物,主动猎捕高级持续性威胁(APT)活动。适用于开展定期威胁猎捕周期、调查 UEBA 标记的异常行为,或验证已知 APT TTP 在环境中不存在时。适用于涉及 MITRE ATT&CK、Velociraptor、osquery、Zeek 或威胁猎捕剧本的请求。

hardening-windows-endpoint-with-cis-benchmark

9
from killvxk/cybersecurity-skills-zh

使用 CIS(互联网安全中心)Benchmark 建议对 Windows 端点进行加固, 以减少攻击面、执行安全基线并满足合规要求。适用于部署新 Windows 工作站或服务器、 修复审计发现或为组织建立全面安全基线的场景。适用于涉及 Windows 加固、 CIS Benchmark、GPO 安全基线或端点配置合规的请求。

extracting-windows-event-logs-artifacts

9
from killvxk/cybersecurity-skills-zh

使用 Chainsaw、Hayabusa 和 EvtxECmd 提取、解析和分析 Windows 事件日志(EVTX),以检测横向移动、持久化和权限提升。

configuring-zscaler-private-access-for-ztna

9
from killvxk/cybersecurity-skills-zh

配置 Zscaler Private Access(ZPA),通过部署 App Connector、定义应用程序段、 基于用户身份和设备态势配置访问策略以及与 IdP 集成,以零信任网络访问取代传统 VPN。

configuring-windows-event-logging-for-detection

9
from killvxk/cybersecurity-skills-zh

配置 Windows 事件日志与高级审计策略,以生成高质量安全事件用于威胁检测和取证调查。 适用于为登录事件、进程创建、权限使用和对象访问启用审计策略,以支撑 SIEM 检测规则的场景。

configuring-tls-1-3-for-secure-communications

9
from killvxk/cybersecurity-skills-zh

TLS 1.3(RFC 8446)是传输层安全协议的最新版本,在安全性和性能方面相比 TLS 1.2 有显著改进,将握手延迟降低至 1-RTT,移除了过时的密码套件并强制要求完美前向保密。

configuring-suricata-for-network-monitoring

9
from killvxk/cybersecurity-skills-zh

部署和配置 Suricata IDS/IPS,使用 Emerging Threats 规则集、EVE JSON 日志记录和自定义规则, 进行实时网络流量检测(intrusion detection)、威胁检测,并与 SIEM 平台集成实现集中化安全监控。