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

This commit is contained in:
Translator
2024-12-31 19:09:02 +00:00
parent 7770a50092
commit 4ecda9fe96
244 changed files with 8478 additions and 11318 deletions

View File

@@ -4,9 +4,9 @@
## Basic Information
**Before start pentesting** a Digital Ocean environment there are a few **basics things you need to know** about how DO works to help you understand what you need to do, how to find misconfigurations and how to exploit them.
**Перед початком pentesting** середовища Digital Ocean є кілька **основних речей, які вам потрібно знати** про те, як працює DO, щоб допомогти вам зрозуміти, що потрібно робити, як знаходити неправильні налаштування та як їх експлуатувати.
Concepts such as hierarchy, access and other basic concepts are explained in:
Концепції, такі як ієрархія, доступ та інші основні концепції, пояснюються в:
{{#ref}}
do-basic-information.md
@@ -22,26 +22,20 @@ https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/clou
### Projects
To get a list of the projects and resources running on each of them from the CLI check:
Щоб отримати список проектів та ресурсів, що працюють на кожному з них з CLI, перевірте:
{{#ref}}
do-services/do-projects.md
{{#endref}}
### Whoami
```bash
doctl account get
```
## Services Enumeration
## Перерахування послуг
{{#ref}}
do-services/
{{#endref}}
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -1,139 +1,127 @@
# DO - Basic Information
# DO - Основна інформація
{{#include ../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
DigitalOcean is a **cloud computing platform that provides users with a variety of services**, including virtual private servers (VPS) and other resources for building, deploying, and managing applications. **DigitalOcean's services are designed to be simple and easy to use**, making them **popular among developers and small businesses**.
DigitalOcean є **хмарною обчислювальною платформою, яка надає користувачам різноманітні послуги**, включаючи віртуальні приватні сервери (VPS) та інші ресурси для створення, розгортання та управління додатками. **Послуги DigitalOcean розроблені так, щоб бути простими та зручними у використанні**, що робить їх **популярними серед розробників та малих підприємств**.
Some of the key features of DigitalOcean include:
Деякі з ключових функцій DigitalOcean включають:
- **Virtual private servers (VPS)**: DigitalOcean provides VPS that can be used to host websites and applications. These VPS are known for their simplicity and ease of use, and can be quickly and easily deployed using a variety of pre-built "droplets" or custom configurations.
- **Storage**: DigitalOcean offers a range of storage options, including object storage, block storage, and managed databases, that can be used to store and manage data for websites and applications.
- **Development and deployment tools**: DigitalOcean provides a range of tools that can be used to build, deploy, and manage applications, including APIs and pre-built droplets.
- **Security**: DigitalOcean places a strong emphasis on security, and offers a range of tools and features to help users keep their data and applications safe. This includes encryption, backups, and other security measures.
- **Віртуальні приватні сервери (VPS)**: DigitalOcean надає VPS, які можна використовувати для хостингу вебсайтів та додатків. Ці VPS відомі своєю простотою та зручністю у використанні, і їх можна швидко та легко розгорнути за допомогою різноманітних попередньо налаштованих "дроплетів" або користувацьких конфігурацій.
- **Сховище**: DigitalOcean пропонує ряд варіантів зберігання, включаючи об'єктне зберігання, блочне зберігання та керовані бази даних, які можна використовувати для зберігання та управління даними для вебсайтів та додатків.
- **Інструменти для розробки та розгортання**: DigitalOcean надає ряд інструментів, які можна використовувати для створення, розгортання та управління додатками, включаючи API та попередньо налаштовані дроплети.
- **Безпека**: DigitalOcean надає велике значення безпеці та пропонує ряд інструментів і функцій, щоб допомогти користувачам зберігати свої дані та додатки в безпеці. Це включає шифрування, резервне копіювання та інші заходи безпеки.
Overall, DigitalOcean is a cloud computing platform that provides users with the tools and resources they need to build, deploy, and manage applications in the cloud. Its services are designed to be simple and easy to use, making them popular among developers and small businesses.
В цілому, DigitalOcean є хмарною обчислювальною платформою, яка надає користувачам інструменти та ресурси, необхідні для створення, розгортання та управління додатками в хмарі. Його послуги розроблені так, щоб бути простими та зручними у використанні, що робить їх популярними серед розробників та малих підприємств.
### Main Differences from AWS
### Основні відмінності від AWS
One of the main differences between DigitalOcean and AWS is the **range of services they offer**. **DigitalOcean focuses on providing simple** and easy-to-use virtual private servers (VPS), storage, and development and deployment tools. **AWS**, on the other hand, offers a **much broader range of services**, including VPS, storage, databases, machine learning, analytics, and many other services. This means that AWS is more suitable for complex, enterprise-level applications, while DigitalOcean is more suited to small businesses and developers.
Одна з основних відмінностей між DigitalOcean та AWS полягає в **діапазоні послуг, які вони пропонують**. **DigitalOcean зосереджується на наданні простих** та зручних у використанні віртуальних приватних серверів (VPS), сховищ та інструментів для розробки та розгортання. **AWS**, з іншого боку, пропонує **набагато ширший спектр послуг**, включаючи VPS, сховища, бази даних, машинне навчання, аналітику та багато інших послуг. Це означає, що AWS більше підходить для складних, корпоративних додатків, тоді як DigitalOcean більше підходить для малих підприємств та розробників.
Another key difference between the two platforms is the **pricing structure**. **DigitalOcean's pricing is generally more straightforward and easier** to understand than AWS, with a range of pricing plans that are based on the number of droplets and other resources used. AWS, on the other hand, has a more complex pricing structure that is based on a variety of factors, including the type and amount of resources used. This can make it more difficult to predict costs when using AWS.
Ще одна ключова відмінність між двома платформами - це **структура ціноутворення**. **Ціноутворення DigitalOcean зазвичай є більш зрозумілим та простим** для розуміння, ніж у AWS, з рядом цінових планів, які базуються на кількості дроплетів та інших використовуваних ресурсів. AWS, з іншого боку, має більш складну структуру ціноутворення, яка базується на різноманітних факторах, включаючи тип та кількість використовуваних ресурсів. Це може ускладнити прогнозування витрат при використанні AWS.
## Hierarchy
## Ієрархія
### User
### Користувач
A user is what you expect, a user. He can **create Teams** and **be a member of different teams.**
Користувач - це те, що ви очікуєте, користувач. Він може **створювати команди** та **бути членом різних команд.**
### **Team**
### **Команда**
A team is a group of **users**. When a user creates a team he has the **role owner on that team** and he initially **sets up the billing info**. **Other** user can then be **invited** to the team.
Команда - це група **користувачів**. Коли користувач створює команду, він має **роль власника цієї команди** і спочатку **налаштовує платіжну інформацію**. **Інші** користувачі можуть бути **запрошені** до команди.
Inside the team there might be several **projects**. A project is just a **set of services running**. It can be used to **separate different infra stages**, like prod, staging, dev...
У команді може бути кілька **проектів**. Проект - це просто **набір послуг, що працюють**. Його можна використовувати для **розділення різних етапів інфраструктури**, таких як продакшн, стадія, розробка...
### Project
### Проект
As explained, a project is just a container for all the **services** (droplets, spaces, databases, kubernetes...) **running together inside of it**.\
A Digital Ocean project is very similar to a GCP project without IAM.
Як було пояснено, проект - це просто контейнер для всіх **послуг** (дроплети, простори, бази даних, kubernetes...), **які працюють разом всередині нього**.\
Проект Digital Ocean дуже схожий на проект GCP без IAM.
## Permissions
## Дозволи
### Team
### Команда
Basically all members of a team have **access to the DO resources in all the projects created within the team (with more or less privileges).**
В основному всі члени команди мають **доступ до ресурсів DO у всіх проектах, створених у межах команди (з більшою або меншою кількістю привілеїв).**
### Roles
### Ролі
Each **user inside a team** can have **one** of the following three **roles** inside of it:
Кожен **користувач у команді** може мати **одну** з трьох наступних **ролей**:
| Role | Shared Resources | Billing Information | Team Settings |
| Роль | Спільні ресурси | Платіжна інформація | Налаштування команди |
| ---------- | ---------------- | ------------------- | ------------- |
| **Owner** | Full access | Full access | Full access |
| **Biller** | No access | Full access | No access |
| **Member** | Full access | No access | No access |
| **Власник** | Повний доступ | Повний доступ | Повний доступ |
| **Біллер** | Немає доступу | Повний доступ | Немає доступу |
| **Член** | Повний доступ | Немає доступу | Немає доступу |
**Owner** and **member can list the users** and check their **roles** (biller cannot).
**Власник** та **член можуть переглядати користувачів** та перевіряти їх **ролі** (біллер не може).
## Access
## Доступ
### Username + password (MFA)
### Ім'я користувача + пароль (MFA)
As in most of the platforms, in order to access to the GUI you can use a set of **valid username and password** to **access** the cloud **resources**. Once logged in you can see **all the teams you are part** of in [https://cloud.digitalocean.com/account/profile](https://cloud.digitalocean.com/account/profile).\
And you can see all your activity in [https://cloud.digitalocean.com/account/activity](https://cloud.digitalocean.com/account/activity).
Як і на більшості платформ, для доступу до GUI ви можете використовувати набір **дійсних імені користувача та пароля** для **доступу** до хмарних **ресурсів**. Після входу ви можете бачити **всі команди, до яких ви належите** на [https://cloud.digitalocean.com/account/profile](https://cloud.digitalocean.com/account/profile).\
І ви можете бачити всю свою активність на [https://cloud.digitalocean.com/account/activity](https://cloud.digitalocean.com/account/activity).
**MFA** can be **enabled** in a user and **enforced** for all the users in a **team** to access the team.
**MFA** може бути **увімкнено** для користувача та **зобов'язано** для всіх користувачів у **команді** для доступу до команди.
### API keys
In order to use the API, users can **generate API keys**. These will always come with Read permissions but **Write permission are optional**.\
The API keys look like this:
### API ключі
Для використання API користувачі можуть **генерувати API ключі**. Вони завжди матимуть права на читання, але **права на запис є необов'язковими**.\
API ключі виглядають так:
```
dop_v1_1946a92309d6240274519275875bb3cb03c1695f60d47eaa1532916502361836
```
The cli tool is [**doctl**](https://github.com/digitalocean/doctl#installing-doctl). Initialise it (you need a token) with:
Інструмент командного рядка - це [**doctl**](https://github.com/digitalocean/doctl#installing-doctl). Ініціалізуйте його (вам потрібен токен) за допомогою:
```bash
doctl auth init # Asks for the token
doctl auth init --context my-context # Login with a different token
doctl auth list # List accounts
```
За замовчуванням цей токен буде записаний у відкритому вигляді на Mac у `/Users/<username>/Library/Application Support/doctl/config.yaml`.
By default this token will be written in clear-text in Mac in `/Users/<username>/Library/Application Support/doctl/config.yaml`.
### Ключі доступу до Spaces
### Spaces access keys
These are keys that give **access to the Spaces** (like S3 in AWS or Storage in GCP).
They are composed by a **name**, a **keyid** and a **secret**. An example could be:
Це ключі, які надають **доступ до Spaces** (як S3 в AWS або Storage в GCP).
Вони складаються з **імені**, **keyid** та **secret**. Приклад може бути:
```
Name: key-example
Keyid: DO00ZW4FABSGZHAABGFX
Secret: 2JJ0CcQZ56qeFzAJ5GFUeeR4Dckarsh6EQSLm87MKlM
```
### OAuth Application
OAuth applications can be granted **access over Digital Ocean**.
OAuth додатки можуть отримати **доступ до Digital Ocean**.
It's possible to **create OAuth applications** in [https://cloud.digitalocean.com/account/api/applications](https://cloud.digitalocean.com/account/api/applications) and check all **allowed OAuth applications** in [https://cloud.digitalocean.com/account/api/access](https://cloud.digitalocean.com/account/api/access).
Можливо **створити OAuth додатки** в [https://cloud.digitalocean.com/account/api/applications](https://cloud.digitalocean.com/account/api/applications) та перевірити всі **дозволені OAuth додатки** в [https://cloud.digitalocean.com/account/api/access](https://cloud.digitalocean.com/account/api/access).
### SSH Keys
It's possible to add **SSH keys to a Digital Ocean Team** from the **console** in [https://cloud.digitalocean.com/account/security](https://cloud.digitalocean.com/account/security).
Можливо додати **SSH ключі до команди Digital Ocean** з **консолі** в [https://cloud.digitalocean.com/account/security](https://cloud.digitalocean.com/account/security).
This way, if you create a **new droplet, the SSH key will be set** on it and you will be able to **login via SSH** without password (note that newly [uploaded SSH keys aren't set in already existent droplets for security reasons](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/to-existing-droplet/)).
Таким чином, якщо ви створите **новий дроплет, SSH ключ буде налаштований** на ньому, і ви зможете **увійти через SSH** без пароля (зверніть увагу, що нові [завантажені SSH ключі не налаштовуються в уже існуючих дроплетах з міркувань безпеки](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/to-existing-droplet/)).
### Functions Authentication Token
The way **to trigger a function via REST API** (always enabled, it's the method the cli uses) is by triggering a request with an **authentication token** like:
Спосіб **викликати функцію через REST API** (завжди увімкнено, це метод, який використовує cli) полягає у виклику запиту з **токеном аутентифікації** на зразок:
```bash
curl -X POST "https://faas-lon1-129376a7.doserverless.co/api/v1/namespaces/fn-c100c012-65bf-4040-1230-2183764b7c23/actions/functionname?blocking=true&result=true" \
-H "Content-Type: application/json" \
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
-H "Content-Type: application/json" \
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
```
## Logs
### User logs
The **logs of a user** can be found in [**https://cloud.digitalocean.com/account/activity**](https://cloud.digitalocean.com/account/activity)
**Логи користувача** можна знайти за адресою [**https://cloud.digitalocean.com/account/activity**](https://cloud.digitalocean.com/account/activity)
### Team logs
The **logs of a team** can be found in [**https://cloud.digitalocean.com/account/security**](https://cloud.digitalocean.com/account/security)
**Логи команди** можна знайти за адресою [**https://cloud.digitalocean.com/account/security**](https://cloud.digitalocean.com/account/security)
## References
- [https://docs.digitalocean.com/products/teams/how-to/manage-membership/](https://docs.digitalocean.com/products/teams/how-to/manage-membership/)
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -1,11 +1,7 @@
# DO - Permissions for a Pentest
# DO - Дозволи для Пентесту
{{#include ../../banners/hacktricks-training.md}}
DO doesn't support granular permissions. So the **minimum role** that allows a user to review all the resources is **member**. A pentester with this permission will be able to perform harmful activities, but it's what it's.
DO не підтримує детальні дозволи. Тому **мінімальна роль**, яка дозволяє користувачу переглядати всі ресурси, є **учасник**. Пентестер з цим дозволом зможе виконувати шкідливі дії, але так воно і є.
{{#include ../../banners/hacktricks-training.md}}

View File

@@ -1,23 +1,19 @@
# DO - Services
# DO - Послуги
{{#include ../../../banners/hacktricks-training.md}}
DO offers a few services, here you can find how to **enumerate them:**
DO пропонує кілька послуг, тут ви можете знайти, як **перерахувати їх:**
- [**Apps**](do-apps.md)
- [**Container Registry**](do-container-registry.md)
- [**Databases**](do-databases.md)
- [**Droplets**](do-droplets.md)
- [**Functions**](do-functions.md)
- [**Images**](do-images.md)
- [**Додатки**](do-apps.md)
- [**Реєстр контейнерів**](do-container-registry.md)
- [**Бази даних**](do-databases.md)
- [**Дроплети**](do-droplets.md)
- [**Функції**](do-functions.md)
- [**Зображення**](do-images.md)
- [**Kubernetes (DOKS)**](do-kubernetes-doks.md)
- [**Networking**](do-networking.md)
- [**Projects**](do-projects.md)
- [**Spaces**](do-spaces.md)
- [**Volumes**](do-volumes.md)
- [**Мережі**](do-networking.md)
- [**Проекти**](do-projects.md)
- [**Простори**](do-spaces.md)
- [**Томами**](do-volumes.md)
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,18 +2,17 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
[From the docs:](https://docs.digitalocean.com/glossary/app-platform/) App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to **publish code directly to DigitalOcean** servers without worrying about the underlying infrastructure.
[З документації:](https://docs.digitalocean.com/glossary/app-platform/) App Platform - це пропозиція Platform-as-a-Service (PaaS), яка дозволяє розробникам **публікувати код безпосередньо на серверах DigitalOcean** без занепокоєння про підлягаючу інфраструктуру.
You can run code directly from **github**, **gitlab**, **docker hub**, **DO container registry** (or a sample app).
Ви можете запускати код безпосередньо з **github**, **gitlab**, **docker hub**, **DO container registry** (або з демонстраційного додатку).
When defining an **env var** you can set it as **encrypted**. The only way to **retreive** its value is executing **commands** inside the host runnig the app.
При визначенні **env var** ви можете встановити його як **зашифрований**. Єдиний спосіб **отримати** його значення - це виконати **команди** всередині хоста, що виконує додаток.
An **App URL** looks like this [https://dolphin-app-2tofz.ondigitalocean.app](https://dolphin-app-2tofz.ondigitalocean.app)
### Enumeration
**URL додатку** виглядає так [https://dolphin-app-2tofz.ondigitalocean.app](https://dolphin-app-2tofz.ondigitalocean.app)
### Перерахування
```bash
doctl apps list # You should get URLs here
doctl apps spec get <app-id> # Get yaml (including env vars, might be encrypted)
@@ -21,18 +20,13 @@ doctl apps logs <app-id> # Get HTTP logs
doctl apps list-alerts <app-id> # Get alerts
doctl apps list-regions # Get available regions and the default one
```
> [!CAUTION]
> **Apps doesn't have metadata endpoint**
> **Додатки не мають метаданих ендпоінту**
### RCE & Encrypted env vars
### RCE та зашифровані змінні середовища
To execute code directly in the container executing the App you will need **access to the console** and go to **`https://cloud.digitalocean.com/apps/<app-id>/console/<app-name>`**.
Щоб виконати код безпосередньо в контейнері, що виконує Додаток, вам знадобиться **доступ до консолі** і перейти за адресою **`https://cloud.digitalocean.com/apps/<app-id>/console/<app-name>`**.
That will give you a **shell**, and just executing **`env`** you will be able to see **all the env vars** (including the ones defined as **encrypted**).
Це надасть вам **оболонку**, і просто виконавши **`env`**, ви зможете побачити **всі змінні середовища** (включаючи ті, що визначені як **зашифровані**).
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,12 +4,11 @@
## Basic Information
DigitalOcean Container Registry is a service provided by DigitalOcean that **allows you to store and manage Docker images**. It is a **private** registry, which means that the images that you store in it are only accessible to you and users that you grant access to. This allows you to securely store and manage your Docker images, and use them to deploy containers on DigitalOcean or any other environment that supports Docker.
DigitalOcean Container Registry - це сервіс, що надається DigitalOcean, який **дозволяє вам зберігати та керувати Docker-образами**. Це **приватний** реєстр, що означає, що образи, які ви зберігаєте в ньому, доступні лише вам та користувачам, яким ви надаєте доступ. Це дозволяє вам безпечно зберігати та керувати вашими Docker-образами, а також використовувати їх для розгортання контейнерів на DigitalOcean або в будь-якому іншому середовищі, що підтримує Docker.
When creating a Container Registry it's possible to **create a secret with pull images access (read) over it in all the namespaces** of Kubernetes clusters.
При створенні Container Registry можливо **створити секрет з доступом до витягування образів (читання) у всіх просторах імен** кластерів Kubernetes.
### Connection
```bash
# Using doctl
doctl registry login
@@ -19,9 +18,7 @@ docker login registry.digitalocean.com
Username: <paste-api-token>
Password: <paste-api-token>
```
### Enumeration
### Перерахування
```bash
# Get creds to access the registry from the API
doctl registry docker-config
@@ -29,9 +26,4 @@ doctl registry docker-config
# List
doctl registry repository list-v2
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,22 +2,19 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
With DigitalOcean Databases, you can easily **create and manage databases in the cloud** without having to worry about the underlying infrastructure. The service offers a variety of database options, including **MySQL**, **PostgreSQL**, **MongoDB**, and **Redis**, and provides tools for administering and monitoring your databases. DigitalOcean Databases is designed to be highly scalable, reliable, and secure, making it an ideal choice for powering modern applications and websites.
З DigitalOcean Databases ви можете легко **створювати та керувати базами даних у хмарі**, не турбуючись про підлягаючу інфраструктуру. Сервіс пропонує різноманітні варіанти баз даних, включаючи **MySQL**, **PostgreSQL**, **MongoDB** та **Redis**, і надає інструменти для адміністрування та моніторингу ваших баз даних. DigitalOcean Databases розроблений для високої масштабованості, надійності та безпеки, що робить його ідеальним вибором для підтримки сучасних додатків та веб-сайтів.
### Connections details
### Деталі підключення
When creating a database you can select to configure it **accessible from a public network**, or just from inside a **VPC**. Moreover, it request you to **whitelist IPs that can access it** (your IPv4 can be one).
The **host**, **port**, **dbname**, **username**, and **password** are shown in the **console**. You can even download the AD certificate to connect securely.
При створенні бази даних ви можете вибрати налаштування **доступу з публічної мережі** або лише зсередини **VPC**. Крім того, вам потрібно **додати до білого списку IP-адреси, які можуть отримати доступ** (ваша IPv4 може бути однією з них).
**Хост**, **порт**, **dbname**, **ім'я користувача** та **пароль** відображаються в **консолі**. Ви навіть можете завантажити сертифікат AD для безпечного підключення.
```bash
sql -h db-postgresql-ams3-90864-do-user-2700959-0.b.db.ondigitalocean.com -U doadmin -d defaultdb -p 25060
```
### Enumeration
### Перерахування
```bash
# Databse clusters
doctl databases list
@@ -39,9 +36,4 @@ doctl databases backups <db-id> # List backups of DB
# Pools
doctl databases pool list <db-id> # List pools of DB
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,47 +2,46 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
In DigitalOcean, a "droplet" is a v**irtual private server (VPS)** that can be used to host websites and applications. A droplet is a **pre-configured package of computing resources**, including a certain amount of CPU, memory, and storage, that can be quickly and easily deployed on DigitalOcean's cloud infrastructure.
У DigitalOcean "дроплет" - це в**іртуальний приватний сервер (VPS)**, який можна використовувати для хостингу веб-сайтів та додатків. Дроплет - це **попередньо налаштований пакет обчислювальних ресурсів**, включаючи певну кількість ЦП, пам'яті та сховища, який можна швидко та легко розгорнути на хмарній інфраструктурі DigitalOcean.
You can select from **common OS**, to **applications** already running (such as WordPress, cPanel, Laravel...), or even upload and use **your own images**.
Ви можете вибрати з **поширених ОС**, до **додатків**, які вже працюють (таких як WordPress, cPanel, Laravel...), або навіть завантажити та використовувати **свої власні образи**.
Droplets support **User data scripts**.
Дроплети підтримують **скрипти даних користувача**.
<details>
<summary>Difference between a snapshot and a backup</summary>
<summary>Різниця між знімком і резервною копією</summary>
In DigitalOcean, a snapshot is a point-in-time copy of a Droplet's disk. It captures the state of the Droplet's disk at the time the snapshot was taken, including the operating system, installed applications, and all the files and data on the disk.
У DigitalOcean знімок - це копія диска дроплета на певний момент часу. Він захоплює стан диска дроплета на момент, коли був зроблений знімок, включаючи операційну систему, встановлені додатки та всі файли і дані на диску.
Snapshots can be used to create new Droplets with the same configuration as the original Droplet, or to restore a Droplet to the state it was in when the snapshot was taken. Snapshots are stored on DigitalOcean's object storage service, and they are incremental, meaning that only the changes since the last snapshot are stored. This makes them efficient to use and cost-effective to store.
Знімки можна використовувати для створення нових дроплетів з такою ж конфігурацією, як у оригінального дроплета, або для відновлення дроплета до стану, в якому він був, коли був зроблений знімок. Знімки зберігаються на об'єктному сховищі DigitalOcean, і вони є інкрементальними, що означає, що зберігаються лише зміни з моменту останнього знімка. Це робить їх ефективними у використанні та економічно вигідними для зберігання.
On the other hand, a backup is a complete copy of a Droplet, including the operating system, installed applications, files, and data, as well as the Droplet's settings and metadata. Backups are typically performed on a regular schedule, and they capture the entire state of a Droplet at a specific point in time.
З іншого боку, резервна копія - це повна копія дроплета, включаючи операційну систему, встановлені додатки, файли та дані, а також налаштування та метадані дроплета. Резервні копії зазвичай виконуються за регулярним графіком і захоплюють весь стан дроплета в певний момент часу.
Unlike snapshots, backups are stored in a compressed and encrypted format, and they are transferred off of DigitalOcean's infrastructure to a remote location for safekeeping. This makes backups ideal for disaster recovery, as they provide a complete copy of a Droplet that can be restored in the event of data loss or other catastrophic events.
На відміну від знімків, резервні копії зберігаються в стиснутому та зашифрованому форматі, і вони передаються з інфраструктури DigitalOcean до віддаленого місця для зберігання. Це робить резервні копії ідеальними для відновлення після катастроф, оскільки вони надають повну копію дроплета, яку можна відновити у разі втрати даних або інших катастрофічних подій.
In summary, snapshots are point-in-time copies of a Droplet's disk, while backups are complete copies of a Droplet, including its settings and metadata. Snapshots are stored on DigitalOcean's object storage service, while backups are transferred off of DigitalOcean's infrastructure to a remote location. Both snapshots and backups can be used to restore a Droplet, but snapshots are more efficient to use and store, while backups provide a more comprehensive backup solution for disaster recovery.
Отже, знімки - це копії диска дроплета на певний момент часу, тоді як резервні копії - це повні копії дроплета, включаючи його налаштування та метадані. Знімки зберігаються на об'єктному сховищі DigitalOcean, тоді як резервні копії передаються з інфраструктури DigitalOcean до віддаленого місця. Як знімки, так і резервні копії можна використовувати для відновлення дроплета, але знімки є більш ефективними у використанні та зберіганні, тоді як резервні копії забезпечують більш комплексне рішення для резервного копіювання для відновлення після катастроф.
</details>
### Authentication
### Аутентифікація
For authentication it's possible to **enable SSH** through username and **password** (password defined when the droplet is created). Or **select one or more of the uploaded SSH keys**.
Для аутентифікації можна **увімкнути SSH** через ім'я користувача та **пароль** (пароль визначається під час створення дроплета). Або **вибрати один або кілька завантажених SSH-ключів**.
### Firewall
### Брандмауер
> [!CAUTION]
> By default **droplets are created WITHOUT A FIREWALL** (not like in oder clouds such as AWS or GCP). So if you want DO to protect the ports of the droplet (VM), you need to **create it and attach it**.
> За замовчуванням **дроплети створюються БЕЗ БРАНДМАУЕРА** (не так, як в інших хмарах, таких як AWS або GCP). Тому, якщо ви хочете, щоб DO захищав порти дроплета (VM), вам потрібно **створити його та прикріпити**.
More info in:
Більше інформації в:
{{#ref}}
do-networking.md
{{#endref}}
### Enumeration
### Перерахування
```bash
# VMs
doctl compute droplet list # IPs will appear here
@@ -68,18 +67,13 @@ doctl compute certificate list
# Snapshots
doctl compute snapshot list
```
> [!CAUTION]
> **Droplets have metadata endpoints**, but in DO there **isn't IAM** or things such as role from AWS or service accounts from GCP.
> **Дроплети мають метадані**, але в DO **немає IAM** або таких речей, як роль з AWS або облікові записи служб з GCP.
### RCE
With access to the console it's possible to **get a shell inside the droplet** accessing the URL: **`https://cloud.digitalocean.com/droplets/<droplet-id>/terminal/ui/`**
З доступом до консолі можливо **отримати оболонку всередині дроплета**, отримавши доступ до URL: **`https://cloud.digitalocean.com/droplets/<droplet-id>/terminal/ui/`**
It's also possible to launch a **recovery console** to run commands inside the host accessing a recovery console in **`https://cloud.digitalocean.com/droplets/<droplet-id>/console`**(but in this case you will need to know the root password).
Також можливо запустити **консоль відновлення**, щоб виконати команди всередині хоста, отримавши доступ до консолі відновлення за **`https://cloud.digitalocean.com/droplets/<droplet-id>/console`** (але в цьому випадку вам потрібно знати пароль root).
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,39 +2,34 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
DigitalOcean Functions, also known as "DO Functions," is a serverless computing platform that lets you **run code without having to worry about the underlying infrastructure**. With DO Functions, you can write and deploy your code as "functions" that can be **triggered** via **API**, **HTTP requests** (if enabled) or **cron**. These functions are executed in a fully managed environment, so you **don't need to worry** about scaling, security, or maintenance.
DigitalOcean Functions, також відомі як "DO Functions," є платформою безсерверних обчислень, яка дозволяє вам **виконувати код, не турбуючись про підлягаючу інфраструктуру**. З DO Functions ви можете писати та розгортати свій код як "функції", які можуть бути **активовані** через **API**, **HTTP запити** (якщо увімкнено) або **cron**. Ці функції виконуються в повністю керованому середовищі, тому вам **не потрібно турбуватися** про масштабування, безпеку або обслуговування.
In DO, to create a function first you need to **create a namespace** which will be **grouping functions**.\
Inside the namespace you can then create a function.
У DO, щоб створити функцію, спочатку потрібно **створити простір імен**, який буде **групувати функції**.\
Всередині простору імен ви можете потім створити функцію.
### Triggers
The way **to trigger a function via REST API** (always enabled, it's the method the cli uses) is by triggering a request with an **authentication token** like:
### Тригери
Спосіб **активації функції через REST API** (завжди увімкнено, це метод, який використовує cli) полягає в активації запиту з **токеном аутентифікації** на зразок:
```bash
curl -X POST "https://faas-lon1-129376a7.doserverless.co/api/v1/namespaces/fn-c100c012-65bf-4040-1230-2183764b7c23/actions/functionname?blocking=true&result=true" \
-H "Content-Type: application/json" \
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
-H "Content-Type: application/json" \
-H "Authorization: Basic MGU0NTczZGQtNjNiYS00MjZlLWI2YjctODk0N2MyYTA2NGQ4OkhwVEllQ2t4djNZN2x6YjJiRmFGc1FERXBySVlWa1lEbUxtRE1aRTludXA1UUNlU2VpV0ZGNjNqWnVhYVdrTFg="
```
To see how is the **`doctl`** cli tool getting this token (so you can replicate it), the **following command shows the complete network trace:**
Щоб побачити, як інструмент **`doctl`** cli отримує цей токен (щоб ви могли його відтворити), **наступна команда показує повний мережевий слід:**
```bash
doctl serverless connect --trace
```
**When HTTP trigger is enabled**, a web function can be invoked through these **HTTP methods GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS**.
**Коли HTTP тригер увімкнено**, веб-функцію можна викликати через ці **HTTP методи GET, POST, PUT, PATCH, DELETE, HEAD та OPTIONS**.
> [!CAUTION]
> In DO functions, **environment variables cannot be encrypted** (at the time of this writing).\
> I couldn't find any way to read them from the CLI but from the console it's straight forward.
> У DO функціях, **змінні середовища не можуть бути зашифровані** (на момент написання цього тексту).\
> Я не зміг знайти жодного способу прочитати їх з CLI, але з консолі це просто.
**Functions URLs** look like this: `https://<random>.doserverless.co/api/v1/web/<namespace-id>/default/<function-name>`
### Enumeration
**URL функцій** виглядають так: `https://<random>.doserverless.co/api/v1/web/<namespace-id>/default/<function-name>`
### Перерахування
```bash
# Namespace
doctl serverless namespaces list
@@ -53,12 +48,7 @@ doctl serverless activations result <activation-id> # get only the response resu
# I couldn't find any way to get the env variables form the CLI
```
> [!CAUTION]
> There **isn't metadata endpoint** from the Functions sandbox.
> **Немає метаданих ендпоінту** з пісочниці Functions.
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -4,20 +4,14 @@
## Basic Information
DigitalOcean Images are **pre-built operating system or application images** that can be used to create new Droplets (virtual machines) on DigitalOcean. They are similar to virtual machine templates, and they allow you to **quickly and easily create new Droplets with the operating system** and applications that you need.
DigitalOcean Images є **попередньо створеними образами операційної системи або додатків**, які можна використовувати для створення нових Droplets (віртуальних машин) на DigitalOcean. Вони подібні до шаблонів віртуальних машин і дозволяють вам **швидко та легко створювати нові Droplets з операційною системою** та додатками, які вам потрібні.
DigitalOcean provides a wide range of Images, including popular operating systems such as Ubuntu, CentOS, and FreeBSD, as well as pre-configured application Images such as LAMP, MEAN, and LEMP stacks. You can also create your own custom Images, or use Images from the community.
DigitalOcean надає широкий вибір Images, включаючи популярні операційні системи, такі як Ubuntu, CentOS та FreeBSD, а також попередньо налаштовані образи додатків, такі як LAMP, MEAN та LEMP стеки. Ви також можете створити свої власні користувацькі Images або використовувати Images з громади.
When you create a new Droplet on DigitalOcean, you can choose an Image to use as the basis for the Droplet. This will automatically install the operating system and any pre-installed applications on the new Droplet, so you can start using it right away. Images can also be used to create snapshots and backups of your Droplets, so you can easily create new Droplets from the same configuration in the future.
Коли ви створюєте новий Droplet на DigitalOcean, ви можете вибрати Image, який буде використано як основу для Droplet. Це автоматично встановить операційну систему та будь-які попередньо встановлені додатки на новому Droplet, тому ви можете почати використовувати його відразу. Images також можна використовувати для створення знімків та резервних копій ваших Droplets, тому ви можете легко створювати нові Droplets з тією ж конфігурацією в майбутньому.
### Enumeration
```
doctl compute image list
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,19 +2,18 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
### DigitalOcean Kubernetes (DOKS)
DOKS is a managed Kubernetes service offered by DigitalOcean. The service is designed to **deploy and manage Kubernetes clusters on DigitalOcean's platform**. The key aspects of DOKS include:
DOKS - це керована служба Kubernetes, що пропонується DigitalOcean. Служба призначена для **розгортання та управління кластерами Kubernetes на платформі DigitalOcean**. Основні аспекти DOKS включають:
1. **Ease of Management**: The requirement to set up and maintain the underlying infrastructure is eliminated, simplifying the management of Kubernetes clusters.
2. **User-Friendly Interface**: It provides an intuitive interface that facilitates the creation and administration of clusters.
3. **Integration with DigitalOcean Services**: It seamlessly integrates with other services provided by DigitalOcean, such as Load Balancers and Block Storage.
4. **Automatic Updates and Upgrades**: The service includes the automatic updating and upgrading of clusters to ensure they are up-to-date.
### Connection
1. **Легкість управління**: Вимога налаштування та підтримки базової інфраструктури усунена, що спрощує управління кластерами Kubernetes.
2. **Зручний інтерфейс**: Він надає інтуїтивно зрозумілий інтерфейс, який полегшує створення та адміністрування кластерів.
3. **Інтеграція з послугами DigitalOcean**: Він безшовно інтегрується з іншими послугами, що надаються DigitalOcean, такими як балансувальники навантаження та блочне сховище.
4. **Автоматичні оновлення та апгрейди**: Служба включає автоматичне оновлення та апгрейд кластерів, щоб забезпечити їх актуальність.
### З'єднання
```bash
# Generate kubeconfig from doctl
doctl kubernetes cluster kubeconfig save <cluster-id>
@@ -22,9 +21,7 @@ doctl kubernetes cluster kubeconfig save <cluster-id>
# Use a kubeconfig file that you can download from the console
kubectl --kubeconfig=/<pathtodirectory>/k8s-1-25-4-do-0-ams3-1670939911166-kubeconfig.yaml get nodes
```
### Enumeration
### Перерахування
```bash
# Get clusters
doctl kubernetes cluster list
@@ -35,9 +32,4 @@ doctl kubernetes cluster node-pool list <cluster-id>
# Get DO resources used by the cluster
doctl kubernetes cluster list-associated-resources <cluster-id>
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,48 +2,34 @@
{{#include ../../../banners/hacktricks-training.md}}
### Domains
### Домені
```bash
doctl compute domain list
doctl compute domain records list <domain>
# You can also create records
```
### Reserverd IPs
### Зарезервовані IP-адреси
```bash
doctl compute reserved-ip list
doctl compute reserved-ip-action unassign <ip>
```
### Load Balancers
### Балансувальники навантаження
```bash
doctl compute load-balancer list
doctl compute load-balancer remove-droplets <id> --droplet-ids 12,33
doctl compute load-balancer add-forwarding-rules <id> --forwarding-rules entry_protocol:tcp,entry_port:3306,...
```
### VPC
```
doctl vpcs list
```
### Firewall
> [!CAUTION]
> By default **droplets are created WITHOUT A FIREWALL** (not like in oder clouds such as AWS or GCP). So if you want DO to protect the ports of the droplet (VM), you need to **create it and attach it**.
> За замовчуванням **дроплети створюються БЕЗ БРАНИЦІ** (не так, як в інших хмарах, таких як AWS або GCP). Тому, якщо ви хочете, щоб DO захищав порти дроплета (VM), вам потрібно **створити її та прикріпити**.
```bash
doctl compute firewall list
doctl compute firewall list-by-droplet <droplet-id>
doctl compute firewall remove-droplets <fw-id> --droplet-ids <droplet-id>
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -1,27 +1,21 @@
# DO - Projects
# DO - Проекти
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
> project is just a container for all the **services** (droplets, spaces, databases, kubernetes...) **running together inside of it**.\
> For more info check:
> проект - це просто контейнер для всіх **послуг** (дроплети, простори, бази даних, кубернетес...) **які працюють разом всередині нього**.\
> Для отримання додаткової інформації дивіться:
{{#ref}}
../do-basic-information.md
{{#endref}}
### Enumeration
It's possible to **enumerate all the projects a user have access to** and all the resources that are running inside a project very easily:
### Перерахування
Легко **перерахувати всі проекти, до яких має доступ користувач** та всі ресурси, які працюють всередині проекту:
```bash
doctl projects list # Get projects
doctl projects resources list <proj-id> # Get all the resources of a project
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,25 +2,24 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
DigitalOcean Spaces are **object storage services**. They allow users to **store and serve large amounts of data**, such as images and other files, in a scalable and cost-effective way. Spaces can be accessed via the DigitalOcean control panel, or using the DigitalOcean API, and are integrated with other DigitalOcean services such as Droplets (virtual private servers) and Load Balancers.
DigitalOcean Spaces є **сервісами об'єктного зберігання**. Вони дозволяють користувачам **зберігати та надавати великі обсяги даних**, такі як зображення та інші файли, у масштабованому та економічному вигляді. До Spaces можна отримати доступ через панель управління DigitalOcean або за допомогою API DigitalOcean, і вони інтегровані з іншими сервісами DigitalOcean, такими як Droplets (віртуальні приватні сервери) та Load Balancers.
### Access
### Доступ
Spaces can be **public** (anyone can access them from the Internet) or **private** (only authorised users). To access the files from a private space outside of the Control Panel, we need to generate an **access key** and **secret**. These are a pair of random tokens that serve as a **username** and **password** to grant access to your Space.
Spaces можуть бути **публічними** (будь-хто може отримати до них доступ з Інтернету) або **приватними** (тільки авторизовані користувачі). Щоб отримати доступ до файлів з приватного простору поза панеллю управління, нам потрібно згенерувати **ключ доступу** та **секрет**. Це пара випадкових токенів, які слугують як **ім'я користувача** та **пароль** для надання доступу до вашого простору.
A **URL of a space** looks like this: **`https://uniqbucketname.fra1.digitaloceanspaces.com/`**\
Note the **region** as **subdomain**.
**URL простору** виглядає так: **`https://uniqbucketname.fra1.digitaloceanspaces.com/`**\
Зверніть увагу на **регіон** як **піддомен**.
Even if the **space** is **public**, **files** **inside** of it can be **private** (you will be able to access them only with credentials).
Навіть якщо **простір** є **публічним**, **файли** **всередині** нього можуть бути **приватними** (ви зможете отримати до них доступ лише з обліковими даними).
However, **even** if the file is **private**, from the console it's possible to share a file with a link such as `https://fra1.digitaloceanspaces.com/uniqbucketname/filename?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PL3RA373GBV4TRF7%2F20221213%2Ffra1%2Fs3%2Faws4_request&X-Amz-Date=20221213T121017Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6a183dbc42453a8d30d7cd2068b66aeb9ebc066123629d44a8108115def975bc` for a period of time:
Однак, **навіть** якщо файл є **приватним**, з консолі можливо поділитися файлом за посиланням, таким як `https://fra1.digitaloceanspaces.com/uniqbucketname/filename?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PL3RA373GBV4TRF7%2F20221213%2Ffra1%2Fs3%2Faws4_request&X-Amz-Date=20221213T121017Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6a183dbc42453a8d30d7cd2068b66aeb9ebc066123629d44a8108115def975bc` на певний період часу:
<figure><img src="../../../images/image (277).png" alt=""><figcaption></figcaption></figure>
### Enumeration
### Перерахування
```bash
# Unauthenticated
## Note how the region is specified in the endpoint
@@ -42,9 +41,4 @@ aws s3 ls --endpoint=https://fra1.digitaloceanspaces.com s3://uniqbucketname
## It's also possible to generate authorized access to buckets from the API
```
{{#include ../../../banners/hacktricks-training.md}}

View File

@@ -2,18 +2,12 @@
{{#include ../../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
DigitalOcean volumes are **block storage** devices that can be **attached to and detached from Droplets**. Volumes are useful for **storing data** that needs to **persist** independently of the Droplet itself, such as databases or file storage. They can be resized, attached to multiple Droplets, and snapshot for backups.
### Enumeration
DigitalOcean volumes є **блоковими сховищами** даних, які можуть бути **підключені та відключені від Droplets**. Volumes корисні для **зберігання даних**, які повинні **зберігатися** незалежно від самого Droplet, таких як бази даних або файлове сховище. Їх можна змінювати в розмірі, підключати до кількох Droplets і створювати знімки для резервного копіювання.
### Перерахування
```
compute volume list
```
{{#include ../../../banners/hacktricks-training.md}}