T1070.007 Elastic Security · Elastic

Detect Clear Network Connection History and Configurations in Elastic Security

Adversaries may clear or remove evidence of malicious network connections in order to clean up traces of their operations. Configuration settings as well as various artifacts that highlight connection history may be created on a system and/or in application logs from behaviors that require network connections, such as Remote Services or External Remote Services. Network connection history may be stored in Windows Registry values under HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default and Servers, in files such as Default.rdp and RDP cache files, or in system logs on macOS and Linux. Adversaries may delete or modify this data to conceal indicators and impede defensive analysis.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1070 Indicator Removal
Sub-technique
T1070.007 Clear Network Connection History and Configurations
Canonical reference
https://attack.mitre.org/techniques/T1070/007/

Elastic Detection Query

Elastic Security (Elastic)
eql
any where
  // Detection 1: RDP Registry History Deletion (Sysmon EventCode 12)
  (event.category == "registry" and event.type : "deletion" and
   registry.path : ("*\\Terminal Server Client\\Default*", "*\\Terminal Server Client\\Servers*"))
  or
  // Detection 2: RDP File History Deletion (Sysmon EventCode 23 / Endpoint file delete)
  (event.category == "file" and event.type : "deletion" and
   (file.name : "Default.rdp" or file.path : "*Terminal Server Client\\Cache*"))
  or
  // Detection 3: CLI Network History Cleanup (Sysmon EventCode 1 / Endpoint process)
  (event.category == "process" and event.type : "start" and
   (
     (process.command_line : ("*Terminal Server Client*", "*Default.rdp*") and
      process.command_line : ("*del *", "*Remove-Item*", "*rm *", "*erase *", "*reg delete*"))
     or process.command_line : (
       "*netsh wlan delete*",
       "*netsh advfirewall reset*",
       "*netsh int ip reset*",
       "*netsh interface ip reset*",
       "*arp -d*",
       "*route delete*",
       "*Clear-DnsClientCache*",
       "*ipconfig /flushdns*",
       "*dnscmd /clearcache*"
     )
   )
  )
high severity high confidence

Detects T1070.007 — Clear Network Connection History and Configurations across three vectors: (1) deletion of RDP connection registry keys under HKCU\Software\Microsoft\Terminal Server Client, (2) removal of Default.rdp files and RDP cache artifacts, and (3) CLI execution of commands that erase network configuration state such as netsh reset, arp flush, route deletion, and DNS cache clearing.

Data Sources

Elastic Endpoint Security (logs-endpoint.events.*)Winlogbeat with Sysmon module (winlogbeat-*)Elastic Agent with Windows integration

Required Tables

logs-endpoint.events.registry-*logs-endpoint.events.file-*logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • IT administrators running netsh commands to reset network adapters or firewall policies during infrastructure troubleshooting or scheduled maintenance windows
  • Group Policy refresh or MDM compliance scripts that programmatically clear RDP connection history across managed workstations as part of a hardening baseline
  • VDI session teardown automation (e.g., Citrix or VMware Horizon logoff scripts) that removes RDP artifacts and flushes DNS cache between user sessions
Download portable Sigma rule (.yml)

Other platforms for T1070.007


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Delete RDP Connection History from Registry

    Expected signal: Sysmon Event ID 12 (RegistryEvent - Object Delete): TargetObject will contain 'Software\Microsoft\Terminal Server Client\Default' and 'Software\Microsoft\Terminal Server Client\Servers'. Sysmon Event ID 1 (Process Create): reg.exe with CommandLine containing 'reg delete' and 'Terminal Server Client'. Security Event ID 4688 (if command line auditing enabled) showing the reg.exe execution.

  2. Test 2Delete Default RDP Connection File

    Expected signal: Sysmon Event ID 11 (File Create): TargetFilename will show the creation of Default.rdp. Sysmon Event ID 23 (File Delete, if enabled): TargetFilename will show the deletion of Default.rdp. Sysmon Event ID 1 (Process Create): cmd.exe with CommandLine containing 'del' and 'Default.rdp'.

  3. Test 3Clear DNS Client Cache to Remove Connection Evidence

    Expected signal: Sysmon Event ID 1 (Process Create): ipconfig.exe with CommandLine 'ipconfig /flushdns'. Security Event ID 4688 (if command line auditing enabled) with same data. Note: this is a common operation so additional context (time of day, parent process, user account) is needed to distinguish malicious use.

  4. Test 4Reset Windows Firewall Configuration via Netsh

    Expected signal: Sysmon Event ID 1 (Process Create): netsh.exe with CommandLine 'netsh advfirewall reset'. Security Event ID 4688 (if command line auditing enabled). Additionally, Security Event ID 4950 (Windows Firewall setting has changed) may be generated in the Windows Firewall with Advanced Security operational log.

  5. Test 5PowerShell Removal of RDP Cache Directory Contents

    Expected signal: Sysmon Event ID 1 (Process Create): powershell.exe with CommandLine containing 'Remove-Item' and 'Terminal Server Client'. Sysmon Event ID 23 (File Delete): TargetFilename showing deletion within the Terminal Server Client\Cache path. PowerShell ScriptBlock Log Event ID 4104 with the full script content.

Unlock Pro Content

Get the full detection package for T1070.007 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections