adding the module wds_mdt#1194
Open
archidote wants to merge 1 commit intoPennyw0rth:mainfrom
Open
Conversation
Member
|
Very interesting, thanks for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The wds_mdt module detects Windows Deployment Services (WDS) SMB shares (
REMINST\) and Microsoft Deployment Toolkit (MDT) shares (DeploymentShare$\). It extracts credentials stored in cleartext within deployment configuration files and retrieves WinPE images, which can be further analyzed to uncover additional sensitive data. By default,REMINST\shares are accessible to any authenticated domain user, whileDeploymentShare$\is not readable unless misconfigured. This represents a frequently overlooked attack surface that can directly expose highly privileged administrative credentials.For more information on this attack, see my article on the subject.
AI Usage Disclosure:
AI tool used during development: Claude (Sonnet 4.6)
AI-assisted scope:
Human verification performed:
How it works ?
The module detects credentials using the following patterns:
Bootstrap.iniandCustomSettings.ini".ini file style": key=value extraction (DomainAdmin,DomainAdminPassword,UserID,UserPassword,JoinDomain, etc.)Unattend.xml: structured XML extraction covering<AutoLogon>,<Credentials>(domain join) and<AdministratorPassword>*.wim: identify the WinPE boot image(s).credential extraction from common files mentionned above :
No files are downloaded during this sequence. The module performs an on-the-fly scan of accessible shares and parses targeted configuration files in place, extracting credentials using predefined regular expressions.
Scan and Download all found files (configs + WinPE .wim image) in a specific location:
Here, the module not only scans accessible shares and extracts credentials, but also downloads all relevant files (
DOWNLOAD=TRUE), including configuration files and WinPE images, to a specified output directory (OUTDIR=/tmp/wds_mdt_loot). This enables offline analysis, deeper inspection, and additional credential extraction from disk images (e.g., .wim file).Setup guide for the review
Testing environment:
Attacker env:
Target: Windows Server with the following role: WDS (Windows Deployment Services) and third party software Microsoft official MDT (Microsoft Deployment Toolkit)
See theses tutorial for more: https://www.it-connect.fr/cours-tutoriels/administration-systemes/windows-server/deploiement-mdt-wds/
Type of change
Checklist:
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)