AWS - Directory Services / WorkDocs Enum
Reading time: 7 minutes
tip
AWS हैकिंग सीखें और अभ्यास करें:HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें: HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।
Directory Services
AWS Directory Service for Microsoft Active Directory एक प्रबंधित सेवा है जो AWS Cloud में एक निर्देशिका सेट करने, संचालित करने और स्केल करने को आसान बनाती है। यह वास्तविक Microsoft Active Directory पर आधारित है और अन्य AWS सेवाओं के साथ घनिष्ठता से एकीकृत है, जिससे आपके निर्देशिका-सचेत कार्यभार और AWS संसाधनों का प्रबंधन करना आसान हो जाता है। AWS Managed Microsoft AD के साथ, आप अपने मौजूदा Active Directory उपयोगकर्ताओं, समूहों और नीतियों का उपयोग करके अपने AWS संसाधनों तक पहुंच प्रबंधित कर सकते हैं। यह आपकी पहचान प्रबंधन को सरल बनाने और अतिरिक्त पहचान समाधानों की आवश्यकता को कम करने में मदद कर सकता है। AWS Managed Microsoft AD स्वचालित बैकअप और आपदा वसूली क्षमताएं भी प्रदान करता है, जिससे आपकी निर्देशिका की उपलब्धता और स्थिरता सुनिश्चित होती है। कुल मिलाकर, AWS Directory Service for Microsoft Active Directory आपको AWS Cloud में एक प्रबंधित, अत्यधिक उपलब्ध, और स्केलेबल Active Directory सेवा प्रदान करके समय और संसाधनों की बचत करने में मदद कर सकता है।
Options
Directory Services 5 प्रकार की निर्देशिकाएं बनाने की अनुमति देता है:
- AWS Managed Microsoft AD: जो AWS में एक नया Microsoft AD चलाएगा। आप व्यवस्थापक पासवर्ड सेट कर सकेंगे और VPC में DCs तक पहुंच प्राप्त कर सकेंगे।
- Simple AD: जो एक Linux-Samba Active Directory–अनुकूल सर्वर होगा। आप व्यवस्थापक पासवर्ड सेट कर सकेंगे और VPC में DCs तक पहुंच प्राप्त कर सकेंगे।
- AD Connector: आपके मौजूदा Microsoft Active Directory के लिए निर्देशिका अनुरोधों को पुनर्निर्देशित करने के लिए एक प्रॉक्सी, बिना किसी जानकारी को क्लाउड में कैश किए। यह एक VPC में सुन रहा होगा और आपको मौजूदा AD तक पहुंच के लिए क्रेडेंशियल्स देने की आवश्यकता होगी।
- Amazon Cognito User Pools: यह Cognito User Pools के समान है।
- Cloud Directory: यह सबसे सरल है। एक सर्वरलेस निर्देशिका जहां आप उपयोग करने के लिए स्कीमा निर्दिष्ट करते हैं और उपयोग के अनुसार बिल किया जाता है।
AWS Directory services आपके मौजूदा on-premises Microsoft AD के साथ सिंक्रनाइज़ करने, AWS में अपना खुद का चलाने या अन्य निर्देशिका प्रकारों के साथ सिंक्रनाइज़ करने की अनुमति देता है।
Lab
यहां आप AWS में अपना खुद का Microsoft AD बनाने के लिए एक अच्छा ट्यूटोरियल पा सकते हैं: https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_tutorial_test_lab_base.html
Enumeration
# Get directories and DCs
aws ds describe-directories
aws ds describe-domain-controllers --directory-id <id>
# Get directory settings
aws ds describe-trusts
aws ds describe-ldaps-settings --directory-id <id>
aws ds describe-shared-directories --owner-directory-id <id>
aws ds get-directory-limits
aws ds list-certificates --directory-id <id>
aws ds describe-certificate --directory-id <id> --certificate-id <id>
लॉगिन
ध्यान दें कि यदि directory का description फ़ील्ड AccessUrl
में एक domain शामिल है, तो इसका मतलब है कि एक user शायद कुछ AWS services में अपने AD credentials के साथ login कर सकता है:
<name>.awsapps.com/connect
(Amazon Connect)<name>.awsapps.com/workdocs
(Amazon WorkDocs)<name>.awsapps.com/workmail
(Amazon WorkMail)<name>.awsapps.com/console
(Amazon Management Console)<name>.awsapps.com/start
(IAM Identity Center)
विशेषाधिकार वृद्धि
AWS - Directory Services Privesc
स्थिरता
एक AD उपयोगकर्ता का उपयोग करना
एक AD उपयोगकर्ता को एक भूमिका के माध्यम से AWS प्रबंधन कंसोल पर access दिया जा सकता है। डिफ़ॉल्ट उपयोगकर्ता नाम Admin है और इसे AWS कंसोल से पासवर्ड बदलना संभव है।
इसलिए, Admin का पासवर्ड बदलना, एक नया उपयोगकर्ता बनाना या एक उपयोगकर्ता का पासवर्ड बदलना और उस उपयोगकर्ता को एक भूमिका देना संभव है ताकि वह access बनाए रख सके।
यह भी संभव है कि AD के अंदर एक समूह में एक उपयोगकर्ता को जोड़ें और उस AD समूह को एक भूमिका तक पहुंच दें (ताकि यह स्थिरता अधिक छिपी रहे)।
AD साझा करना (पीड़ित से हमलावर तक)
एक पीड़ित से एक हमलावर को AD वातावरण साझा करना संभव है। इस तरह हमलावर AD env तक पहुंचना जारी रख सकेगा।
हालांकि, इसका मतलब है कि प्रबंधित AD को साझा करना और एक VPC पीयरिंग कनेक्शन बनाना भी शामिल है।
आप यहाँ एक गाइड पा सकते हैं: https://docs.aws.amazon.com/directoryservice/latest/admin-guide/step1_setup_networking.html
AD साझा करना (हमलावर से पीड़ित तक)
यह संभव नहीं लगता कि एक अलग AD env से उपयोगकर्ताओं को एक AWS खाते तक AWS access दिया जा सके।
WorkDocs
Amazon Web Services (AWS) WorkDocs एक क्लाउड-आधारित फाइल स्टोरेज और शेयरिंग सेवा है। यह AWS क्लाउड कंप्यूटिंग सेवाओं के सूट का हिस्सा है और संगठनों के लिए फाइलों और दस्तावेजों को स्टोर, शेयर और सहयोग करने के लिए एक सुरक्षित और स्केलेबल समाधान प्रदान करने के लिए डिज़ाइन किया गया है।
AWS WorkDocs उपयोगकर्ताओं को अपनी फाइलों और दस्तावेजों को अपलोड, एक्सेस और प्रबंधित करने के लिए एक वेब-आधारित इंटरफ़ेस प्रदान करता है। यह संस्करण नियंत्रण, वास्तविक समय सहयोग, और अन्य AWS सेवाओं और तृतीय-पक्ष उपकरणों के साथ एकीकरण जैसी सुविधाएँ भी प्रदान करता है।
गणना
# Get AD users (Admin not included)
aws workdocs describe-users --organization-id <directory-id>
# Get AD groups (containing "a")
aws workdocs describe-groups --organization-id d-9067a0285c --search-query a
# Create user (created inside the AD)
aws workdocs create-user --username testingasd --given-name testingasd --surname testingasd --password <password> --email-address name@directory.domain --organization-id <directory-id>
# Get what each user has created
aws workdocs describe-activities --user-id "S-1-5-21-377..."
# Get what was created in the directory
aws workdocs describe-activities --organization-id <directory-id>
# Get folder content
aws workdocs describe-folder-contents --folder-id <fold-id>
# Get file (a url to access with the content will be retreived)
aws workdocs get-document --document-id <doc-id>
# Get resource permissions if any
aws workdocs describe-resource-permissions --resource-id <value>
# Add permission so anyway can see the file
aws workdocs add-resource-permissions --resource-id <id> --principals Id=anonymous,Type=ANONYMOUS,Role=VIEWER
## This will give an id, the file will be acesible in: https://<name>.awsapps.com/workdocs/index.html#/share/document/<id>
प्रिवेस्क
tip
AWS हैकिंग सीखें और अभ्यास करें:HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें: HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।