[WINPEAS] Add privilege escalation check: HTB Sendai From password spray to gMSA d... #497
+1,824
−1,536
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.
🔧 Automated Privilege Escalation Check Addition
🤔 Privilege Escalation Reasoning
The post documents multiple, widely applicable Windows/Active Directory privilege escalation avenues that are not bespoke CTF-only misconfigs: (1) gMSA password retrieval via ReadGMSAPassword ACL chaining (msDS-ManagedPassword -> NTLM) is a common AD misconfiguration and a recognized escalation vector; (2) AD CS ESC4 (Enrollment Agent abuse) is a well-known and prevalent enterprise misconfiguration class; (3) Local token privilege abuse via SeImpersonatePrivilege (Potato variants) is a standard local privesc pattern that winPEAS already surfaces, but the post reinforces its relevance. These can be integrated as detection/enumeration checks in winPEAS (domain-aware mode) without relying on uncommon software or one-off CTF setups.
🤖 Implementation Details
PEASS winpeas agent completed successfully with 103 items. Agent Comment: Here’s what I did to implement the technique(s) from “HTB Sendai” into winPEAS, following the repo layout and coding style.
CN=Certificate Templates,CN=Public Key Services,CN=Services,
for (objectClass=pKICertificateTemplate).
What the new detection finds
Repo paths changed
Summary of the technique added and how we detect it
If you want to find hard-coded creds in running services/command-lines (as also seen in the Sendai writeup), winPEAS already shows services and processes; expanding regex detection there could be a future enhancement, but the two AD-centric checks above are the high-impact, broadly applicable ones from this post and are now covered.
🏗️ Builder Agent Response
WinPEAS validation agent completed successfully with 134 items. Agent Comment: Below is a complete, reproducible validation and remediation of the WinPEAS C# codebase in the PEASS-ng repo at /tmp/hacktricks_update_nqoj_gfz/repo, executed on August 28, 2025.
What I did (high level)
Repo status:
Command used:
Observed key change in Checks.cs:
new SystemCheck("activedirectoryinfo", new ActiveDirectoryInfo()),
Key paths:
Change:
winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs
Console.WriteLine(LCYAN + " activedirectoryinfo" + GRAY + " Quick AD checks (gMSA readable passwords, AD CS template rights)"+ NOCOLOR);
Ensured the new file is included in the project and that required references exist (they do).
Committed changes:
Commits created:
How to build (on a Windows box with MSBuild/Visual Studio):
Confidence level
Artifacts/commands executed (highlights)
If you want, I can also:
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.