Learn how to extend initial access to a user into persistent access by requesting a client authentication certificate in the context of the user account.
PERSIST1 is a technique used to extend initial access to a user into persistent access by requesting a client authentication certificate in the context of the user account, which can be used for future authentication as the user account. If, for example, a phishing attack is successful and access is obtained as a user for which the credentials are unknown, persistent access to that user can be obtained through certificates.
According to Certified Pre-Owned, a suitable certificate template must meet these criteria:
Enterprise CA Enrollment Rights
The enterprise CA grants enrollment rights to the user account. Otherwise, the account would be unable to request any certificates from the CA.
Template Enrollment Rights
The certificate template grants enrollment rights to the user account. Otherwise, the account would be unable to request certificates based on the specific template.
Manager Approval Disabled
The “manager approval” feature is disabled for the certificate template. Otherwise, a “CA Manager” would have to manually review and approve the certificate request.
Authorized Signature Disabled
The “authorized signature” feature is disabled for the certificate template. Otherwise, an enrollment agent would need to sign the certificate request on behalf of the requester.
Client Authentication EKU
The certificate template defines an Extended Key Usage (EKU) that enables client authentication:
Use --filter-enabled to only show templates published by a CA and --hide-admins to reduce noise in the output.
Once we have identified a suitable certificate template that the user account can enroll in, we can request a certificate based on the template using the request command from Certify.
Copy
Ask AI
> Certify.exe request --ca ca01.corp.local\CORP-CA01-CA --template User _____ _ _ __ / ____| | | (_)/ _| | | ___ _ __| |_ _| |_ _ _ | | / _ \ '__| __| | _| | | | | |___| __/ | | |_| | | | |_| | \_____\___|_| \__|_|_| \__, | __/ | |___./ v2.0.0[*] Action: Request a certificate[*] Current user context : CORP\lowpriv[*] No subject name specified, using current context as subject.[*] Template : User[*] Subject : CN=lowpriv, OU=Users, OU=Corp, DC=corp, DC=local[*] Certificate Authority : ca01.corp.local\CORP-CA01-CA[*] CA Response : The certificate has been issued.[*] Request ID : 1[*] Certificate (PFX) :MIACAQMwgAYJKoZIhvcNAQcBoIAkgASCA+gwgDCABgkqh...Certify completed in 00:00:04.3614718
When the certificate has been issued, it can be used to persistently authenticate as the user account using the asktgt command from Rubeus. We can also use the /getcredentials parameter to request a U2U service ticket and retrieve the password NT hash for the user account.
The issued certificate will be able to authenticate for as long as is mentioned in the Validity Period attribute of the certificate template. In order to extend the persistence period, you need to abuse PERSIST3 - Account Persistence via Certificate Renewal.