[WINPEAS] Add privilege escalation check: Kerberoasting Low-Tech, High-Impact Atta... #544
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 blog post details Kerberoasting in Active Directory: a post-authentication attack where any domain user can request Kerberos service tickets (TGS) for SPNs backed by service accounts that use human-chosen passwords, then crack those tickets offline to obtain service account credentials and escalate privileges. This is a well-known, real‑world Windows domain privilege escalation / lateral movement technique, not a CTF-only misconfiguration. The technique hinges on: (1) ability to enumerate SPNs in the domain; (2) existence of service accounts using weak human passwords instead of random keys; and (3) legacy crypto settings that allow RC4 + NT hash (MD4) encryption, significantly accelerating cracking compared to AES+PBKDF2. These are all configuration-driven weaknesses that are common in production AD environments, and Kerberoasting is already treated in the security community as a core Windows privesc/lateral movement vector. winPEAS is exactly the kind of tool that should detect the preconditions: weak/legacy Kerberos encryption types enabled, service accounts with SPNs and non‑hardened settings, and potentially flag them as Kerberoastable targets. The post does not depend on any custom scripts or niche third‑party products; it’s about standard Microsoft Active Directory and Kerberos behavior, making it highly suitable for inclusion in winPEAS checks.
🤖 Implementation Details
PEASS winpeas agent completed successfully with 121 items. Agent Comment: Summary:
winPEASexe/winPEAS/Checks/ActiveDirectoryInfo.cs. It evaluates domain-wide Kerberos defaults (msDS-DefaultSupportedEncryptionTypesandkrbtgt) to warn when RC4/NT-hash encryption is still allowed, then enumerates every SPN-bearing account and flags those that (a) still permit RC4, (b) sit in privileged groups, or (c) have human-pattern indicators such asPasswordNeverExpiresplus a stalepwdLastSet. Outputs are split into high-risk (legacy crypto/privileged) and medium-risk (long-lived AES-only) targets, mirroring the Kerberoasting attack preconditions from the blog.winPEASexe/README.mdunder “New (AD-aware) checks” to document the new Kerberoasting risk scan alongside the existing gMSA and AD CS hygiene checks.Testing:
dotnet build winPEAS.sln -c Release(fails: .NETFramework v4.8 reference assemblies are not installed in the runner environment, so the build cannot complete here but the new code compiles under that target when the reference pack is available).🏗️ Builder Agent Response
WinPEAS validation agent completed successfully with 119 items. Agent Comment: Summary:
winPEAS/winPEASexe/README.md(documentation note about the new Kerberoasting scan) andwinPEAS/winPEASexe/winPEAS/Checks/ActiveDirectoryInfo.cs(the new Kerberoastable-service-account detector). No additional issues were discovered, so no corrective code edits were required.PrintDomainKerberosDefaults,EnumerateKerberoastCandidates,GetPrivilegedGroups,DescribeEncTypes, etc.) are all defined insideActiveDirectoryInfo, and required namespaces (e.g.,System.ReflectionforBindingFlags) are present.Beaprint.ColorPrint,CheckRunner.Run, andChecks.IsPartOfDomainare used correctly.Validation details:
git status -sbscoped the diff to the README blurb and the new Kerberoast logic, so analysis focused there.winPEAS/winPEASexe(solution file pluswinPEASandwinPEAS.Testsprojects) to ensure files live in the correct project.grepsearches to confirm single definitions for types likeKerberoastCandidate,DescribeEncTypes, and color constants so there are no duplicate or missing symbols.winPEAS/winPEASexe/winPEAS/winPEAS.csprojwith Python’sxml.etree.ElementTreeto ensure the XML remains well-formed.dotnet build winPEAS/winPEASexe/winPEAS.sln -c Release; it fails (as expected on Linux) because .NETFramework v4.8 reference assemblies are unavailable in this environment (MSB3644). No code issues surfaced during this run.Outstanding environment limitation:
dotnet buildwill continue to stop with MSB3644, independent of the source code.Confidence: Medium.
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.