Analysis of Backdoor Implementation Using TelemetryController

Onedaysec
5 min read
2 views
docx image 1770016716621 0 b305412b9c

0x00 Preface

---

I learned a method for implementing an auto-start backdoor using TelemetryController from ABUSING WINDOWS TELEMETRY FOR PERSISTENCE. It worked fine on Windows 10, but I encountered different results when testing on Windows 7 and Server 2012 R2.

This article will document my learning insights, analyze the exploitation methods, and provide defense recommendations.

References:

https://www.trustedsec.com/blog/abusing-windows-telemetry-for-persistence/

0x01 Introduction

---

This article will cover the following topics:

  • Basic Knowledge
  • Conventional Exploitation Methods
  • Issues Encountered on Windows 7 and Server 2012 R2
  • Solutions
  • Exploitation Methods
  • Defense Recommendations

0x02 Basic Knowledge

---

1.TelemetryController

The corresponding process is CompatTelRunner.exe

CompatTelRunner.exe is known as the Windows Compatibility Telemetry Monitor. It periodically sends usage and performance data to Microsoft to improve user experience and fix potential errors.

Typically used for compatibility checks when upgrading to Windows 10

Launched via the scheduled task Microsoft Compatibility Appraiser

The scheduled task Microsoft Compatibility Appraiser is enabled by default, runs automatically every other day, and also runs when any user logs in

2.Scheduled Task Microsoft Compatibility Appraiser

(1) Viewing the scheduled task via the panel

Start taskschd.msc

Navigate to Task Scheduler (Local) -> Task Scheduler Library -> Microsoft -> Windows -> Application Experience, select Microsoft Compatibility Appraiser

As shown in the figure below

(1) Viewing the scheduled task via the panel — technical illustration 1

Here you can see the detailed information of the scheduled task Microsoft Compatibility Appraiser

(2) View scheduled tasks via command line

The command is as follows:

schtasks /query

If on a Chinese operating system, the following error may occur:

Error: Unable to load column resources

As shown in the figure below

(2) View scheduled tasks via command line — technical illustration 2

Check cmd encoding, execute the command: chcp

Return result:

Active code page: 936

Indicates using 936 Chinese GBK encoding

As shown in the figure below

(2) View scheduled tasks via command line — technical illustration 3

Solution:

Switch to code page 437 (US) with the command: chcp 437

Execute again: schtasks /query

Result is normal

As shown in the figure below

(2) View scheduled tasks via command line — technical illustration 4

Directly filter for Microsoft Compatibility Appraiser:

schtasks /query /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"

Display detailed information:

schtasks /query /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /v

Modify the scheduled task status, changing from disabled to enabled:

schtasks /Change /ENABLE /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"

0x03 Common Exploitation Methods

---

1. Modify the registry

Modify the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController

Create a Key with any name, with the following key-value information:

Command REG_SZ C:\Windows\system32\notepad.exe
Nightly REG_DWORD 1

The above operations can be achieved via command line, with the following commands:

reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\fun" /v Nightly /t REG_DWORD /d 1
reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\fun" /v Command /t REG_SZ /d "C:\Windows\system32\notepad.exe" /f

Note:

A Key named 'fun' is created here

2. Enable the scheduled task Microsoft Compatibility Appraiser

You can choose to wait for the scheduled task to start

Or force it to start with the following command:

schtasks /run /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"

Backdoor triggered, on Windows 10 system, the processes CompatTelRunner.exe and notepad.exe will immediately start with System privileges

Note:

CompatTelRunner.exe is the parent process of notepad.exe. If the process notepad.exe is running, then the process CompatTelRunner.exe remains in a blocked state

0x04 Issues encountered under Win7 and Server2012R2

---

The operation method is the same as above. After starting the backdoor, two processes CompatTelRunner.exe will be launched with System privileges

As shown in the figure below

0x04 Issues encountered under Win7 and Server2012R2 — technical illustration 5

The command line parameters for one of the CompatTelRunner.exe processes are:

C:\Windows\system32\CompatTelRunner.exe -m:appraiser.dll -f:DoScheduledTelemetryRun -cv:4iNQvAXT40KhDrm9.1

This process corresponds to the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser

The following conclusions were drawn from actual testing:

  1. After a period of time, if the check is still not completed, the CompatTelRunner.exe process will continue running, and it will not be possible to launch the notepad.exe process with System privileges
  2. After a period of time, if the check is completed, the CompatTelRunner.exe process will automatically exit, and then the CompatTelRunner.exe and notepad.exe processes will be launched with System privileges
  3. If you choose to forcibly terminate the CompatTelRunner.exe process, similarly, the CompatTelRunner.exe and notepad.exe processes will then be launched with System privileges

As shown in the figure below

0x04 Issues encountered under Win7 and Server2012R2 — technical illustration 6

Here we can avoid this issue and achieve stable triggering to launch the CompatTelRunner.exe and notepad.exe processes with System privileges. The method is as follows:

Modify the Command entry in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser

The default value is %windir%\system32\CompatTelRunner.exe -m:appraiser.dll -f:DoScheduledTelemetryRun

Here you can choose to skip the check process, for example, by setting the value of the Command entry to empty, which will prevent the check from executing when the scheduled task starts

To improve stealth, the Command entry can be set to %windir%\system32\CompatTelRunner.exe -m:appraiser.dll

To verify whether modifying the key value affects the normal functionality of the system, you can decompile %windir%\system32\CompatTelRunner.exe

The pseudocode details for launching the process are shown in the figure below

0x04 Issues encountered under Win7 and Server2012R2 — technical illustration 7

