Repository navigation
Add badsuccessor attack example - #2010
Conversation
|
Good job! I was trying to implement this last weeks without success, mostly due to my lack of knowledge on (py)ASN1. Your solution helps me a lot thanks! 🌻 |
Thank you. I appreciate it. Will be here if any adjustments would be necessary to merge it. |
|
Do you think it is possible to put the current/previous keys in an attribute of the GETST object ? This would allow these values to be used in a script for example. Thanks EDIT: My bad, it is not possible to import an example, maybe it would be better in impacket/krb5/kerberosv5.py 🤷 🌻 |
I can move the key extraction process into the function in kerberosv5.py and just return a dict with keys. Is that the solution you were looking for? |
…R_CLIENT_REVOKED error
I added additional message to error handling to match one in Rubeus: GhostPack/Rubeus#194.
On the keys question: Are you sure it is necessary? I was planning to use it as a "local solution" at least for the time being. |
|
Nice @fulc2um !!! |
|
Thanks, it is basically just a "for loop" around 🌻 |
|
Hello @fulc2um, as per my understanding, DMSA requires a 2025 DC server to exploit. When I run in an environment without the 2025 server using the search option, it shows vulnerable OUs and shows a few identities. What does it mean? |
I forgot to add the DC25/Schema Update check. Mainly because my testing environment is based on Server 2025. Search function is based on original .ps1 script from researchers from Akamai (you can see the link to the script and to the research in description to PR). They mention in their research:
So I would interpret that as you have OUs where certain identities are allowed to create objects. While I was thinking about it, you can interpret the results in the following way: if you get results back for a domain without server 2025, that means that when it gets introduced to the domain, there is an easy attack path to DA. |
gabrielg5
left a comment
There was a problem hiding this comment.
Hey @fulc2um, thanks for this PR! awesome work!!
Been reviewing the code and added a couple inline comments... also there a couple "global" suggestions I wanna make:
- Can you change the
printfor leveraging theloggingmethods - There are 2 different parameters for setting
ldaps. Perhaps is better unify both in 1? As they will need to be equal in all scenarios I guess right? - Some parameters description specify default values if ommited; but they are being validated as "mandatory" when running given action (
-principal-allowedforadd, ie)... these scenarios should be aligned so to not require them
Let me know your insights on this.. great work!
Thank you
2. Unified ldaps parameters 3. Renamed PA_DMSA_KEY_PACKAGE to KRB_DMSA_KEY_PACKAGE 4. Refactored ldapConnection to utilize impacket.examples.utils.init_ldap_session 5. Removed "double try" for search_ous replacing with a single one with specified controls value 6. Additional minor fixes
…or other arguments
…eviously modification of the entry was not impossible with INSUFF_RIGHTS 2. Added modify_dmsa function 3. Cleaned up unused imports
|
Merging now! 🚀 |





Added badsuccessor.py example based on the AKAMAI research (https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory)
Examples:
Low privileged user info:
Search:

Add:

Delete:

Modify:

Ticket request and code execution:
