Cookie Consent by Free Privacy Policy Generator 📌 ShadowSpray - A Tool To Spray Shadow Credentials Across An Entire Domain In Hopes Of Abusing Long Forgotten GenericWrite/GenericAll DACLs Over Other Objects In The Domain

🏠 Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeiträge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden Überblick über die wichtigsten Aspekte der IT-Sicherheit in einer sich ständig verändernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch übersetzen, erst Englisch auswählen dann wieder Deutsch!

Google Android Playstore Download Button für Team IT Security



📚 ShadowSpray - A Tool To Spray Shadow Credentials Across An Entire Domain In Hopes Of Abusing Long Forgotten GenericWrite/GenericAll DACLs Over Other Objects In The Domain


💡 Newskategorie: IT Security Nachrichten
🔗 Quelle: kitploit.com


A tool to spray Shadow Credentials across an entire domain in hopes of abusing long forgotten GenericWrite/GenericAll DACLs over other objects in the domain.

Why this tool

In a lot of engagements I see (in BloodHound) that the group "Everyone" / "Authenticated Users" / "Domain Users" or some other wide group, which contains almost all the users in the domain, has some GenericWrite/GenericAll DACLs over other objects in the domain.


These rights can be abused to add Shadow Credentials on the target object and obtain it's TGT and NT Hash.

It occurred to me that we can just try and spray shadow credentials over the entire domain and see what's sticks (obviously this approach is better suited to non-stealth engagements, don't use this in a red team where stealth is required). When a Shadow Credentials is successfuly added, we simply do the whole PKINIT + UnPACTheHash dance and voilà - we get NT Hashes.

Since the process is extremely fast, this can be used at the very start of the engagement, and hopefully you'll have some users and computers owned before you even start.

Note: I recycled a lot of code from my previous tool so AV/EDRs might flag this as KrbRelayUp...

How this tool works

It goes something like this:

  1. Login to the domain with the supplied credentials (Or use the current session).
  2. Check that the domain functional level is 2016 (Otherwise stop since the Shadow Credentials attack won't work)
  3. Gather a list of all the objects in the domain (users and computers) from LDAP.
  4. For every object in the list do the following:
    1. Try to add KeyCredential to the object's "msDS-KeyCredentialLink" attribute.
    2. If the above is successful, use PKINIT to request a TGT using the added KeyCredential.
    3. If the above is successful, perform an UnPACTheHash attack to reveal the user/computer NT hash.
    4. If --RestoreShadowCred was specified: Remove the added KeyCredential (clean up after yourself...)
  5. If --Recursive was specified: Do the same process using each of the user/computer accounts we successfully owned.

ShadowSpray supports CTRL+C so if at any point you wish to stop the execution just hit CTRL+C and ShadowSpray will display the NT Hashes recovered so far before exiting (as shown in the demo below).

Usage

 __             __   __        __   __   __
/__` |__| /\ | \ / \ | | /__` |__) |__) /\ \ /
.__/ | | /~~\ |__/ \__/ |/\| .__/ | | \ /~~\ |


Usage: ShadowSpray.exe [-d FQDN] [-dc FQDN] [-u USERNAME] [-p PASSWORD] [-r] [-re] [-cp CERT_PASSWORD] [-ssl]

-r (--RestoreShadowCred) Restore "msDS-KeyCredentialLink" attribute after the attack is done. (Optional)
-re (--Recursive) Perform ShadowSpray attack recursivly. (Optional)
-cp (--CertificatePassword) Certificate password. (default = random password)


General Options:
-u (--Username) Username for initial LDAP authentication. (Optional)
-p (--Password) Password for initial LDAP authentication. (Optional)
-d (--Domain) FQDN of domain. (Optional)
-dc (--DomainController) FQDN of domain controller. (Optional)
-ssl Use LDAP over SSL. (Optional)
-y (--AutoY) Don't ask for confirmation to start the ShadowSpray attack. (Optional)

TODO

  • Code refactoring and cleanup!!!
  • Add Verbose output option
  • Add option to save KeyCredentials added / TGT requested / NT Hashes gathered to a file on disk
  • Python version ;)
  • Other suggestions will be welcomed

Mitigation and Detection

