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

@@ -4,100 +4,99 @@
## Azure SQL
Azure SQL is a family of managed, secure, and intelligent products that use the **SQL Server database engine in the Azure cloud**. This means you don't have to worry about the physical administration of your servers, and you can focus on managing your data.
Azure SQL एक प्रबंधित, सुरक्षित और बुद्धिमान उत्पादों का परिवार है जो **Azure क्लाउड में SQL Server डेटाबेस इंजन का उपयोग करता है**। इसका मतलब है कि आपको अपने सर्वरों के भौतिक प्रशासन की चिंता करने की आवश्यकता नहीं है, और आप अपने डेटा के प्रबंधन पर ध्यान केंद्रित कर सकते हैं।
Azure SQL consists of three main offerings:
Azure SQL में तीन मुख्य पेशकशें शामिल हैं:
1. **Azure SQL Database**: This is a **fully-managed database service**, which allows you to host individual databases in the Azure cloud. It offers built-in intelligence that learns your unique database patterns and provides customized recommendations and automatic tuning.
2. **Azure SQL Managed Instance**: This is for larger scale, entire SQL Server instance-scoped deployments. It provides near 100% compatibility with the latest SQL Server on-premises (Enterprise Edition) Database Engine, which provides a native virtual network (VNet) implementation that addresses common security concerns, and a business model favorable for on-premises SQL Server customers.
3. **Azure SQL Server on Azure VMs**: This is Infrastructure as a Service (IaaS) and is best for migrations where you want **control over the operating system and SQL Server instance**, like it was a server running on-premises.
1. **Azure SQL Database**: यह एक **पूर्ण-प्रबंधित डेटाबेस सेवा** है, जो आपको Azure क्लाउड में व्यक्तिगत डेटाबेस होस्ट करने की अनुमति देती है। यह अंतर्निहित बुद्धिमत्ता प्रदान करती है जो आपके अद्वितीय डेटाबेस पैटर्न को सीखती है और अनुकूलित सिफारिशें और स्वचालित ट्यूनिंग प्रदान करती है।
2. **Azure SQL Managed Instance**: यह बड़े पैमाने पर, पूरे SQL Server इंस्टेंस-स्कोप्ड डिप्लॉयमेंट के लिए है। यह नवीनतम SQL Server ऑन-प्रिमाइसेस (Enterprise Edition) डेटाबेस इंजन के साथ लगभग 100% संगतता प्रदान करता है, जो सामान्य सुरक्षा चिंताओं को संबोधित करने के लिए एक स्वदेशी वर्चुअल नेटवर्क (VNet) कार्यान्वयन प्रदान करता है, और ऑन-प्रिमाइसेस SQL Server ग्राहकों के लिए एक व्यावसायिक मॉडल अनुकूल है।
3. **Azure SQL Server on Azure VMs**: यह इन्फ्रास्ट्रक्चर एज़ अ सर्विस (IaaS) है और उन माइग्रेशनों के लिए सबसे अच्छा है जहाँ आप **ऑपरेटिंग सिस्टम और SQL Server इंस्टेंस पर नियंत्रण** चाहते हैं, जैसे कि यह एक ऑन-प्रिमाइसेस सर्वर पर चल रहा हो।
### Azure SQL Database
**Azure SQL Database** is a **fully managed database platform as a service (PaaS)** that provides scalable and secure relational database solutions. It's built on the latest SQL Server technologies and eliminates the need for infrastructure management, making it a popular choice for cloud-based applications.
**Azure SQL Database** एक **पूर्ण प्रबंधित डेटाबेस प्लेटफ़ॉर्म एज़ अ सर्विस (PaaS)** है जो स्केलेबल और सुरक्षित रिलेशनल डेटाबेस समाधान प्रदान करता है। यह नवीनतम SQL Server तकनीकों पर आधारित है और इन्फ्रास्ट्रक्चर प्रबंधन की आवश्यकता को समाप्त करता है, जिससे यह क्लाउड-आधारित अनुप्रयोगों के लिए एक लोकप्रिय विकल्प बनता है।
#### Key Features
- **Always Up-to-Date**: Runs on the latest stable version of SQL Server and Receives new features and patches automatically.
- **PaaS Capabilities**: Built-in high availability, backups, and updates.
- **Data Flexibility**: Supports relational and non-relational data (e.g., graphs, JSON, spatial, and XML).
- **हमेशा अद्यतित**: नवीनतम स्थिर संस्करण पर चलता है और नए फीचर्स और पैच स्वचालित रूप से प्राप्त करता है।
- **PaaS क्षमताएँ**: अंतर्निहित उच्च उपलब्धता, बैकअप, और अपडेट।
- **डेटा लचीलापन**: रिलेशनल और गैर-रिलेशनल डेटा का समर्थन करता है (जैसे, ग्राफ, JSON, स्पैटियल, और XML)
#### Purchasing Models / Service Tiers
- **vCore-based**: Choose compute, memory, and storage independently. For General Purpose, Business Critical (with high resilience and performance for OLTP apps), and scales up to 128 TB storag
- **DTU-based**: Bundles compute, memory, and I/O into fixed tiers. Balanced resources for common tasks.
- Standard: Balanced resources for common tasks.
- Premium: High performance for demanding workloads.
- **vCore-आधारित**: स्वतंत्र रूप से कंप्यूट, मेमोरी, और स्टोरेज चुनें। सामान्य उद्देश्य, व्यवसायिक महत्वपूर्ण (OLTP ऐप्स के लिए उच्च लचीलापन और प्रदर्शन के साथ), और 128 TB स्टोरेज तक स्केल करता है।
- **DTU-आधारित**: कंप्यूट, मेमोरी, और I/O को निश्चित स्तरों में बंडल करता है। सामान्य कार्यों के लिए संतुलित संसाधन।
- मानक: सामान्य कार्यों के लिए संतुलित संसाधन।
- प्रीमियम: मांग वाले कार्यभार के लिए उच्च प्रदर्शन।
#### Deployment Models
Azure SQL Database supports flexible deployment options to suit various needs:
Azure SQL Database विभिन्न आवश्यकताओं के अनुसार लचीले तैनाती विकल्पों का समर्थन करता है:
- **Single Database**:
- A fully isolated database with its own dedicated resources.
- Great for microservices or applications requiring a single data source.
- **Elastic Pool**:
- Allows multiple databases to share resources within a pool.
- Cost-efficient for applications with fluctuating usage patterns across multiple databases.
- **एकल डेटाबेस**:
- अपने समर्पित संसाधनों के साथ पूरी तरह से अलग डेटाबेस।
- माइक्रोसर्विसेज या अनुप्रयोगों के लिए महान जो एकल डेटा स्रोत की आवश्यकता होती है।
- **इलास्टिक पूल**:
- एक पूल के भीतर संसाधनों को साझा करने की अनुमति देता है।
- कई डेटाबेस के बीच उतार-चढ़ाव वाले उपयोग पैटर्न वाले अनुप्रयोगों के लिए लागत-कुशल।
#### Scalable performance and pools
- **Single Databases**: Each database is isolated and has its own dedicated compute, memory, and storage resources. Resources can be scaled dynamically (up or down) without downtime (1128 vCores, 32 GB4 TB storage, and up to 128 TB).
- **Elastic Pools**: Share resources across multiple databases in a pool to maximize efficiency and save costs. Resources can also be scaled dynamically for the entire pool.
- **Service Tier Flexibility**: Start small with a single database in the General Purpose tier. Upgrade to Business Critical or Hyperscale tiers as needs grow.
- **Scaling Options**: Dynamic Scaling or Autoscaling Alternatives.
- **एकल डेटाबेस**: प्रत्येक डेटाबेस अलग है और इसके अपने समर्पित कंप्यूट, मेमोरी, और स्टोरेज संसाधन हैं। संसाधनों को बिना डाउनटाइम (1128 vCores, 32 GB4 TB स्टोरेज, और 128 TB तक) गतिशील रूप से स्केल किया जा सकता है।
- **इलास्टिक पूल**: अधिकतम दक्षता और लागत बचाने के लिए एक पूल में कई डेटाबेस के बीच संसाधनों को साझा करें। पूरे पूल के लिए संसाधनों को भी गतिशील रूप से स्केल किया जा सकता है।
- **सेवा स्तर लचीलापन**: सामान्य उद्देश्य स्तर में एकल डेटाबेस के साथ छोटे स्तर पर शुरू करें। आवश्यकताओं के बढ़ने पर व्यवसायिक महत्वपूर्ण या हाइपरस्केल स्तरों में अपग्रेड करें।
- **स्केलिंग विकल्प**: गतिशील स्केलिंग या ऑटोस्केलिंग विकल्प।
#### Built-In Monitoring & Optimization
- **Query Store**: Tracks performance issues, identifies top resource consumers, and offers actionable recommendations.
- **Automatic Tuning**: Proactively optimizes performance with features like automatic indexing and query plan corrections.
- **Telemetry Integration**: Supports monitoring through Azure Monitor, Event Hubs, or Azure Storage for tailored insights.
- **क्वेरी स्टोर**: प्रदर्शन समस्याओं को ट्रैक करता है, शीर्ष संसाधन उपभोक्ताओं की पहचान करता है, और कार्यान्वयन योग्य सिफारिशें प्रदान करता है।
- **स्वचालित ट्यूनिंग**: स्वचालित अनुक्रमणिका और क्वेरी योजना सुधार जैसी सुविधाओं के साथ प्रदर्शन को सक्रिय रूप से अनुकूलित करता है।
- **टेलीमेट्री एकीकरण**: अनुकूलित अंतर्दृष्टि के लिए Azure Monitor, Event Hubs, या Azure Storage के माध्यम से निगरानी का समर्थन करता है।
#### Disaster Recovery & Availavility
#### Disaster Recovery & Availability
- **Automatic backups**: SQL Database automatically performs full, differential, and transaction log backups of databases
- **Point-in-Time Restore**: Recover databases to any past state within the backup retention period.
- **Geo-Redundancy**
- **Failover Groups**: Simplifies disaster recovery by grouping databases for automatic failover across regions.
- **स्वचालित बैकअप**: SQL Database स्वचालित रूप से डेटाबेस के पूर्ण, विभेदक, और लेनदेन लॉग बैकअप करता है।
- **पॉइंट-इन-टाइम पुनर्स्थापना**: बैकअप संरक्षण अवधि के भीतर किसी भी पिछले राज्य में डेटाबेस को पुनर्प्राप्त करें।
- **जियो-रेडंडेंसी**
- **फेलओवर समूह**: क्षेत्रों के बीच स्वचालित फेलओवर के लिए डेटाबेस को समूहित करके आपदा पुनर्प्राप्ति को सरल बनाता है।
### Azure SQL Managed Instance
**Azure SQL Managed Instance** is a Platform as a Service (PaaS) database engine that offers near 100% compatibility with SQL Server and handles most management tasks (e.g., upgrading, patching, backups, monitoring) automatically. It provides a cloud solution for migrating on-premises SQL Server databases with minimal changes.
**Azure SQL Managed Instance** एक प्लेटफ़ॉर्म एज़ अ सर्विस (PaaS) डेटाबेस इंजन है जो SQL Server के साथ लगभग 100% संगतता प्रदान करता है और अधिकांश प्रबंधन कार्यों (जैसे, अपग्रेडिंग, पैचिंग, बैकअप, निगरानी) को स्वचालित रूप से संभालता है। यह न्यूनतम परिवर्तनों के साथ ऑन-प्रिमाइसेस SQL Server डेटाबेस को माइग्रेट करने के लिए एक क्लाउड समाधान प्रदान करता है।
#### Service Tiers
- **General Purpose**: Cost-effective option for applications with standard I/O and latency requirements.
- **Business Critical**: High-performance option with low I/O latency for critical workloads.
- **सामान्य उद्देश्य**: मानक I/O और विलंबता आवश्यकताओं वाले अनुप्रयोगों के लिए लागत-कुशल विकल्प।
- **व्यवसायिक महत्वपूर्ण**: महत्वपूर्ण कार्यभार के लिए कम I/O विलंबता के साथ उच्च-प्रदर्शन विकल्प।
#### Advanced Security Features
* **Threat Protection**: Advanced Threat Protection alerts for suspicious activities and SQL injection attacks. Auditing to track and log database events for compliance.
* **Access Control**: Microsoft Entra authentication for centralized identity management. Row-Level Security and Dynamic Data Masking for granular access control.
* **Backups**: Automated and manual backups with point-in-time restore capability.
* **धमकी सुरक्षा**: संदिग्ध गतिविधियों और SQL इंजेक्शन हमलों के लिए उन्नत धमकी सुरक्षा अलर्ट। अनुपालन के लिए डेटाबेस घटनाओं को ट्रैक और लॉग करने के लिए ऑडिटिंग।
* **एक्सेस नियंत्रण**: केंद्रीकृत पहचान प्रबंधन के लिए Microsoft Entra प्रमाणीकरण। ग्रैन्युलर एक्सेस नियंत्रण के लिए रो-लेवल सुरक्षा और डायनामिक डेटा मास्किंग।
* **बैकअप**: पॉइंट-इन-टाइम पुनर्स्थापना क्षमता के साथ स्वचालित और मैनुअल बैकअप।
### Azure SQL Virtual Machines
**Azure SQL Virtual Machines** is best for migrations where you want **control over the operating system and SQL Server instance**, like it was a server running on-premises. It can have different machine sizes, and a wide selection of SQL Server versions and editions.
**Azure SQL Virtual Machines** उन माइग्रेशनों के लिए सबसे अच्छा है जहाँ आप **ऑपरेटिंग सिस्टम और SQL Server इंस्टेंस पर नियंत्रण** चाहते हैं, जैसे कि यह एक ऑन-प्रिमाइसेस सर्वर पर चल रहा हो। इसमें विभिन्न मशीन आकार हो सकते हैं, और SQL Server के संस्करणों और संस्करणों का एक विस्तृत चयन हो सकता है।
#### Key Features
**Automated Backup**: Schedule backups for SQL databases.
**Automatic Patching**: Automates the installation of Windows and SQL Server updates during a maintenance window.
**Azure Key Vault Integration**: Automatically configures Key Vault for SQL Server VMs.
**Defender for Cloud Integration**: View Defender for SQL recommendations in the portal.
**Version/Edition Flexibility**: Change SQL Server version or edition metadata without redeploying the VM.
**स्वचालित बैकअप**: SQL डेटाबेस के लिए बैकअप शेड्यूल करें।
**स्वचालित पैचिंग**: रखरखाव विंडो के दौरान Windows और SQL Server अपडेट के इंस्टॉलेशन को स्वचालित करता है।
**Azure Key Vault एकीकरण**: SQL Server VMs के लिए Key Vault को स्वचालित रूप से कॉन्फ़िगर करता है।
**Cloud के लिए डिफेंडर एकीकरण**: पोर्टल में SQL के लिए डिफेंडर सिफारिशें देखें।
**संस्करण/संस्करण लचीलापन**: VM को फिर से तैनात किए बिना SQL Server संस्करण या संस्करण मेटाडेटा बदलें।
#### Security Features
**Microsoft Defender for SQL**: Security insights and alerts.
**Azure Key Vault Integration**: Secure storage of credentials and encryption keys.
**Microsoft Entra (Azure AD)**: Authentication and access control.
**Microsoft Defender for SQL**: सुरक्षा अंतर्दृष्टि और अलर्ट।
**Azure Key Vault एकीकरण**: क्रेडेंशियल और एन्क्रिप्शन कुंजियों का सुरक्षित भंडारण।
**Microsoft Entra (Azure AD)**: प्रमाणीकरण और एक्सेस नियंत्रण।
## Enumeration
{{#tabs}}
{{#tab name="az cli"}}
```bash
# List Servers
az sql server list # --output table
@@ -164,11 +163,9 @@ az sql midb show --resource-group <res-grp> --name <name>
az sql vm list
az sql vm show --resource-group <res-grp> --name <name>
```
{{#endtab}}
{{#tab name="Az PowerShell"}}
```powershell
# List Servers
Get-AzSqlServer -ResourceGroupName "<resource-group-name>"
@@ -206,60 +203,51 @@ Get-AzSqlInstanceDatabase -ResourceGroupName <ResourceGroupName> -InstanceName <
# Lis all sql VM
Get-AzSqlVM
```
{{#endtab}}
{{#endtabs}}
### Connect and run SQL queries
You could find a connection string (containing credentials) from example [enumerating an Az WebApp](az-app-services.md):
### कनेक्ट करें और SQL क्वेरी चलाएँ
आप एक कनेक्शन स्ट्रिंग (जिसमें क्रेडेंशियल्स शामिल हैं) उदाहरण [एक Az WebApp की गणना करना](az-app-services.md) से पा सकते हैं:
```powershell
function invoke-sql{
param($query)
$Connection_string = "Server=tcp:supercorp.database.windows.net,1433;Initial Catalog=flag;Persist Security Info=False;User ID=db_read;Password=gAegH!324fAG!#1fht;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
$Connection = New-Object System.Data.SqlClient.SqlConnection $Connection_string
$Connection.Open()
$Command = New-Object System.Data.SqlClient.SqlCommand
$Command.Connection = $Connection
$Command.CommandText = $query
$Reader = $Command.ExecuteReader()
while ($Reader.Read()) {
$Reader.GetValue(0)
}
$Connection.Close()
param($query)
$Connection_string = "Server=tcp:supercorp.database.windows.net,1433;Initial Catalog=flag;Persist Security Info=False;User ID=db_read;Password=gAegH!324fAG!#1fht;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
$Connection = New-Object System.Data.SqlClient.SqlConnection $Connection_string
$Connection.Open()
$Command = New-Object System.Data.SqlClient.SqlCommand
$Command.Connection = $Connection
$Command.CommandText = $query
$Reader = $Command.ExecuteReader()
while ($Reader.Read()) {
$Reader.GetValue(0)
}
$Connection.Close()
}
invoke-sql 'Select Distinct TABLE_NAME From information_schema.TABLES;'
```
You can also use sqlcmd to access the database. It is important to know if the server allows public connections `az sql server show --name <server-name> --resource-group <resource-group>`, and also if it the firewall rule let's our IP to access:
आप sqlcmd का उपयोग करके डेटाबेस तक भी पहुँच सकते हैं। यह जानना महत्वपूर्ण है कि क्या सर्वर सार्वजनिक कनेक्शन की अनुमति देता है `az sql server show --name <server-name> --resource-group <resource-group>` और यह भी कि क्या फ़ायरवॉल नियम हमारे IP को पहुँचने की अनुमति देता है:
```powershell
sqlcmd -S <sql-server>.database.windows.net -U <server-user> -P <server-passworkd> -d <database>
```
## References
## संदर्भ
- [https://learn.microsoft.com/en-us/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview?view=azuresql](https://learn.microsoft.com/en-us/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview?view=azuresql)
- [https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-overview?view=azuresql](https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-overview?view=azuresql)
- [https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview?view=azuresql](https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview?view=azuresql)
- [https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-server-on-azure-vm-iaas-what-is-overview?view=azuresql](https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/sql-server-on-azure-vm-iaas-what-is-overview?view=azuresql)
## Privilege Escalation
## विशेषाधिकार वृद्धि
{{#ref}}
../az-privilege-escalation/az-sql-privesc.md
{{#endref}}
## Post Exploitation
## पोस्ट एक्सप्लॉइटेशन
{{#ref}}
../az-post-exploitation/az-sql-post-exploitation.md
{{#endref}}
{{#include ../../../banners/hacktricks-training.md}}