0x05 Exploitation Method

---

1. Prerequisites

Check whether the default scheduled task Microsoft Compatibility Appraiser is enabled. The query command is as follows:

schtasks /query /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /v

2. Deploying the Backdoor

My test results on Win7, Server2012R2, and Win10 indicate that the stable exploitation method is as follows:

Modify the Command entry in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser

Set the value to C:\WINDOWS\system32\cmd.exe /c notepad.exe

The command implemented via the command line is as follows:

reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser" /v Command /t REG_EXPAND_SZ /d "C:\WINDOWS\system32\cmd.exe /c notepad.exe" /f

Note: Command to restore the configuration

reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser" /v Command /t REG_EXPAND_SZ /d "%windir%\system32\CompatTelRunner.exe -m:appraiser.dll -f:DoScheduledTelemetryRun" /f

3. Backdoor Trigger

Wait for the scheduled task Microsoft Compatibility Appraiser to run

For testing convenience, it can be forced to run with the following command:

schtasks /run /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"

4. Characteristics

Can bypass Autoruns detection and execute commands with System privileges

Can also trigger in a disconnected network state

0x06 Defense Recommendations

---

1. Check if the default value of the registry has been modified

(1) Check the Command entry in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser

The command is as follows:

reg query "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser" /v Command

The default value is as follows:

Command REG_EXPAND_SZ %windir%\system32\CompatTelRunner.exe -m:appraiser.dll -f:DoScheduledTelemetryRun

(2) Check the Keys under the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController

The command is as follows:

reg query "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\"

The default values are as follows:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Appraiser
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\AppraiserServer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\AvStatus
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\Census
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\CensusServer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController\InvAgent

2. Disable the scheduled task Microsoft Compatibility Appraiser

The command is as follows:

schtasks /Change /DISABLE /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"

3. View information about the process CompatTelRunner.exe

Analyze whether there are suspicious child processes under the process CompatTelRunner.exe

0x07 Summary

---

This article documents my learning insights into the TelemetryController backdoor mechanism, summarizes a more general exploitation method, and provides targeted defense recommendations.

Related Questions & Answers

What makes the TelemetryController backdoor stealthy compared to other persistence mechanisms?

This backdoor is particularly stealthy because it abuses a legitimate Microsoft process (`CompatTelRunner.exe`) and a default enabled scheduled task, so it does not raise red flags in most autoruns or startup inspections. Additionally, it works even in a disconnected network state and executes with **System** privileges, allowing full control over the host. Unlike many persistence methods, it does not require adding new scheduled tasks or services—it simply modifies a registry key that is infrequently checked. For analogous techniques that abuse trusted components, see discussions on [Backdoor Implementation Using VMware Tools](/news/penetration-basics-backdoor-implementation-using-vmware-tools) or [Transport Agent as an Exchange Backdoor](/news/penetration-techniques-using-transport-agent-as-an-exchange-backdoor).

How can security defenders detect or prevent the TelemetryController backdoor?

Defenders should regularly check the registry key `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController` for unauthorized `Command` values. The default `Command` under the `Appraiser` subkey should be `%windir%\system32\CompatTelRunner.exe -m:appraiser.dll -f:DoScheduledTelemetryRun`. Any deviation, especially a command pointing to an executable like `cmd.exe` or a script, indicates compromise. Additionally, monitor for unusual child processes of `CompatTelRunner.exe` and consider disabling the **Microsoft Compatibility Appraiser** scheduled task if not needed. This technique bypasses many autoruns scanners, so proactive registry auditing is essential.

What are the exact steps to deploy a TelemetryController backdoor on Windows 10?

First, ensure the scheduled task **Microsoft Compatibility Appraiser** is enabled (it is by default). Next, add a registry key under `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController` with a name like `fun`. Create two values: a `Command` REG_SZ pointing to your payload (e.g., `C:\Windows\system32\notepad.exe`) and a `Nightly` REG_DWORD set to `1`. Finally, trigger the backdoor by running `schtasks /run /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"`. This launches `CompatTelRunner.exe` which spawns your payload with System privileges. For more tailored methods on older Windows versions, see the stable exploit approach discussed in the article.

Why does the TelemetryController backdoor fail on Windows 7 and Server 2012 R2, and how can it be stabilized?

On Windows 7 and Server 2012 R2, the `CompatTelRunner.exe` process may block the execution of the attacker's command while it performs a compatibility check that can take a long time or never finish. To stabilize the exploit, modify the `Command` registry value under `TelemetryController\Appraiser` to bypass the check—for example, set it to `C:\WINDOWS\system32\cmd.exe /c notepad.exe` or empty the original `-f:DoScheduledTelemetryRun` parameter. This forces `CompatTelRunner.exe` to immediately launch the backdoor with System privileges, as described in the original article’s troubleshooting section.

What is the TelemetryController backdoor technique and how does it achieve persistence?

The TelemetryController backdoor technique abuses the Windows Compatibility Telemetry service, which runs the `CompatTelRunner.exe` process via the scheduled task **Microsoft Compatibility Appraiser**. An attacker modifies the registry key `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\TelemetryController` by adding a `Command` value pointing to malicious code (e.g., `notepad.exe`). When the scheduled task triggers, `CompatTelRunner.exe` executes the attacker's command with **System** privileges, achieving persistence without detection by many autoruns tools. This method is analyzed in detail in [Analysis of Backdoor Implementation Using TelemetryController](/news/analysis-of-backdoor-implementation-using-telemetrycontroller).

Continue Reading