Persistence (Part 3)
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.
ACLs
AdminSDHolder container exist in every AD domain and its Access Control List (ACL) can be used as a template to copy permissions to all protected groups. A process known as SDProp takes the ACL of the AdminSDHolder container and applies it to all protected groups every 60 minutes. If the blue team is unaware of this persistence, then, every time they remove the inappropriate permission on the protected object or groups, it will reappear within an hour. Since this reconstruction occurs via normal AD process, it would not show any alert, making it more difficult to pinpoint the source of the persistence.
GPOs
They are also excellent in deploying persistence. A penetration tester can hide GPO in a way that it becomes almost impossible to remove it. Some common GPO persistence techniques are:
- Restricted Group Membership- It can allow administrative access to all hosts in the domain.
- Logon Script Deployment- It makes sure to get a shell callback every time a user authenticate to a host in the domain.
Numerous hooks are available for deployment. Even though it's good to have access to every host, it could be even better if we could make sure we could access them when administrators were actively working on them. In order to accomplish this, we will establish a GPO connected to the Admins OU, enabling a shell on a host each time one of them logs in.
Conclusion
A penetration tester can linger in an AD environment in a number of ways.
A few of these methods are more durable than others. Depending on the environment and the various configurations he has at his disposal, he must consider innovative ways to deploy the persistence so that the blue team is unable to remove it. Moreover, he shouldn't put off deploying persistence until after the entire domain has been compromised. Persistence should be used following each round of lateral movement and privilege escalation. Other viable options for the penetration testers are:
- Computer Accounts
- Skeleton Keys
- Directory Service Restore Mode (DSRM)
- Malicious Security Support Provider (SSP)
Comments
Post a Comment