Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
QuietPhase — 用于 AD 组枚举审计的 Pwsh 工具 | Kitploit
工具/GitHubGitHub/d3lightfu1/quietphase
防御工具侦察身份管理脚本与自动化配置审计入侵检测错误配置事件响应
GitHubd3lightfu1/quietphase

QuietPhase

用于 AD 组枚举审计的 Pwsh 工具

查看仓库
3301个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

QuietPhase

在 Active Directory 侦察演变为入侵之前将其检测出来。

QuietPhase 是一款 PowerShell 工具,用于检查你的域是否已配置为检测组枚举——即攻击者梳理谁拥有特权访问权限的静默侦察阶段。它会验证域控制器的审核策略,报告哪些特权组和自定义组已启用成员读取审核,并提出修复建议(如果你选择,也可以直接应用这些修复)。

大多数组织会在有人更改特权组时发出告警。很少有组织会注意到有人读取特权组。QuietPhase 帮助弥合这一差距,并让你可以轻松设置蜜罐组,将枚举行为转化为高置信度告警。

背景阅读: The Quiet Phase: Why Active Directory Group Enumeration Deserves Your Attention


功能特性

  • 审核策略检查,可针对单个或所有域控制器:
    • Audit Directory Service Access(必需;生成事件 4662)
    • Audit Security Group Management(推荐;为 Builtin 组生成事件 4799)
    • Force audit policy subcategory settings
  • 特权组检查,覆盖 Domain Admins、Enterprise Admins、Schema Admins、Key Admins、Enterprise Key Admins、Group Policy Creator Owners、Administrators、Builtin 操作员组以及 DnsAdmins。组通过 SID 定位,因此可在非英文域中正常工作。
  • AdminSDHolder 感知。 受保护组(adminCount=1)会被 SDProp 重置,因此也会检查并修复 AdminSDHolder。
  • 自定义组选择,支持按部分名称选择,并提供交互式选择器(Out-ConsoleGridView)。可用于蜜罐组或任何你想监视的对象。
  • 彩色编码结果。 绿色表示该组已配置为审核枚举;黄色表示需要更改。
  • 默认安全。 仅报告,不做任何更改。仅在指定 -Apply 时才会进行更改,且每项更改都会要求确认。支持 -WhatIf。
  • 可导出的修复方案。 -FixScriptPath 将所有建议的更改写入可审查的 .ps1 文件,适合变更控制流程。
  • 最小写入。 仅修改对象安全描述符中的 SACL 部分。绝不触碰 DACL。

工作原理

域控制器仅在以下两个条件同时满足时才会记录组枚举事件:

  1. 域控制器上启用了 Audit Directory Service Access(Success)策略。
  2. 该组具有一条 SACL 条目,用于审核 Everyone 或 Authenticated Users 对 member 属性的 Success 读取。

当两者均为真时,每次成员读取都会在响应查询的域控制器上生成 事件 4662。关键字段:

字段值含义
ObjectName%{<objectGUID of the group>}被读取的组
Properties{bf9679c0-0de6-11d0-a285-00aa003049e2}member 属性
Properties{bc0ac240-79a9-11d0-9020-00c04fc2d4cf}成员属性集(通常同时出现)
AccessMask0x10Read Property
SubjectUserName / SubjectUserSid账户执行读取的账户
SubjectLogonId例如 0x3A7F21与事件 4624(TargetLogonId)关联以获取源 IP 和工作站

注意: 基于 SAMR 的工具(如 net group /domain)不会触发此 4662 信号。请通过进程创建日志(事件 4688 / Sysmon / EDR)或网络检测(如 Microsoft Defender for Identity)覆盖该路径。

系统要求

  • PowerShell 7.2 或更高版本(Microsoft.PowerShell.ConsoleGuiTools 要求)。
    • QuietPhase 依赖 Out-ConsoleGridView,它是 Microsoft.PowerShell.ConsoleHost 模块的一部分,而该模块是 Microsoft.PowerShell.ConsoleGuiTools 的依赖项。安装在 CurrentUser 作用域中。
  • ActiveDirectory 模块(RSAT)
  • 提升权限的会话,需为 Domain Admins 成员(林根组需为 Enterprise Admins)。读取和写入 SACL 需要域控制器上的 Manage auditing and security log(SeSecurityPrivilege)权限。
  • 在检查本地计算机以外的审核策略时,需要 WinRM 访问远程域控制器

使用方法

# Report only (default): check the discovered DC, privileged groups, then pick custom groups
.\QuietPhase.ps1

# Check audit policy on every DC in the domain
.\QuietPhase.ps1 -AllDomainControllers

# Export proposed fixes for review or change approval
.\QuietPhase.ps1 -AllDomainControllers -FixScriptPath .\QuietPhase-Fix.ps1

# Preview changes, then apply them (each change is confirmed)
.\QuietPhase.ps1 -Apply -WhatIf
.\QuietPhase.ps1 -Apply

# Propose rules for Authenticated Users instead of Everyone
.\QuietPhase.ps1 -Apply -AuditPrincipal AuthenticatedUsers

参数

参数默认值描述
-Server发现的 DC要作为目标的 DC 或域
-AllDomainControllers关闭检查每个 DC 上的审核策略,而不仅仅是目标 DC
-AuditPrincipalEveryone用于建议规则的主体:Everyone 或 AuthenticatedUsers。检查时任一均视为已配置。
-Apply关闭应用建议的更改,每项更改都会弹出确认提示
-SkipCustomGroups关闭跳过阶段 3(自定义组选择)
-FixScriptPath无将所有建议的修复导出到 .ps1 文件
-WhatIf / -Confirm标准与 -Apply 一起使用时预览更改或控制提示

