mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-09 19:55:04 -08:00
Translated ['src/pentesting-cloud/azure-security/az-privilege-escalation
This commit is contained in:
@@ -1,37 +1,38 @@
|
||||
# GCP - स्रोत रिपॉजिटरी एनम
|
||||
# GCP - Source Repositories Enum
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## बुनियादी जानकारी <a href="#reviewing-cloud-git-repositories" id="reviewing-cloud-git-repositories"></a>
|
||||
## Basic Information <a href="#reviewing-cloud-git-repositories" id="reviewing-cloud-git-repositories"></a>
|
||||
|
||||
Google Cloud Source Repositories एक पूर्ण विशेषताओं वाला, स्केलेबल, **निजी Git रिपॉजिटरी सेवा** है। इसे **आपके स्रोत कोड को पूरी तरह से प्रबंधित वातावरण में होस्ट करने** के लिए डिज़ाइन किया गया है, जो अन्य GCP उपकरणों और सेवाओं के साथ सहजता से एकीकृत होता है। यह टीमों के लिए अपने कोड को स्टोर, प्रबंधित और ट्रैक करने के लिए एक सहयोगी और सुरक्षित स्थान प्रदान करता है।
|
||||
Google Cloud Source Repositories is a fully-featured, scalable, **private Git repository service**. It's designed to **host your source code in a fully managed environment**, integrating seamlessly with other GCP tools and services. It offers a collaborative and secure place for teams to store, manage, and track their code.
|
||||
|
||||
Cloud Source Repositories की प्रमुख विशेषताएँ शामिल हैं:
|
||||
Key features of Cloud Source Repositories include:
|
||||
|
||||
1. **पूर्ण प्रबंधित Git होस्टिंग**: Git की परिचित कार्यक्षमता प्रदान करता है, जिसका अर्थ है कि आप नियमित Git कमांड और वर्कफ़्लो का उपयोग कर सकते हैं।
|
||||
2. **GCP सेवाओं के साथ एकीकरण**: कोड से डिप्लॉयमेंट तक अंत-से-अंत ट्रेसबिलिटी के लिए Cloud Build, Pub/Sub, और App Engine जैसी अन्य GCP सेवाओं के साथ एकीकृत होता है।
|
||||
3. **निजी रिपॉजिटरी**: सुनिश्चित करता है कि आपका कोड सुरक्षित और निजी रूप से स्टोर किया गया है। आप Cloud Identity और Access Management (IAM) भूमिकाओं का उपयोग करके एक्सेस को नियंत्रित कर सकते हैं।
|
||||
4. **स्रोत कोड विश्लेषण**: आपके स्रोत कोड का स्वचालित विश्लेषण प्रदान करने के लिए अन्य GCP उपकरणों के साथ काम करता है, संभावित मुद्दों जैसे बग, कमजोरियों, या खराब कोडिंग प्रथाओं की पहचान करता है।
|
||||
5. **सहयोग उपकरण**: मर्ज अनुरोध, टिप्पणियाँ, और समीक्षाओं जैसे उपकरणों के साथ सहयोगात्मक कोडिंग का समर्थन करता है।
|
||||
6. **मिरर समर्थन**: आपको Cloud Source Repositories को GitHub या Bitbucket पर होस्ट किए गए रिपॉजिटरी के साथ कनेक्ट करने की अनुमति देता है, स्वचालित समन्वय सक्षम करता है और आपके सभी रिपॉजिटरी का एकीकृत दृश्य प्रदान करता है।
|
||||
1. **Fully Managed Git Hosting**: Offers the familiar functionality of Git, meaning you can use regular Git commands and workflows.
|
||||
2. **Integration with GCP Services**: Integrates with other GCP services like Cloud Build, Pub/Sub, and App Engine for end-to-end traceability from code to deployment.
|
||||
3. **Private Repositories**: Ensures your code is stored securely and privately. You can control access using Cloud Identity and Access Management (IAM) roles.
|
||||
4. **Source Code Analysis**: Works with other GCP tools to provide automated analysis of your source code, identifying potential issues like bugs, vulnerabilities, or bad coding practices.
|
||||
5. **Collaboration Tools**: Supports collaborative coding with tools like merge requests, comments, and reviews.
|
||||
6. **Mirror Support**: Allows you to connect Cloud Source Repositories with repositories hosted on GitHub or Bitbucket, enabling automatic synchronization and providing a unified view of all your repositories.
|
||||
|
||||
### OffSec जानकारी <a href="#reviewing-cloud-git-repositories" id="reviewing-cloud-git-repositories"></a>
|
||||
### OffSec information <a href="#reviewing-cloud-git-repositories" id="reviewing-cloud-git-repositories"></a>
|
||||
|
||||
- एक प्रोजेक्ट के अंदर स्रोत रिपॉजिटरी कॉन्फ़िगरेशन में एक **सेवा खाता** होगा जिसका उपयोग Cloud Pub/Sub संदेशों को प्रकाशित करने के लिए किया जाएगा। उपयोग में लिया जाने वाला डिफ़ॉल्ट **Compute SA** है। हालाँकि, **मुझे नहीं लगता कि इसका टोकन Source Repositories से चुराना संभव है** क्योंकि यह बैकग्राउंड में निष्पादित हो रहा है।
|
||||
- GCP Cloud Source Repositories वेब कंसोल ([https://source.cloud.google.com/](https://source.cloud.google.com/)) के अंदर कोड देखने के लिए, आपको कोड को **डिफ़ॉल्ट रूप से मास्टर ब्रांच के अंदर होना चाहिए**।
|
||||
- आप **Github** या **Bitbucket** से एक रेपो की ओर इशारा करते हुए **एक मिरर क्लाउड रिपॉजिटरी** भी **बना सकते हैं** (उन प्लेटफार्मों को एक्सेस देते हुए)।
|
||||
- **GCP के अंदर कोड और डिबग करना संभव है**।
|
||||
- डिफ़ॉल्ट रूप से, Source Repositories **कमिट में निजी कुंजियों को पुश करने से रोकता है**, लेकिन इसे अक्षम किया जा सकता है।
|
||||
- The source repositories configuration inside a project will have a **Service Account** used to publishing Cloud Pub/Sub messages. The default one used is the **Compute SA**. However, **I don't think it's possible steal its token** from Source Repositories as it's being executed in the background.
|
||||
- To see the code inside the GCP Cloud Source Repositories web console ([https://source.cloud.google.com/](https://source.cloud.google.com/)), you need the code to be **inside master branch by default**.
|
||||
- You can also **create a mirror Cloud Repository** pointing to a repo from **Github** or **Bitbucket** (giving access to those platforms).
|
||||
- It's possible to **code & debug from inside GCP**.
|
||||
- By default, Source Repositories **prevents private keys to be pushed in commits**, but this can be disabled.
|
||||
|
||||
### क्लाउड शेल में खोलें
|
||||
### Open In Cloud Shell
|
||||
|
||||
क्लाउड शेल में रिपॉजिटरी खोलना संभव है, ऐसा प्रॉम्प्ट दिखाई देगा:
|
||||
It's possible to open the repository in Cloud Shell, a prompt like this one will appear:
|
||||
|
||||
<figure><img src="../../../images/image (325).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
यह आपको क्लाउड शेल में कोड और डिबग करने की अनुमति देगा (जो क्लाउडशेल को समझौता कर सकता है)।
|
||||
This will allow you to code and debug in Cloud Shell (which could get cloudshell compromised).
|
||||
|
||||
### Enumeration
|
||||
|
||||
### एनमरेशन
|
||||
```bash
|
||||
# Repos enumeration
|
||||
gcloud source repos list #Get names and URLs
|
||||
@@ -42,7 +43,7 @@ gcloud source repos get-iam-policy <repo_name>
|
||||
gcloud source repos clone <REPO NAME>
|
||||
gcloud source repos get-iam-policy <REPO NAME>
|
||||
... git add & git commit -m ...
|
||||
git push --set-upstream origin master
|
||||
git push --set-upstream origin $BRANCH
|
||||
git push -u origin master
|
||||
|
||||
# Access via git
|
||||
@@ -50,16 +51,20 @@ git push -u origin master
|
||||
git clone ssh://username@domain.com@source.developers.google.com:2022/p/<proj-name>/r/<repo-name>
|
||||
git add, commit, push...
|
||||
```
|
||||
### विशेषाधिकार वृद्धि और पोस्ट शोषण
|
||||
|
||||
### Privilege Escalation & Post Exploitation
|
||||
|
||||
{{#ref}}
|
||||
../gcp-privilege-escalation/gcp-sourcerepos-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
### अनधिकृत Enum
|
||||
### Unauthenticated Enum
|
||||
|
||||
{{#ref}}
|
||||
../gcp-unauthenticated-enum-and-access/gcp-source-repositories-unauthenticated-enum.md
|
||||
{{#endref}}
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user