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.
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 Data Sources
Required Tables
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
References (10)
- https://attack.mitre.org/techniques/T1070/007/
- https://docs.microsoft.com/troubleshoot/windows-server/remote/remove-entries-from-remote-desktop-connection-computer
- https://www.osdfcon.org/presentations/2020/Brian-Moran_Putting-Together-the-RDPieces.pdf
- https://www.mandiant.com/resources/blog/fortinet-malware-ecosystem
- https://www.secureworks.com/blog/bronze-silhouette-targets-us-government-and-defense-organizations
- https://www.microsoft.com/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/
- https://github.com/ANSSI-FR/bmc-tools
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netsh
- https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1070.007/T1070.007.md
Unlock Pro Content
Get the full detection package for T1070.007 including response playbook, investigation guide, and atomic red team tests.