Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

DSInternals

> 测试质量
Open source

Directory Services Internals (DSInternals) PowerShell Module and Framework

2.0K stars0 likes1 views
WebsiteGitHub

About

Directory Services Internals (DSInternals) PowerShell Module and Framework

Directory Services Internals
PowerShell Module and Framework

Introduction

The DSInternals project consists of these two parts:

  • The DSInternals Framework exposes several internal features of Active Directory and can be used from any .NET application. The codebase has already been integrated into several 3rd party commercial products that use it in scenarios like Active Directory disaster recovery, identity management, cross-forest migrations and password strength auditing.
  • The DSInternals PowerShell Module provides easy-to-use cmdlets that are built on top of the Framework. These are the main features:
    • Active Directory password auditing that discovers accounts sharing the same passwords or having passwords in a public database like HaveIBeenPwned or in a custom dictionary.
    • DPAPI-NG (CNG DPAPI) data protection and decryption, management of named protection descriptors, decryption of SID-protected PFX certificates, and offline unlock of BitLocker SID-based key protectors by deriving DPAPI-NG group keys from KDS root keys.
    • Key credential auditing and generation, including support for NGC, FIDO2 and STK keys. Keys can also be tested against the ROCA vulnerability. New NGC keys can also be registered through the MS-DRSR protocol.
    • Bare-metal recovery of domain controllers from just IFM backups (ntds.dit + SYSVOL).
    • Offline ntds.dit file manipulation, including hash dumping, password resets, group membership changes, trust password extraction, Golden gMSA and dMSA attacks, enabling/disabling accounts, LAPS password decryption, and BitLocker recovery key extraction.
    • Active Directory–integrated DNS zone and resource record reading from both ntds.dit and the live directory over LDAP, export to standard zone files, and extraction of DNSSEC Key Signing Keys (KSK) and Zone Signing Keys (ZSK), with private keys decrypted using KDS root keys.
    • Online password hash dumping through the Directory Replication Service (DRS) Remote Protocol (MS-DRSR). This feature is commonly called DCSync.
    • Domain or local account password hash injection through the Security Account Manager (SAM) Remote Protocol (MS-SAMR) or directly into the database.
    • LSA Policy modification through the Local Security Authority (Domain Policy) Remote Protocol (MS-LSAD / LSARPC).
    • Extracting credential roaming data and DPAPI domain backup keys, either online through directory replication, LSARPC, and offline from ntds.dit.
    • Password hash calculation, including NT hash, LM hash, and kerberos keys.

[!WARNING] Features exposed through these tools are not supported by Microsoft. Improper use might cause irreversible damage to domain controllers or negatively impact domain security.

Author

Michael Grafnetter

I have created these tools in my spare time and I am using them while performing AD security audits and also in my lectures to demonstrate how Active Directory works internally.

I would like to thank all people who have contributed to the project by sending their feedback or by submitting their code. In case you would also like to help with this project, please see the CONTRIBUTING document.

Downloads

PowerShell Gallery

You can install the DSInternals module directly from the official PowerShell Gallery by running the following command:

powershell
Install-Module DSInternals -Force

Additional steps might be required on some freshly installed computers before DSInternals can be downloaded:

…

Chocolatey Package

The DSInternals PowerShell Module can also be installed using the official Chocolatey package by executing the following Chocolatey command:

powershell
choco install dsinternals-psmodule --confirm

This package is self-contained and it will also install all dependencies. Note that package versions prior to 3.5 were not official.

WAPT Package

The DSInternals PowerShell Module can also be installed using the WAPT package.

The package can be installed by the WAPT console or by the WAPT Command-line interface like so:

powershell
wapt-get install dsinternals

This package is self-contained and it will also install all dependencies.

Offline Module Distribution

  1. Download the current release from GitHub.
  2. Unblock the ZIP file, using either the Properties dialog or the Unblock-File cmdlet. If you fail to do so, all the extracted DLLs will inherit this attribute and PowerShell will refuse to load them.
  3. Extract the DSInternals directory to your PowerShell modules directory, e.g. C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DSInternals or C:\Users\John\Documents\WindowsPowerShell\Modules\DSInternals.
  4. (Optional) If you copied the module to a different directory than advised in the previous step, you have to manually import it using the Import-Module cmdlet.

Commando VM

The DSInternals PowerShell module is part of FireEye's Commando VM, the Windows-based alternative to Kali Linux.

NuGet Packages

The easiest way of integrating the DSInternals functionality into .NET applications is by using the DSInternals Framework NuGet packages:

  • DSInternals.Common
  • DSInternals.DataStore
  • DSInternals.Replication
  • DSInternals.SAM

Building from Source Code

You can of course download the source code, perform a review, and compile the Module/Framework yourself. See the CONTRIBUTING guide for more info.

Documentation

Get-Help

The online version of PowerShell Get-Help documentation contains the list of all cmdlets and some usage examples.

Blog Posts

I have also published a series of articles about the DSInternals module on my blog. Here are a few of them:

  • Juicing ntds.dit Files to the Last Drop
  • New Offline Capabilities in DSInternals 4.11
  • Cross-Forest Duplicate Password Discovery
  • CQLabs – Extracting Roamed Private Keys from Active Directory
  • CQLabs – Offline Attacks on Active Directory
  • Auditing Active Directory Password Quality
  • Dumping ntds.dit files
  • Retrieving Active Directory Passwords Remotely
  • Retrieving DPAPI Backup Keys from Active Directory
  • Retrieving Cleartext GMSA Passwords from Active Directory
  • Peeking into the Active Directory Database
  • Dumping and modifying Active Directory database using a bootable flash drive
  • Impersonating Office 365 Users With Mimikatz

Slide Decks

  • Black Hat Europe 2019: DSInternals PowerShell Module
  • Black Hat Europe 2019: Exploiting Windows Hello for Business
  • HipConf New York 2018: Offline Attacks on Active Directory

Acknowledgements

This project utilizes the following 3rd party copyrighted material:

  • ManagedEsent - Provides managed access to esent.dll, the embeddable database engine native to Windows.
  • PBKDF2.NET - Provides PBKDF2 for .NET Framework.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#active-directorybitlockerdnsdpapi

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.