Add TextTransform.exe, TextTransformCore.exe, MSTest.exe and Microsoft.XslDebugger.Host.exe to the OtherMSBinaries category#496
Open
Pumi96 wants to merge 10 commits intoLOLBAS-Project:masterfrom
Open
Conversation
Added metadata for TextTransform.exe including name, description, author, and creation date.
Added configuration for TextTransformCore.exe.
Added MSTest.yml to document the legacy test execution tool and its usage.
Removed code sample for MSTest from configuration.
Updated the description to use 'TestMethod attribute' instead of '[TestMethod]'. Added a code sample demonstrating malicious test execution.
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.
Summary
This PR adds
TextTransform.exe,TextTransformCore.exe, andMSTest.exeto theOtherMSBinariescategory.All three are Microsoft-signed command-line utilities included with Visual Studio. Their legitimate purposes involve development workflows: processing T4 text templates (
.ttfiles) for code generation, and executing unit test assemblies.The Execution Primitive
TextTransform / TextTransformCore:
Because T4 templates inherently support executing embedded C# or VB.NET code during the transformation process, an attacker can abuse either utility to proxy the execution of arbitrary C# payloads. (MITRE T1127)
Technical Note: Because
TextTransformCore.exeruns on .NET Core, it requires explicit assembly references (likeSystem.Diagnostics.Process) inside the template to execute certain actions, whereas the standard .NET Framework version has these available by default.MSTest:
MSTest.exeis a legacy test execution runner. By crafting a malicious .NET DLL adorned with standard Unit Testing attributes ([TestClass],[TestMethod]), an attacker can force the runner to load the assembly and execute arbitrary code hidden within the test methods. (MITRE T1218)Both vectors grant access to the underlying runtime (spawning processes, network connections, file system access) and can be used to bypass defensive controls that do not restrict trusted developer utilities.
Microsoft.XslDebugger.Host:
Microsoft.XslDebugger.Host.exe is an XSLT execution utility for Visual Studio. When invoked with /enable:all, it compiles and executes arbitrary C# code embedded in msxsl:script blocks within XSLT stylesheets. This grants full .NET Framework access including Process.Start() and WebClient.DownloadFile(), making it both an Execute and Download primitive. (MITRE T1220)
Proof of Concept 1: TextTransform.exe (.NET Framework)
payload.ttcontaining the following embedded C# code:Proof of Concept 2: TextTransformCore.exe (.NET Core)
Proof of Concept 3: MSTest.exe
Proof of Concept 4: Microsoft.XslDebugger.Host.exe (Execute + Download)