Active Directory Security Tip #14: Group Managed Service Accounts (GMSAs)
嗯,用户让我帮忙总结一篇文章的内容,控制在100字以内,而且不需要用“文章内容总结”或者“这篇文章”这样的开头。直接写描述就行。 首先,我得仔细阅读文章内容。文章主要讲的是Group Managed Service Accounts(GMSAs),这是Windows 2012引入的特性。GMSAs由AD管理密码,自动更新,减少了手动管理的麻烦。但这也带来了安全风险,因为如果有攻击者获得了访问密码的权限,就可能控制整个AD。 文章还提到了几个关键点:GMSA的密码由AD管理,计算机需要请求密码来启动服务,配置GMSA允许特定计算机访问密码。如果攻击者控制了这些计算机或有权请求密码的账户,GMSA就会被攻破。 然后是对象类和属性,比如msDS-GroupMSAMembership、msds-ManagedPassword等。这些属性定义了哪些主体可以访问密码以及密码的管理策略。 最后是实验室的例子,使用PowerShell脚本Get-ADServiceAccount来查找GMSAs,并展示了一个实际案例中GMSA被配置在Domain Admins组中,导致潜在的安全风险。 用户的需求是简明扼要地总结内容。我需要抓住主要点:GMSAs的功能、自动密码管理、潜在的安全风险、关键属性和实验室示例。 现在组织语言:控制在100字以内,直接描述内容。确保涵盖所有关键点而不遗漏重要信息。 可能的结构:介绍GMSAs及其优势→自动密码管理→安全风险→关键属性→实验室示例→结论中的安全建议。 这样就能在有限字数内全面概括文章内容了。 </think> 本文介绍了Group Managed Service Accounts(GMSAs)的功能与安全性。GMSAs由Active Directory管理密码并自动更新,但若攻击者获取访问权限或控制相关计算机,则可能导致AD被攻破。关键属性包括msDS-GroupMSAMembership和msds-ManagedPassword等。实验室示例展示了如何通过PowerShell查找和分析GMSAs,并强调了配置不当可能导致的安全风险。 2025-11-5 01:3:0 Author: adsecurity.org(查看原文) 阅读量:43 收藏

Nov 04 2025

Group Managed Service Accounts (GMSAs)

User accounts created to be used as service accounts rarely have their password changed. Group Managed Service Accounts (GMSAs) provide a better approach (starting in the Windows 2012 timeframe). The password is managed by AD and automatically changed. This means that the GMSA has to have security principals explicitly delegated to have access to the clear-text password. Much like with other areas where delegation controls access (LAPS), determining who should have be delegated access needs to be be carefully considered.

Key Points for Group Managed Service Accounts (GMSAs)

  • The GMSA password is managed by AD.
  • Computers hosting GMSA service account(s) request the current password from Active Directory to start the associated service.
  • Configure the GMSA to allow computer account(s) access to the GMSA password.
  • If an attacker compromises any computer hosting services using the GMSA, the GMSA is compromised.
  • If attacker compromises an account with rights to request the GMSA password, the GMSA is compromised.

Group Managed Service Accounts have the object class “msDS-GroupManagedServiceAccount” and associated attributes specific to GMSAs. These properties include:

  • msDS-GroupMSAMembership (PrincipalsAllowedToRetrieveManagedPassword) – stores the security principals that can access the GMSA password.
  • msds-ManagedPassword – This attribute contains a BLOB with password information for group-managed service accounts.
  • msDS-ManagedPasswordId – This constructed attribute contains the key identifier for the current managed password data for a group MSA.
  • msDS-ManagedPasswordInterval – This attribute is used to retrieve the number of days before a managed password is automatically changed for a group MSA.

Lab Example

In order to identify GMSAs in an Active Directory domain, we can use the Active Directory PowerShell cmdlet “Get-ADServiceAccount”.

get-adserviceaccount -filter * -prop * | Select Name,DNSHostName,MemberOf,Created,LastLogonDate,PasswordLastSet,msDS-ManagedPasswordInterval,PrincipalsallowedtoDelegateToAccount,PrincipalsAllowedtoRetrieveManagedPassword,msDS-ManagedPassword,ServicePrincipalName | Sort Name

In my lab environment (mirroring what I’ve seen in real world AD environments), we notice that there is a GMSA in Domain Admins. Let’s dig into that one.

The Citrix GMSA is configured to allow the group “Citrix04” the ability to get the password for the GMSA (property “PrincipalsAllowedToRetrieveManagedPassword”). Now, let’s take a look at the membership of that group.

There’s a user account in that group which means compromise of that user account (AdminJackson) would result in the compromise of the password for the Citrix GMSA and that would result in the compromise of Active Directory since the GMSA is a member of Domain Admins.

I wanted to make it easier to get this information, so I wrote a PowerShell script called Get-GMSADetail that captures this information using the Active Directory PowerShell module. This adds a new property called “PasswordAccessPrincipalString which is a list of principals in the group that have the rights to pull the password.
The results are shown here:

Conclusion

As part of this lab exercise, we learned that if a GMSA is a member of a privileged group (like Domain Admins), compromise of an account that has rights to pull the clear-text password for the GMSA (property “PrincipalsAllowedToRetrieveManagedPassword”) can leverage the GMSA rights (like compromise Active Directory). Furthermore, if we can compromise one of the computer accounts that have the ability to pull the GMSA password, then we can dump the password from the computer.

For more information about attacking GMSAs, read the ADSecurity article “Attacking Active Directory Group Managed Service Accounts (GMSAs)

(Visited 12 times, 12 visits today)

Sean Metcalf

I improve security for enterprises around the world working for TrustedSec & I am @PyroTek3 on Twitter.
Read the About page (top left) for information about me. :)
https://adsecurity.org/?page_id=8


文章来源: https://adsecurity.org/?p=4904
如有侵权请联系:admin#unsafe.sh