mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-02-05 19:32:24 -08:00
Translated ['src/pentesting-cloud/azure-security/az-services/az-cosmosDB
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
|
||||
* 查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
|
||||
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **在** **Twitter** 🐦 **上关注我们** [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享黑客技巧。
|
||||
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 分享黑客技巧。
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Azure CosmosDB
|
||||
|
||||
**Azure Cosmos DB** 是一个完全 **托管的 NoSQL、关系型和向量数据库**,提供单毫秒级响应时间、自动扩展和 SLA 支持的可用性,具备企业级安全性。它通过即开即用的多区域数据分发、开源 API、流行语言的 SDK 以及集成向量支持和无缝 Azure AI 集成等 AI 数据库功能,加速应用程序开发。
|
||||
**Azure Cosmos DB** 是一个完全 **托管的 NoSQL、关系型和向量数据库**,提供单毫秒级的响应时间、自动扩展和 SLA 支持的可用性,具备企业级安全性。它通过即开即用的多区域数据分发、开源 API、流行语言的 SDK 以及集成向量支持和无缝 Azure AI 集成等 AI 数据库功能,加速应用程序开发。
|
||||
|
||||
Azure Cosmos DB 提供多种数据库 API,以使用文档、关系型、键值、图形和列族数据模型来建模现实世界的数据,这些 API 包括 NoSQL、MongoDB、PostgreSQL、Cassandra、Gremlin 和 Table。
|
||||
|
||||
@@ -131,7 +131,7 @@ Get-AzCosmosDBSqlUserDefinedFunction -ResourceGroupName "<ResourceGroupName>" -A
|
||||
|
||||
#### 连接
|
||||
|
||||
要连接azure-cosmosDB(pip install azure-cosmos)库是必需的。此外,端点和密钥是建立连接的关键组件。
|
||||
要连接 azure-cosmosDB(pip install azure-cosmos)库是必需的。此外,端点和密钥是建立连接的关键组件。
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
from azure.cosmos import CosmosClient, PartitionKey
|
||||
@@ -203,7 +203,7 @@ print("Document inserted.")
|
||||
{% endcode %}
|
||||
|
||||
### MongoDB
|
||||
MongoDB NoSQL API 是一个基于文档的 API,使用类似 JSON 的 BSON(Binary JSON)作为其数据格式。它提供了具有聚合能力的查询语言,使其适合处理结构化、半结构化和非结构化数据。服务的端点通常遵循以下格式:
|
||||
MongoDB NoSQL API 是一个基于文档的 API,使用类似 JSON 的 BSON(Binary JSON)作为其数据格式。它提供了具有聚合能力的查询语言,适合处理结构化、半结构化和非结构化数据。服务的端点通常遵循以下格式:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
@@ -215,7 +215,7 @@ mongodb://<hostname>:<port>/<database>
|
||||
在 MongoDB 中,您可以在一个实例中创建一个或多个数据库。每个数据库作为集合的逻辑分组,并提供资源组织和管理的边界。数据库有助于逻辑上分离和管理数据,例如用于不同的应用程序或项目。
|
||||
|
||||
#### 集合
|
||||
MongoDB 中的数据存储核心单元是集合,它保存文档,并设计用于高效查询和灵活的模式设计。集合具有弹性可扩展性,并可以在分布式设置中支持跨多个节点的高吞吐量操作。
|
||||
MongoDB 中数据存储的核心单元是集合,它保存文档,并设计用于高效查询和灵活的模式设计。集合具有弹性可扩展性,并可以在分布式设置中支持跨多个节点的高吞吐量操作。
|
||||
|
||||
#### 枚举
|
||||
|
||||
@@ -237,6 +237,17 @@ az cosmosdb restorable-database-account list --account-name <AccountName>
|
||||
## Show the identities for a Azure Cosmos DB database account.
|
||||
az cosmosdb identity show --resource-group <ResourceGroupName> --name <AccountName>
|
||||
|
||||
## MongoDB
|
||||
# List all MongoDB databases in a specified Azure Cosmos DB account
|
||||
az cosmosdb mongodb database list --account-name <AccountName> --resource-group <ResourceGroupName>
|
||||
# List all collections in a specific MongoDB database within an Azure Cosmos DB account
|
||||
az cosmosdb mongodb collection list --account-name <AccountName> --database-name <DatabaseName> --resource-group <ResourceGroupName>
|
||||
|
||||
# List all role definitions for MongoDB within an Azure Cosmos DB account
|
||||
az cosmosdb mongodb role definition list --account-name <AccountName> --resource-group <ResourceGroupName>
|
||||
# List all user definitions for MongoDB within an Azure Cosmos DB account
|
||||
az cosmosdb mongodb user definition list --account-name <AccountName> --resource-group <ResourceGroupName>
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
@@ -280,7 +291,7 @@ Get-AzCosmosDBMongoDBRoleDefinition -AccountName <account-name> -ResourceGroupNa
|
||||
|
||||
#### 连接
|
||||
|
||||
在这里,您可以通过密钥或在特权提升部分描述的方法找到密码。
|
||||
在这里,您可以通过密钥或在特权提升部分中描述的方法找到密码。
|
||||
{% code overflow="wrap" %}
|
||||
```python
|
||||
from pymongo import MongoClient
|
||||
@@ -339,7 +350,7 @@ print(f"Inserted document with ID: {result.inserted_id}")
|
||||
|
||||
* 这里的其余数据库,表,cassandra,gremlin...
|
||||
* 查看后期利用 "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions/write" && "Microsoft.DocumentDB/databaseAccounts/mongodbUserDefinitions/read" 和角色定义,因为这里可能存在权限提升
|
||||
* 查看恢复
|
||||
* 查看恢复情况
|
||||
|
||||
|
||||
|
||||
@@ -352,7 +363,7 @@ print(f"Inserted document with ID: {result.inserted_id}")
|
||||
<summary>支持 HackTricks</summary>
|
||||
|
||||
* 查看 [**订阅计划**](https://github.com/sponsors/carlospolop)!
|
||||
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **在** **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)** 上关注我们。**
|
||||
* **加入** 💬 [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**电报群组**](https://t.me/peass) 或 **在** **Twitter** 🐦 **上关注我们** [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
||||
* **通过向** [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享黑客技巧。
|
||||
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user