executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
configuring-windows-defender-advanced-settings配置 Microsoft Defender for Endpoint(MDE)高级防护设置,包括攻击面缩减规则、受控文件夹访问、 网络保护和漏洞利用防护。适用于在默认 Defender 设置基础上加固 Windows 端点、部署企业级端点防护 或满足高级恶意软件防御合规要求的场景。
Independent GitHub snapshot · Automated classification · Original documentation governs
在以下情况下使用本技能:
不适用于第三方 EDR 部署(CrowdStrike、SentinelOne)或 Microsoft Defender for Cloud(Azure 工作负载保护)。
ASR 规则阻断恶意软件和攻击者常用的特定行为:
# 通过 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
# 启用受控文件夹访问
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 日志中
# 启用网络保护(阻断到恶意域/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 内容过滤 → 添加策略
# 需要阻断的类别:恶意软件、钓鱼、成人内容、高带宽
# 导出当前漏洞利用防护设置
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"
# 启用云提供的防护(实时威胁情报)
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
# 配置实时保护
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 门户管理:
# 设置 → 端点 → 高级功能 → 防篡改保护:开启
Intune 部署路径:
1. 端点安全 → 攻击面缩减 → 创建配置文件
- 平台:Windows 10 及更高版本
- 配置文件:攻击面缩减规则
- 将每条 ASR 规则配置为阻断或审计
2. 端点安全 → 防病毒 → 创建配置文件
- Microsoft Defender 防病毒
- 配置:云保护、PUA、实时保护
3. 端点安全 → 防病毒 → 创建配置文件
- Microsoft Defender 防病毒排除项
- 为业务应用程序添加路径/进程/扩展名排除项
4. 设备 → 配置文件 → 创建配置文件
- 端点保护 → Microsoft Defender Exploit Guard
- 配置:受控文件夹访问、网络保护
仪表板监控:
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 安全设置进行未授权更改,即使是本地管理员也不行 |