Skip to main content
This page assumes familiarity with Alloy. If you’re new to the language, start with Alloy Basics and the Alloy Syntax Guide.
The Alloy specification performs structural analysis of Active Directory access control lists to detect privilege escalation paths. It uses constraint solving to find configurations where lower-tier principals can compromise higher-tier resources.

Overview

Alloy is a declarative modeling language based on first-order relational logic. Unlike TLA+ which focuses on temporal behavior, Alloy excels at analyzing static structural properties and finding counterexamples to security assertions. For the AD tier model, Alloy verifies that:
  • No attack paths exist from Tier 2 to Tier 0
  • DCSync rights are restricted to Tier 0
  • Protected groups cannot be modified by lower tiers
  • Resource-Based Constrained Delegation cannot be abused for escalation
The Alloy model performs analysis similar to BloodHound but with formal guarantees. It finds all possible attack paths within the modeled permissions, not just known patterns.

Data Model

Principal Hierarchy

Container Structure

Tier Model

Security Descriptors and ACLs

ACL Structure

Permission Rights

The specification models the full range of AD permissions: Control Rights
Object Rights
Property Rights
Extended Rights (by GUID)
Security-Sensitive Properties

Protected Groups

Well-known privileged groups are automatically assigned to Tier 0:

Attack Path Detection

The specification includes 11 predicates for discovering attack paths. The examples below show the conceptual approach; see the full specification for exact implementation.

Effective Trustee Resolution

Determines if a principal matches an ACE trustee (directly or through group membership):

Core Compromise Predicate

Determines if a principal can compromise a target:

Attack Scenarios

1. WriteDACL/WriteOwner Abuse

Attackers with WriteDACL can grant themselves any permission. WriteOwner allows taking ownership and then modifying the DACL.

2. Group Membership Manipulation

Adding oneself to Domain Admins provides immediate Tier 0 access.

3. Password Reset Attacks

Password reset attacks are particularly dangerous when targeting service accounts, as these accounts often have elevated privileges and run critical services. Accounts with SPNs are especially valuable since resetting their password grants immediate access to the services they operate.

4. DCSync Exploitation

DCSync allows extracting all password hashes from AD, equivalent to full domain compromise.

5. Resource-Based Constrained Delegation (RBCD)

RBCD abuse requires write access to msDS-AllowedToActOnBehalfOfOtherIdentity plus a controlled account with an SPN.

6. SPN Manipulation (Kerberoasting Setup)

Setting an SPN on a user enables Kerberoasting their password hash.

7. Shadow Credentials

Writing to msDS-KeyCredentialLink allows authentication as the target without knowing their password.

8. Constrained Delegation Abuse

An attacker can abuse constrained delegation if they control a service account (directly or through compromise) that has delegation rights to the target.

9. Cross-Tier Compromise Chains

Security Assertions

The specification includes 9 key assertions that verify tier isolation:

1. NoTier2ToTier0Path

2. NoTier1ToTier0Path

3. TierIsolationMaintained

4. DCSyncOnlyTier0

5. ProtectedGroupsSecure

6. NoRBCDEscalation

7. NoDanglingOwners

8. NoTier2ToTier1Path

9. NoSelfEscalationToProtectedGroups

Running the Model

Prerequisites

  1. Download and install the Alloy Analyzer
  2. Clone the ADTierModel-Rust repository

Basic Analysis

  1. Open ADTierModel_ACL.als in the Alloy Analyzer
  2. Select an assertion to check (e.g., NoTier2ToTier0Path)
  3. Click “Execute” to run the analysis

Understanding Scope

The for N clause limits the search space:
This checks the assertion for configurations with up to 6 instances of each signature. Larger scopes find more issues but take longer.

Interpreting Results

No Counterexample Found The assertion holds for all configurations within the specified scope. This provides high confidence but not absolute proof. Counterexample Found Alloy displays a concrete configuration showing:
  • The principals involved
  • Their tier assignments
  • The ACL configuration that enables the attack
  • The specific permissions being exploited
Counterexamples are visualized as graphs, making it easy to understand the attack path. Each node represents an AD object, and edges show relationships and permissions.

Extending the Model

Adding New Attack Patterns

To model a new attack technique:
  1. Define any new permission types or properties
  2. Create a predicate describing the attack conditions
  3. Add the predicate to canCompromise
  4. Create an assertion verifying tier isolation against the attack

Analyzing Your Environment

Export your AD configuration to Alloy format:
  1. Extract ACLs using PowerShell or tools like BloodHound
  2. Transform to Alloy facts defining your specific principals and permissions
  3. Run assertions to identify actual attack paths