Application Techniques of Troubleshooting Platform in Penetration Testing

Onedaysec
4 min read
0 views
docx image 1770015146387 0 dfa125ab31

0x00 Preface

---

Recently, Matthew Mesa and Axel F from Proofpoint discovered a novel phishing method where attackers use troubleshooting packs as email attachments to deceive users into executing them, thereby covertly running payloads. Their article details the methods and concealment techniques employed by attackers, urging users to remain vigilant.

Article link:

https://www.proofpoint.com/us/threat-insight/post/windows-troubleshooting-platform-leveraged-deliver-malware

This article will approach from a technical research perspective, explaining how to develop a troubleshooting pack containing a payload, and analyzing defense methods in conjunction with attack strategies, aiming to enhance everyone's understanding of this technology.

0x01 Introduction

---

Windows Troubleshooting Platform:

English translation: Windows Troubleshooting Platform, abbreviated as WTP

Developers can write troubleshooting packs based on this platform to help users resolve PC issues they encounter

WTP structure is shown in the figure

0x01 Introduction — technical illustration 1

Image referenced from https://msdn.microsoft.com/en-us/library/windows/desktop/dd323706(v=vs.85).aspx

The brief process is as follows:

  • Check the digital signature of the troubleshooting package; if unavailable, exit directly.
  • Execute detection scripts, resolution scripts, and verification scripts sequentially to attempt to resolve the issue.
  • Generate a result report and a debugging report.

Troubleshooting package:

Consists of five components:

  • Troubleshooting manifest
  • Detection scripts
  • Resolution scripts
  • Verification scripts
  • Localized resources

Details are shown in the figure.

0x01 Introduction — technical illustration 2

Cited from https://msdn.microsoft.com/en-us/library/windows/desktop/dd323706(v=vs.85).aspx

0x02 Developing Troubleshooting Packages

---

Official Development Tool:

TSPDesigner

Note:

This tool is included in the Windows 7 SDK

Actual testing shows only v7.0 and v7.1 include this tool

Windows 7 SDK version 7.0 requires .NET Framework 3.5 SP1, download link below:

https://www.microsoft.com/en-us/download/details.aspx?id=3138

Windows 7 SDK version 7.1 requires .NET Framework 4, download link below:

https://www.microsoft.com/en-us/download/details.aspx?id=8279

TSPDesigner is located in the default directory C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\TSPDesigner, containing the following:

As shown in the figure

0x02 Developing Troubleshooting Packages — technical illustration 3

Detailed development reference:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd323712(v=vs.85).aspx

The following example demonstrates how to generate a troubleshooting pack using TSPDesigner.

1. Set properties, which is the first page of the troubleshooting pack.

Project Name: testwtp

Project Description: troubleshooting pack test

Privacy URL: https://3gstudent.github.io/

As shown in the figure

1. Set properties, which is the first page of the troubleshooting pack. — technical illustration 4

2. Add a root cause. Click Add New Root Cause and set the fault information.

Root Cause ID: ServiceIsStopped

Root Cause Name: The service is stopped.

Root Cause Description: The service is stopped. You need to enable it.

As shown in the figure

2. Add a root cause. Click Add New Root Cause and set the fault information. — technical illustration 5

3. Set the Troubleshooter.

As shown in the figure, specify that elevated permissions are required and disable interaction.

3. Set the Troubleshooter. — technical illustration 6

4. Set Resolver

Resolver Name: StartTheService

Resolver Description: Start the service.

Prompt the User: No

Elevation: Yes

Interactions: No

As shown in the figure

4. Set Resolver — technical illustration 7

Specify that elevation is required, disable user warnings, disable interactions

5. Set Verifier

Select No, no need to confirm the issue is resolved

6. Set Scripts

As shown in the figure

6. Set Scripts — technical illustration 8

Note:

Since elevated privileges were specified in steps 3 and 4, the Troubleshooter Script and Resolver Script here already have administrator permissions

Payload can be added here

7. Set digital signature

Select Project-Options, find Code Signing

As shown in the figure

7. Set digital signature — technical illustration 9

You can choose to use Test Certificate or specify a certificate

By default, select Use Generated Test Certificate for testing

8. Generate

Select Build-Build Pack

The following files are generated:

As shown in the figure

8. Generate — technical illustration 10

1.

TS_ServiceIsStopped.ps1 corresponds to Troubleshooter Script

RS_ServiceIsStopped.ps1 corresponds to Resolver Script

Note:

Examining these two ps scripts reveals the payloads they contain

2.

