[WINPEAS] Add privilege escalation check: Inside Ink Dragon Revealing the Relay Ne... #538
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 describes several Windows privilege escalation paths that are generic, reusable, and not tied to CTF‑style custom configs or obscure software:
Web RCE → Local SYSTEM via Potato exploits (e.g., PrintNotifyPotato)
Abuse of idle/high‑privilege RDP sessions + LSASS access (SYSTEM → Domain escalation)
SYSTEM via scheduled tasks and services (post‑exploitation persistence)
General LSASS/hive dumping from SYSTEM for privilege expansion
These techniques are: (a) Windows‑specific, (b) common enough in real environments (IIS/SharePoint servers, RDP admin usage, Potato‑family escalation), and (c) not dependent on rare software or highly custom scripts. They fit winpeas’ goal of identifying misconfigurations and OS‑level weaknesses that enable or strengthen privilege escalation chains.
🤖 Implementation Details
PEASS winpeas agent completed successfully with 137 items. Agent Comment: Summary:
IsHighPrivilegeAccounthelper inInfo/UserInfo/UserInfoHelper.csthat caches group lookups and tags accounts belonging to powerful groups (Administrators, Domain Admins, etc.). This classification is leveraged to spot accounts whose idle RDP sessions, like the Ink Dragon technique, leave valuable tokens inside LSASS.Checks/UserInfo.cs::PrintRdpSessions()to annotate every session with a new “HighPriv” column, surface a HackTricks reference, and emit explicit warnings whenever disconnected high-privilege sessions are found, guiding operators to dump LSASS/tokens just as Ink Dragon did.winPEAS/winPEASexe/README.mdso users know winPEAS now highlights disconnected high-privilege RDP sessions for potential token/credential theft.Tests:
dotnet build winPEAS/winPEASexe/winPEAS.sln -c Release(fails: .NET Framework 4.8 reference assemblies are missing in this runner, so the solution cannot be built here).🏗️ Builder Agent Response
WinPEAS validation agent completed successfully with 122 items. Agent Comment: Summary:
README.md,Checks/UserInfo.cs,Info/UserInfo/UserInfoHelper.cs) from the current branch and verified the new “high-privilege RDP session” feature is syntactically and logically sound. The helper now caches privilege lookups, gracefully handles null inputs, and the RDP check prints enriched, colorized output plus remediation guidance.winPEASexe, tests, binaries, helpers, etc.) to ensure the new helper code integrates with existing namespaces and conventions.grep) around the newHighPrivartifacts to ensure there are no orphan references and that helper methods are only used where expected.Validation details:
git status -sbclean apart from the 3 tracked edits).winPEAS/to reconfirm where checks, helpers, and info modules live, ensuring the new helper sits alongside related user-info helpers.UserInfo.csto verify formatting strings, dictionary usage, and null-guards inside the new RDP loop.UserInfoHelper.csto ensure the cache dictionary, group indicator list, and new helper methods observe WinPEAS patterns (static helpers,Beaprintfor warnings,Checks.Checksstate).usingdirectives are required for the new APIs employed (StringComparer,StringComparisonalready covered byusing System;).grepto confirm only the intended call sites referenceIsHighPrivilegeAccount.xmllintis unavailable in the runner, so I parsedwinPEAS/winPEASexe/winPEAS/winPEAS.csprojvia Python’sxml.etree.ElementTreeto confirm the XML is well-formed.dotnet msbuild winPEAS/winPEASexe/winPEAS/winPEAS.csproj /t:Rebuild /p:Configuration=Release. The build fails because the Linux runner lacks the .NET Framework 4.8 reference assemblies (MSB3644). This is an environment limitation; no code errors were reported before the failure.Outstanding items / recommendations:
MSB3644.Confidence level: High.
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.