Persistence (Part 2)

 





Overview

Deploying persistence by a penetration tester is important during penetration testing assessment. Hence, implementing persistence throughout the AD compromise process, the tester can ensure that his access cannot easily be revoked by the blue team. 

SID History

A Security Identifier (SID) is a unique value assigned by the Windows operating system to security principals such as users and groups. A penetration tester can try to exploit it to achieve persistence by attempting take control of an SID assigned to a high-privilege security principal like domain administrator. SIDs are used for tracking the security principal and the account's access while connecting to resources. However, there is another attribute on accounts called the SID History.

The main use of SID History is to enable access for an account to effectively be cloned to another. Although it is good for migration, the penetration tester can still take advantage of this feature and use it for persistence. This persistence technique requires:

  • Domain admin privileges or equivalent. 

  • Whenever an account creates a logon event, the SIDs associated with the account are added to the user's token, which determines the privileges associated with the account. This includes group SIDs.

  • Can take this attack a step further if Enterprise Admin SID is injected. It would elevate the account's privileges to effectively be Domain Admin in all domains in the forest.

  • Since SIDs are added to the user's token, privileges would be respected even if the account is not a member of the actual group. 

Group Membership

Generally, privileged groups are monitored more closely for changes than others. So, the penetration tester has to get more creative regarding the groups to be added for persistence-
  • The IT Support group can used to get privilege like force changing user passwords. Although, in most cases, the passwords of privileged users cannot be reset, gaining ability to even reset the low-privileged ones will allow the spread to workstations. 

  • Groups that offers local administrators right are generally not monitored closely. With local administrator rights to the correct hosts through the group membership of a network support group, a good persistence can be gained to compromise the domain again. 

  • It is not always about direct privileges. Sometimes groups with indirect privileges, such as ownership over GPOs can be just as good for persistence. 

Also, recursive group is a group that is a member of another group. Group nesting is used to create a more organized structure in AD. However, it reduces the visibility of effective access which also becomes a monitoring problem. So, a penetration tester can make use of this reduced visibility to perform persistence. He will focus on the subgroups. Rather than adding his account to a privileged group, he will add it to a subgroup that is not being monitored. 

Conclusion

In this part, two more penetration techniques and their various methods are discussed.






































Comments

Popular posts from this blog

Query, Visualize, & Monitor Data in Azure Sentinel

Planning for Implementing SAP Solutions on Azure (Part 2 of 5)

Work with String Data Using KQL Statements