Skip to content
Access control Write-up Advanced

Compromise Domain With Nopac Exploit

The author describes using the noPac exploit chain (CVE-2021-42278 and CVE-2021-42287) during a penetration test to escalate from a low-privileged domain user to domain administrator. The exploit abuses a user's ability to create machine accounts and a Kerberos PAC flaw to impersonate a domain controller.

V1P3R Follow

Published on systemweakness.com

During the last pentesting in client infra, we compromised a domain with CVE-2021–42287/CVE-2021–42278(noPac) exploits. Gonna give a tip on how to learn and practice before going to infrastructure assessment.

V1P3R, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the combination of a user's delegated right to create machine accounts (CVE-2021-42278, sAMAccountName spoofing) and a Kerberos PAC validation flaw (CVE-2021-42287) that lets an attacker impersonate a domain controller.

What the attacker needed

Low-privileged AD user; delegation to add up to 10 users; network access to domain controller

How it was found

  1. Obtain a low-privileged Active Directory user account that has delegation access to add up to 10 other users.
  2. Enumerate the domain groups and users with crackmapexec.
  3. Run the noPac exploit script against the domain controller, impersonating the Administrator account.
  4. Alternatively, run the sam-the-admin exploit script with the same credentials.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

In a Windows domain, a normal user account can sometimes create a limited number of computer accounts. Two design flaws let an attacker use that ability to trick the domain controller into giving them administrator rights. The author practised this in a free lab and then used it on a real assessment.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.