Taken from Elad Shamir's blog post on Shadow Credentials:

  • If PKINIT authentication is not common in the environment or not common for the target account, the “Kerberos authentication ticket (TGT) was requested” event (4768) can indicate anomalous behavior when the Certificate Information attributes are not blank.

  • If a SACL is configured to audit Active Directory object modifications for the targeted account, the “Directory service object was modified” event (5136) can indicate anomalous behavior if the subject changing the msDS-KeyCredentialLink is not the Azure AD Connect synchronization account or the ADFS service account, which will typically act as the Key Provisioning Server and legitimately modify this attribute for users.

  • A more specific preventive control is adding an Access Control Entry (ACE) to DENY the principal EVERYONE from modifying the attribute msDS-KeyCredentialLink for any account not meant to be enrolled in Key Trust passwordless authentication, and particularly privileged accounts.

  • Detecting UnPACing and shadowed credentials by Henri Hambartsumyan of FalconForce

ShadowSpray specific detections:

  • This tool attempts to modify every user/computer object in the domain in a very short timeframe, when it fails (most of the time) it generates an LDAP_INSUFFICIENT_ACCESS error. It's possible to build detection around that using the same approach of detecting regular password spray.

Acknowledgements



...



📌 Lightbend Spray spray-json up to 1.3.4 Hash Code JSON Object denial of service


📈 37.99 Punkte

📌 Lightbend Spray spray-json up to 1.3.4 Field Parser Complexity denial of service


📈 37.99 Punkte

📌 Medium CVE-2020-5800: Eat spray love project Eat spray love


📈 37.99 Punkte

📌 Medium CVE-2020-5799: Eat spray love project Eat spray love


📈 37.99 Punkte

📌 The Long, Long History of Long, Long CVS Receipts


📈 37.94 Punkte

📌 Many Nations Pin Climate Hopes On China, India As Hopes For Trump Fade


📈 34.59 Punkte

📌 BloodHound up to 4.0.1 GenericAll.jsx objectId command injection


📈 33.27 Punkte

📌 Spray - A Password Spraying Tool For Active Directory Credentials By Jacob Wilkin(Greenwolf)


📈 32.41 Punkte

📌 Abusing COM And DCOM Objects


📈 28.7 Punkte

📌 Lazarus pivots to Linux attacks through Dacls Trojan


📈 28.54 Punkte

📌 Lazarus Hackers Target Linux, Windows With New Dacls Malware


📈 28.54 Punkte

📌 Dacls RAT, the first Lazarus malware that targets Linux devices


📈 28.54 Punkte

📌 Lazarus APT Hackers Group Attack Linux & Windows Platform Using Dacls RAT


📈 28.54 Punkte

📌 North Korean Hackers Release Mac Variant of Dacls RAT


📈 28.54 Punkte

📌 North Korea-linked Lazarus APT uses a Mac variant of the Dacls RAT


📈 28.54 Punkte

📌 Oracle PeopleSoft Enterprise FIN Common Application Objects Common Objects cross site scripting


📈 28.03 Punkte

📌 ES6 Map an Array of Objects to Return an Array of Objects With New Keys


📈 28.03 Punkte

📌 Typescript type grouping a union type of objects by any property discriminating these objects.


📈 28.03 Punkte

📌 Everyday objects as JavaScript objects


📈 28.03 Punkte

📌 Purging Long-Forgotten Online Accounts: Worth the Trouble?


📈 26.09 Punkte

📌 Powershell, the Gandcrab infection and the long-forgotten server


📈 26.09 Punkte

📌 Powershell, the Gandcrab infection and the long-forgotten server


📈 26.09 Punkte

📌 A Long-Forgotten Law Could Force the U.S. to Re-Evaluate its Relationship with Saudi Arabia


📈 26.09 Punkte

📌 DEF CON Safe Mode Erik Hunstad Domain Fronting is Dead Long Live Domain Fronting Q&A


📈 24.84 Punkte

📌 SprayWMI – PowerShell Injection Mass Spray Tool


📈 24.37 Punkte

📌 SprayWMI – PowerShell Injection Mass Spray Tool


📈 24.37 Punkte

📌 curl: Abusing URL Parsers by long schema name


📈 24.17 Punkte

📌 pywhisker: Python tool for Shadow Credentials attacks


📈 24.03 Punkte

📌 New satellite mapping with AI can quickly pinpoint hurricane damage across an entire state ...


📈 23.56 Punkte

📌 Solving The AppSec Dilemma Across the Entire SDLC


📈 23.56 Punkte











matomo