三个阶段

  1. 审核策略。 如果每个被检查的 DC 上未启用 Audit Directory Service Access,QuietPhase 会打印修复所需的 GPO 路径和 auditpol 命令,然后停止。在此项就位之前,组 SACL 毫无用处。
  2. 众所周知的特权组。 检查每个组的 SACL,并以绿色(已配置)或黄色(需要更改)显示。
  3. 自定义组。 输入部分名称(允许使用通配符),在网格视图中选择匹配项,并按需重复。在空行上按 Enter 结束。

当有任何内容需要更改时,运行结束时会出现一个 NEXT STEPS 块,其中包含可直接粘贴的 -Apply、-WhatIf、-FixScriptPath 或手动 ADUC 步骤命令。

示例输出

==============================================================================
 PHASE 1 - Domain controller audit policy
==============================================================================
  Domain: contoso.com   Target DC: DC01.contoso.com   DCs checked: 1

  DC01.contoso.com
    Audit Directory Service Access:      Success
    Audit Security Group Management:     Success
    Force audit policy subcategory settings: enabled (or default)

  PHASE 1 PASSED: Directory Service Access auditing is enabled.

==============================================================================
 PHASE 2 - Well-known privileged groups
==============================================================================

  Group                                    Status       Protected  Detail
  -----                                    ------       ---------  ------
  Domain Admins                            NeedsChange  Yes        No audit rule for reads of 'member' (2 other audit rule(s))
  Enterprise Admins                        NeedsChange  Yes        No audit rule for reads of 'member' (2 other audit rule(s))
  Schema Admins                            Configured   Yes        Everyone: Success ReadProperty on member (direct)
  Administrators (Builtin)                 NeedsChange  Yes        No audit rule for reads of 'member' (1 other audit rule(s))
  DnsAdmins                                NeedsChange  No         No audit rule for reads of 'member' (0 other audit rule(s))
  AdminSDHolder (DC=contoso,DC=com)        NeedsChange  (template) No audit rule for reads of 'member' (2 other audit rule(s))

  REMEDIATION - well-known privileged groups
  5 object(s) need an audit rule: Everyone | Success | Read member
    - Domain Admins
    - Enterprise Admins
    - Administrators (Builtin)
    - DnsAdmins
    - AdminSDHolder (DC=contoso,DC=com)
    (AdminSDHolder is included because SDProp resets protected groups from it about every 60 minutes.)
  Options for resolving these are listed under NEXT STEPS at the end of the run.

==============================================================================
 SUMMARY
==============================================================================
  Configured   1
  NeedsChange  5
  Unknown      0

  NEXT STEPS
  5 object(s) still need an enumeration audit rule. Choose one of these options:

  1. Apply the changes with this script (you confirm each change):
       .\QuietPhase.ps1 -Apply -WhatIf    # preview only, no changes
       .\QuietPhase.ps1 -Apply

  2. Export a fix script to review, edit, or attach to a change request, then run it elevated:
       .\QuietPhase.ps1 -FixScriptPath '.\QuietPhase-Fix.ps1'

  3. Fix manually in ADUC (View > Advanced Features) or ADSI Edit:
       Group > Properties > Security > Advanced > Auditing > Add: Everyone, Success, This object only, 'Read member'

(输出已省略。在控制台中,已配置的组显示为绿色,需要更改的组显示为黄色。)

故障排除

“Cannot read SACL: A required privilege is not held by the client”(或类似的访问错误) 读取 SACL 需要在 DC 上拥有 Manage auditing and security log(SeSecurityPrivilege)权限。请以 Domain Admin 身份从提升的会话中运行。林根组(Enterprise Admins、Schema Admins、Enterprise Key Admins)需要 Enterprise Admin 权限。

“auditpol.exe failed ... (elevation required)” 本地 auditpol 查询需要提升的会话。对于远程 DC,请确认你是该 DC 上的管理员,并且 WinRM 可访问(Test-WSMan <dc>)。

审计策略显示为“not a recognized (English) auditpol value” QuietPhase 以英文解析 auditpol 输出。在本地化的 DC 上,请使用 auditpol /get /category:* 手动验证该设置。

ConsoleGuiTools 安装失败或 Out-ConsoleGridView 无法打开 确认你使用的是 PowerShell 7.2 或更高版本($PSVersionTable.PSVersion),并且可以访问 PowerShell Gallery。如果 PSGallery 不受信任,请接受提示,或手动运行 Install-Module Microsoft.PowerShell.ConsoleGuiTools -Scope CurrentUser。请在真实终端(Windows Terminal、pwsh 控制台)中运行 QuietPhase,而不是在 VS Code 集成控制台或 ISE 中运行。

某个组显示为“NotFound” 该组可能在此域中不存在(例如,Enterprise Admins 位于林根),或者根域的 DC 不可访问。请检查 DNS 以及到林根的信任连接性。

审计规则从受保护组中消失 具有 adminCount=1 的组会被 SDProp 从 AdminSDHolder 重置。请确保 AdminSDHolder 也带有该审计规则。QuietPhase 会自动检查并提出此建议。

下载工具