T1070.007

Clear Network Connection History and Configurations

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.

Microsoft Sentinel / Defender
kusto
let RDPRegistryPaths = dynamic([
  "Software\\Microsoft\\Terminal Server Client\\Default",
  "Software\\Microsoft\\Terminal Server Client\\Servers"
]);
let SuspiciousRegDeletionPatterns = dynamic([
  "Terminal Server Client",
  "Terminal Server Client\\Default",
  "Terminal Server Client\\Servers"
]);
let RDPFilePaths = dynamic([
  "Default.rdp",
  "\\Terminal Server Client\\Cache\\"
]);
// Detection 1: Registry deletions targeting RDP connection history
let RegDeletions = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryKeyDeleted", "RegistryValueDeleted")
| where RegistryKey has_any (SuspiciousRegDeletionPatterns)
| extend DetectionType = "RDP Registry History Deletion"
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey, RegistryValueName, InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Detection 2: Deletion of RDP connection files
let RDPFileDeletions = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileDeleted"
| where FileName has_any (RDPFilePaths) or FolderPath has "Terminal Server Client\\Cache"
| extend DetectionType = "RDP File History Deletion"
| project Timestamp, DeviceName, AccountName, ActionType, FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Detection 3: Command-line deletion of network history artifacts
let CmdNetHistoryClean = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (
    "Terminal Server Client",
    "Default.rdp",
    "netsh wlan delete",
    "netsh advfirewall reset",
    "netsh int ip reset",
    "arp -d",
    "route delete",
    "Clear-DnsClientCache",
    "ipconfig /flushdns",
    "dnscmd /clearcache"
  )
  and ProcessCommandLine has_any ("del ", "Remove-Item", "rm ", "erase ", "reg delete", "delete", "clear", "flush", "reset")
| extend DetectionType = "CLI Network History Cleanup"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Union all detections
RegDeletions
| union RDPFileDeletions
| union CmdNetHistoryClean
| sort by Timestamp desc
medium severity medium confidence

Data Sources

Windows Registry: Registry Key Deletion File: File Deletion Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents DeviceFileEvents DeviceProcessEvents

False Positives

  • System administrators clearing RDP connection lists as part of routine IT maintenance or user profile cleanup
  • Enterprise IT tools (SCCM, Group Policy scripts) that reset network configurations during device re-imaging or re-provisioning
  • Security hardening scripts that flush DNS cache and reset network settings as part of scheduled maintenance windows
  • Users manually clearing their own RDP history for privacy or organizational hygiene purposes
  • Antivirus or endpoint management software that clears cached network state during remediation workflows

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