Skip to content

Commit 393c699

Browse files
committed
Clarify Azure WireServer access contexts
1 parent 2f2df45 commit 393c699

1 file changed

Lines changed: 21 additions & 31 deletions

File tree

  • src/pentesting-cloud/azure-security/az-services/vms

src/pentesting-cloud/azure-security/az-services/vms/README.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -873,29 +873,21 @@ The **ExtensionsConfig** contains detailed configuration of VM extensions and ma
873873
These endpoints are typically accessed via:
874874
875875
```bash
876-
curl -H "x-ms-version: 2012-11-30" http://168.63.129.16/?comp=goalstate
876+
curl -H "x-ms-version: 2012-11-30" http://168.63.129.16/machine?comp=goalstate
877877
```
878878
879-
### Access Restrictions
879+
### Access considerations
880880
881-
Although the endpoint is reachable from the VM network, **it is not equally accessible from all contexts**.
881+
The WireServer IP is generally reachable from inside the VM through the guest network stack. It is not restricted only to the Azure VM Agent, Run Command, or VM extensions. Microsoft even documents agentless Linux provisioning examples where ordinary in-guest scripts query GoalState directly from `168.63.129.16`.
882882
883-
**Accessible from**:
883+
However, not every process will necessarily get the same practical result:
884884
885-
- Azure **VM Agent**
886-
- Azure **Run Command**
887-
- **VM Extensions**
885+
- Some endpoints require Azure-specific headers, such as `x-ms-version: 2012-11-30` for GoalState.
886+
- Local guest controls can block or alter access, including host firewall rules, proxies, routes, network namespaces, containers, or endpoint protection.
887+
- VM extensions and Run Command commonly execute as `root`/`SYSTEM` through the VM Agent, so they may bypass local OS restrictions that affect an interactive user.
888+
- Some data is agent/extension-specific and may depend on the VM's provisioning state, installed agent, configured extensions, or managed identity configuration.
888889
889-
**Not reliably accessible from**:
890-
891-
- Interactive SSH sessions (e.g., `azureuser`)
892-
- Unprivileged processes inside the VM
893-
894-
This is because:
895-
896-
- The WireServer is designed for **platform-agent communication**
897-
- Requests may require **specific headers, timing, or context**
898-
- Some responses are only available to the **VM Agent execution environment**
890+
Therefore, if a request works from Run Command but fails from SSH, the usual explanation is a difference in OS user, environment, routing, proxy, firewall, or namespace, not a general Azure rule that only agent execution contexts can reach `168.63.129.16`.
899891
900892
### Run Command vs SSH Context
901893
@@ -906,11 +898,9 @@ Azure provides multiple ways to execute commands inside a VM, but **they do not
906898
Run Command is an Azure feature that executes scripts via the **VM Agent**.
907899
908900
- Uses: `Microsoft.Compute/virtualMachines/runCommand/action`
909-
- Runs with **agent-level privileges**
910-
- Has access to:
911-
- WireServer
912-
- GoalState
913-
- ExtensionsConfig
901+
- Runs through the **Azure VM Agent**
902+
- Usually runs with elevated local privileges (`root` on Linux or `SYSTEM` on Windows)
903+
- Can often reach WireServer/GoalState/ExtensionsConfig even when a low-privileged user is blocked by local controls
914904
915905
Example:
916906
@@ -928,12 +918,13 @@ When connecting via SSH:
928918
929919
- Runs as a **regular OS user**
930920
- Uses standard network stack
931-
- Does **NOT have agent-level access**
921+
- Does **not** have VM Agent privileges by default
932922
933923
As a result:
934924
935-
- Requests to `168.63.129.16` may fail or return incomplete data
936-
- GoalState may not be accessible
925+
- Requests to `168.63.129.16` can work from SSH if the guest configuration allows it
926+
- Requests may fail if blocked by local firewall, proxy, routing, network namespace, or user-level controls
927+
- GoalState requests require the correct endpoint path and headers
937928
938929
**Script Examples to get attached managed identities:**
939930
@@ -949,7 +940,6 @@ ws="http://168.63.129.16"
949940
echo "[*] Getting Goal State..."
950941
951942
goal_urls=(
952-
"$ws/?comp=goalstate"
953943
"$ws/machine?comp=goalstate"
954944
"$ws/machine/?comp=goalstate"
955945
)
@@ -1081,7 +1071,6 @@ $h = @{
10811071
Write-Host "[*] Getting Goal State..." -ForegroundColor Cyan
10821072
10831073
$goalUrls = @(
1084-
"$ws/?comp=goalstate",
10851074
"$ws/machine?comp=goalstate",
10861075
"$ws/machine/?comp=goalstate"
10871076
)
@@ -1169,11 +1158,12 @@ foreach ($id in $ids) {
11691158
- [https://learn.microsoft.com/en-us/azure/virtual-machines/overview](https://learn.microsoft.com/en-us/azure/virtual-machines/overview)
11701159
- [https://hausec.com/2022/05/04/azure-virtual-machine-execution-techniques/](https://hausec.com/2022/05/04/azure-virtual-machine-execution-techniques/)
11711160
- [https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service](https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service)
1172-
- [https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16](https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16)
1173-
- [https://learn.microsoft.com/en-us/azure/virtual-machines/run-command](https://learn.microsoft.com/en-us/azure/virtual-machines/run-command)
1174-
- [https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-linux](https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-linux)
1161+
- [https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16](https://learn.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16)
1162+
- [https://learn.microsoft.com/en-us/azure/virtual-machines/linux/no-agent](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/no-agent)
1163+
- [https://learn.microsoft.com/en-us/azure/virtual-machines/run-command](https://learn.microsoft.com/en-us/azure/virtual-machines/run-command)
1164+
- [https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-linux](https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/agent-linux)
1165+
- [https://www.cybercx.com.au/blog/azure-ssrf-metadata/](https://www.cybercx.com.au/blog/azure-ssrf-metadata/)
11751166
11761167
{{#include ../../../../banners/hacktricks-training.md}}
11771168
11781169
1179-

0 commit comments

Comments
 (0)