testwtp.diagpkg is the manifest file, containing parameters for the troubleshooting pack, in XML format. For specific syntax, refer to:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd323781(v=vs.85).aspx

3.

DiagPackage.cat stores the digital signature of this troubleshooting pack

Note:

The digital signature in the DiagPackage.cat file can be viewed by double-clicking

As shown in the figure

8. Generate — technical illustration 11

4.

testwtp.diagcab under the cab directory is the packaged troubleshooting pack, containing information from the above files

As shown, during runtime the payload executes and launches a cmd.exe with administrator privileges

8. Generate — technical illustration 12

0x03 Testing Run Troubleshooting Package

---

Place the generated .diagcab file on another test system

Error reported, as shown

0x03 Testing Run Troubleshooting Package — technical illustration 13

This occurs because the default Test Certificate used is not recognized on the new system. Locate the certificate file TestWindowsTroubleShooting.cer in the same directory as TSPDesigner and install it into the Trusted Root Certification Authorities, as shown

0x03 Testing Run Troubleshooting Package — technical illustration 14

Digital signature successfully recognized, as shown below

Note:

The publisher name displayed here corresponds to the issuer used by the signing certificate, which is TestCertforWindowsTroubleShooting

0x03 Testing Run Troubleshooting Package — technical illustration 15

Of course, if a certificate that is trusted by default is used, then this troubleshooting package is trusted by default and can be run directly

Click the privacy statement to open the Privacy URL set in Step 1: https://3gstudent.github.io/

As shown in the figure

0x03 Testing Run Troubleshooting Package — technical illustration 16

At this point, the test troubleshooting pack has been successfully implemented

0x04 Summary

---

In penetration testing, using a troubleshooting pack offers the following advantages:

  • More covert, as .diagcab files are uncommon
  • More deceptive, as users often let their guard down with troubleshooting functions
  • Direct administrator privileges can be obtained
  • Embedded phishing pages with customizable privacy policy links

Defense recommendations:

Microsoft recognized this issue early on and added digital signature verification for troubleshooting packs. Therefore, when encountering a troubleshooting pack (e.g., when an operation triggers fault repair), the first step is to verify the publisher's identity.

Note:

In Microsoft-provided troubleshooting packs, the publisher name defaults to Microsoft Corporation

Related Questions & Answers

What defense recommendations does the article offer against troubleshooting pack attacks?

The article emphasizes that Microsoft already requires digital signature verification, so users should always check the publisher name—legitimate Microsoft packs show "Microsoft Corporation." Security teams should educate users to avoid running unexpected .diagcab files, especially from emails, and consider group policies that block execution of unsigned or untrusted troubleshooting packs. Additionally, monitoring for suspicious PowerShell scripts launched by diagcab can help detect such attacks early.

Why is digital signature verification important for troubleshooting packs, and how can it be bypassed?

Windows checks the digital signature of a troubleshooting pack before running it; if the signature is invalid or untrusted, the execution is blocked. However, attackers can bypass this by using a custom certificate and installing it into the target’s Trusted Root Certification Authorities, making their pack appear legitimate. Alternatively, if they obtain a certificate trusted by default (e.g., from a compromised code signing authority), the pack runs without warnings. This highlights the need for users to verify the publisher identity, as discussed in the [original article](/news/application-techniques-of-troubleshooting-platform-in-penetration-testing).

What are the key steps to develop a troubleshooting pack with a payload using TSPDesigner?

Using the official TSPDesigner tool (available in Windows 7 SDK v7.0 or v7.1), you set project properties, define a root cause, configure the troubleshooter and resolver to require elevation and disable interaction, then add your payload scripts (Troubleshooter Script and Resolver Script). After setting a digital signature (e.g., a test certificate), you build the pack, producing a .diagcab file containing the manifest, scripts, and signature. The payload runs with administrator privileges when the user executes the pack. Similar covert execution techniques are used in other attacks, such as [exploiting clipboard in Windows](/news/penetration-techniques-exploitation-of-clipboard-in-windows).

How can the Windows Troubleshooting Platform be abused in penetration testing?

The Windows Troubleshooting Platform (WTP) allows developers to create troubleshooting packs (.diagcab files) that run detection, resolution, and verification scripts with elevated privileges. Attackers and penetration testers can embed malicious payloads into these scripts, tricking users into executing the pack via phishing emails. Because .diagcab files are uncommon and appear legitimate (often signed with a custom certificate), users are likely to let their guard down, giving the attacker direct administrator access. For more details, see the full analysis in [Application Techniques of Troubleshooting Platform in Penetration Testing](/news/application-techniques-of-troubleshooting-platform-in-penetration-testing).

Continue Reading