Skip to content

Azure VM Command Execution Using Third-Party Chef Extensions#329

Open
carlospolop wants to merge 1 commit into
masterfrom
update_Azure_VM_Command_Execution_Using_Third-Party_Che_769a4ae89af0f891
Open

Azure VM Command Execution Using Third-Party Chef Extensions#329
carlospolop wants to merge 1 commit into
masterfrom
update_Azure_VM_Command_Execution_Using_Third-Party_Che_769a4ae89af0f891

Conversation

@carlospolop

Copy link
Copy Markdown
Collaborator

🤖 Automated Content Update

This PR was automatically generated by the HackTricks News Bot based on a technical blog post.

📝 Source Information

🎯 Content Summary

Overview

The post demonstrates how an Azure principal with Microsoft.Compute/virtualMachines/extensions/write can turn legitimate third-party VM-extension administration into arbitrary privileged command execution on an Azure Windows or Linux VM. The attacker deploys the marketplace Chef extension, redirects it to an attacker-controlled Chef server, and selects a malicious cookbook through the extension's run list. The Azure VM Agent installs and runs the extension, after...

🔧 Technical Details

Convert Azure extension-management permission into guest command execution: A cloud identity with Microsoft.Compute/virtualMachines/extensions/write can deploy or reconfigure software inside an Azure VM without knowing the guest's SSH, RDP, or local credentials. Configuration-management extensions are especially useful for this because the Azure VM Agent runs them in a privileged context and they are designed to make operating-system changes. This pattern applies to any extension that accepts attacker-controlled scripts, commands, policy sources, packages, or management-server settings.

Redirect a trusted configuration-management client to a rogue server: If a VM extension allows its management-server URL and desired policy to be specified from the cloud control plane, set the server URL to attacker-controlled infrastructure and select a malicious policy. With Chef, set bootstrap_options.chef_server_url to the rogue C...

🤖 Agent Actions

Updated src/pentesting-cloud/azure-security/az-privilege-escalation/az-virtual-machines-and-network-privesc.md.

Added:

  • A new Chef Client / LinuxChefClient subsection under VM extension abuse
  • The rogue Chef server + runlist redirection technique
  • A minimal Chef execute recipe example
  • The Azure CLI extension deployment pattern
  • IMDS token theft follow-up and host/cloud investigation artifacts
  • A new References section at the end

Verification:

  • Checked the final diff and markdown placement manually
  • Tried mdbook build, but mdbook is not installed in this environment

This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.

@carlospolop

Copy link
Copy Markdown
Collaborator Author

🔗 Additional Context

Original Blog Post: https://netspi.com/blog/technical-blog/cloud-pentesting/azure-vm-command-execution-using-third-party-extensions

Content Categories: Based on the analysis, this content was categorized under "Pentesting Cloud > Azure Pentesting > Az - Privilege Escalation > Az - Virtual Machines & Network Privesc, with a cross-reference from Az - Services > Az - Virtual Machines & Network and Az - Post Exploitation > Az - VMs & Network Post Exploitation".

Repository Maintenance:

  • MD Files Formatting: 590 files processed

Review Notes:

  • This content was automatically processed and may require human review for accuracy
  • Check that the placement within the repository structure is appropriate
  • Verify that all technical details are correct and up-to-date
  • All .md files have been checked for proper formatting (headers, includes, etc.)

Bot Version: HackTricks News Bot v1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant