Files
hacktricks-cloud/src/pentesting-cloud/azure-security/az-services/az-queue-enum.md

3.0 KiB

Az - Queue Storage

{{#include ../../../banners/hacktricks-training.md}}

Osnovne informacije

Azure Queue Storage je usluga u Microsoftovoj Azure cloud platformi dizajnirana za redosled poruka između komponenti aplikacije, omogućavajući asinhronu komunikaciju i dekoplovanje. Omogućava vam da čuvate neograničen broj poruka, svaka do 64 KB veličine, i podržava operacije kao što su kreiranje i brisanje redova, dodavanje, preuzimanje, ažuriranje i brisanje poruka, kao i upravljanje metapodacima i politikama pristupa. Iako obično obrađuje poruke po principu prvi došao, prvi uslužen (FIFO), strogi FIFO nije garantovan.

Enumeracija

{{#tabs }} {{#tab name="Az Cli" }}

# You need to know the --account-name of the storage (az storage account list)
az storage queue list --account-name <storage_account>

# Queue Metadata
az storage queue metadata show --name <queue_name> --account-name <storage_account>

#Get ACL
az storage queue policy list --queue-name <queue_name> --account-name <storage_account>

# Get Messages (getting a message deletes it)
az storage message get --queue-name <queue_name> --account-name <storage_account>

# Peek Messages
az storage message peek --queue-name <queue_name> --account-name <storage_account>

{{#endtab }}

{{#tab name="Az PS" }}

# Get the Storage Context
$storageAccount = Get-AzStorageAccount -ResourceGroupName QueueResourceGroup -Name queuestorageaccount1994
$ctx = $storageAccount.Context

# Set Variables for Storage Account
$storageAccountName = "queuestorageaccount"

# List Queues
Get-AzStorageQueue -Context $context
$queueName = "myqueue"

# Retrieve a specific queue
$queue = Get-AzStorageQueue -Name $queueName -Context $context
$queue # Show the properties of the queue

# Retrieve the access policies for the queue
$accessPolicies = Get-AzStorageQueueStoredAccessPolicy -Context $context -QueueName $queueName
$accessPolicies

# Peek Messages
$queueMessage = $queue.QueueClient.PeekMessage()
$queueMessage.Value

# Set the amount of time you want to entry to be invisible after read from the queue
# If it is not deleted by the end of this time, it will show up in the queue again
$visibilityTimeout = [System.TimeSpan]::FromSeconds(10)

# Read the messages from the queue, then show the contents of the messages.
$queueMessage = $queue.QueueClient.ReceiveMessages(1,$visibilityTimeout)
$queueMessage.Value

{{#endtab }} {{#endtabs }}

Eskalacija privilegija

{{#ref}} ../az-privilege-escalation/az-queue-privesc.md {{#endref}}

Post Eksploatacija

{{#ref}} ../az-post-exploitation/az-queue-post-exploitation.md {{#endref}}

Postojanost

{{#ref}} ../az-persistence/az-queue-persistance.md {{#endref}}

Reference

{{#include ../../../banners/hacktricks-training.md}}