Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESC7 - Error when attempting to add an officer #33

Closed
jsdhasfedssad opened this issue Feb 24, 2022 · 8 comments
Closed

ESC7 - Error when attempting to add an officer #33

jsdhasfedssad opened this issue Feb 24, 2022 · 8 comments

Comments

@jsdhasfedssad
Copy link

jsdhasfedssad commented Feb 24, 2022

When attemting to exploit ESC7 and the account I use for authentication does not have the right Manage Certificates, I must add that account as a new officer in order to grant the account that right. This fails for me using Certipy 2.0.6.
esc7_dc1

Once this works, can I delete/remove the officer and possibly other remaining changes after the attack?

@ly4k
Copy link
Owner

ly4k commented Feb 24, 2022

Yes, you can remove the CA officer afterwards with -remove-officer. The request fails because you're trying to connect to the DC. You should connect to the CA

@jsdhasfedssad
Copy link
Author

I actually tried connecting to the ADCS server when I tested this but that failed as well :)
esc7_server2

@ly4k
Copy link
Owner

ly4k commented Feb 24, 2022

The second image makes more sense to me. It's a mistake in my implementation. I accidentally assumed the CA and the DC was on the same server, which results in Certipy trying to connect to LDAP on the CA, or connecting to the CA DCOM on the DC. Thanks for reporting this. I'll look into a fix soon

@ly4k
Copy link
Owner

ly4k commented Feb 25, 2022

Should be fixed in 2.0.8. Can you please verify?

@jsdhasfedssad
Copy link
Author

Using 2.0.8 I can now add the officer. Good!
esc7_3

The next step in my case is to enable the certificate template SubCA but that fails for me.
esc7_2

@ly4k
Copy link
Owner

ly4k commented Feb 25, 2022

Should be fixed in 2.0.9. The new LDAP DNS resolution was not applied for the -enable-template. Can you verify that it is working now? I really appreciate that you report these issues. Thanks!

@jsdhasfedssad
Copy link
Author

jsdhasfedssad commented Feb 25, 2022

Great! This works now. I actually managed to execute the complete ESC7 attack this time. Don't worry about asking me to verify fixes, I will have so much fun owning my client's infrastructure using your tool :D No more hassle having to own a domain-joined machine, bypass AV, AMSI, Applocker, execution policies, language constrained mode and what not then having to upload and import powershell scripts! All I need now is essentially Responder, Hashcat, Bloodhound, BloodyAD, Impacket and Certipy :D

@ly4k
Copy link
Owner

ly4k commented Feb 25, 2022

Great. Haha yes, Active Directory itself is full of attack vectors

@ly4k ly4k closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants