Add WriteSPN support for computer objects#7
Add WriteSPN support for computer objects#7fkxdr wants to merge 4 commits intoshellinvictus:masterfrom
Conversation
Mirror the existing WriteSPN(user) chain for computer objects, covering WriteSPN, GenericWrite and WriteDacl/DaclServicePrincipalName edges. Enables detection of targeted Kerberoasting paths where an attacker controls the servicePrincipalName attribute of a computer account (e.g. clearing an SPN from one host and registering it on another to request a roastable TGS).
|
Hi! Thank you for the proposal. Are you talking about the SPN-Jacking? That's very interesting scenarios (Ghost + Live) that i never tried, i'll do it when i have time! I see 4 problems with your patch. 1. Scenario prioritiesI think we should keep easy scenarios to be proposed first. The config.ml executes paths in the order they are defined. It means that with your patch, if we have GenericWrite or WriteDACL, the SPNJacking will be proposed before RBCD and Shadow Credential. We can do instead something like that: We can also create a flag to force the execution of WriteSPN instead of all others. 2. KerberoastingThe action Also, if you write 3. Require statementIf we have a WriteSPN on a computer, we need another computer where we are admin, and i think the full path generation is a bit more complicated. So we need to write in config.ml a requirement statement. Maybe something like this: I think the
So the above path means: for a WriteSPN on a computer, take ONE arbitrary owned user or computer (from the owned file, or temporary owned before on the current path). Then pass the "require" object to SPN_Jacking. 4. Terminal statementYou need a terminal statement. If not, GriffonAD will reject the path and will never print it. Available terminal statements are:
That could be amazing if you can rework the PR to implement SPN-Jacking scenarios :) Thank you for your contribution! |
Add SPN-Jacking attack path for computer objects, covering WriteSPN, GenericWrite and WriteDacl/DaclServicePrincipalName edges.
Add Jinja2 template for the SPNJacking action. Covers all four auth contexts (krb, nthash, aeskey, password). Uses require['object'].
|
Hi! Yes exactly, as I spotted the path missing in a recent assessment.
ps. thanks for this awesome tool. |
|
Nice! Let me a few days to test in details the SPN Jacking before merging. I've still some remarks: 1. stop + secretsdump replacementI understand that the exploitation depends on the SPN we have hijacked. But in the case we can secretsdump the target, i think it would be better to do like if we have owned it because we can continue the chain. Or is it possible to always hijack a HOST/ SPN? We can avoid to write the secretsdump command in SPNJacking.jinja2, we have instead 2 solutions: I think the first solution is better because the user can see the result of the secretsdump. Moreover, i don't know if in the case of the SPN Jacking, the second will work. 2. addpspn.py: replace clear by flushThere is just a small mistake with my tool addspn.py: the option The modification of PS: thank you very much for the feedback :) |
|
It let me think that an interactive tool could be interesting to let the user choose between scenarios when more than one exists. |
|
Hi! The SPN Jacking is not so easy to implement in Griffon as i thought... This scenario is interesting in the case we have the password of a computer with a KCD and when we have a WriteSPN on two objects: one with the constrained SPN and one on an other object (for the live SPN Jacking, the ghost requires only the first). The problem with your proposal to handle this in the GenAll -> GenWrite -> WriteSPN, is that when we call the Because this scenario is interesting for constrained delegations, i think it would be better to handle it after the I'm working to try to implement the live and the ghost. |
|
Hi, thanks for the detailed breakdown! It might be worth considering whether a simpler (This is also referenced in the post you linked, the targeted Kerberoasting as the baseline WriteSPN abuse case, with SPN-Jacking being the alternative edge case on top of it.) |
|
Hi! I've finally implemented the Live + Ghost scenarios, not so easily... I needed to completely rethink about it. I've added you as a co-author of the commit. This new version is able to search automatically all requirements to exploit a live or ghost spn jacking. It can also generates the full code to exploit it (-> secretsdump). Thanks for the Kerberoasting approach, i maybe missed it. I will take a look a next time! |
Mirror the existing WriteSPN(user) chain for computer objects, covering WriteSPN, GenericWrite and WriteDacl/DaclServicePrincipalName edges.
Enables detection of targeted Kerberoasting paths where an attacker controls the servicePrincipalName attribute of a computer account (e.g. clearing an SPN from one host and registering it on another to request a roastable TGS).