Detect Clear Network Connection History and Configurations in Sumo Logic CSE
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/
Sumo Detection Query
(_sourceCategory=*windows* OR _sourceCategory=*sysmon* OR _sourceCategory=*winlogbeat*)
| parse "EventCode=*" as EventCode nodrop
| parse "event_id=*" as event_id nodrop
| eval EventCode = if (!isNull(EventCode), EventCode, event_id)
| parse "TargetObject=*" as TargetObject nodrop
| parse "TargetFilename=*" as TargetFilename nodrop
| parse "CommandLine=*" as CommandLine nodrop
| parse "User=*" as Actor nodrop
| parse "Image=*" as ProcessImage nodrop
| parse "ComputerName=*" as ComputerName nodrop
| parse "Computer=*" as Computer nodrop
| eval Host = if (!isNull(ComputerName), ComputerName, Computer)
| where (
// Sysmon EventCode 12: RDP registry key/value deletion
(EventCode = "12" and (
TargetObject matches /(?i)Terminal Server Client\\(Default|Servers)/
))
or
// Sysmon EventCode 23: RDP file artifact deletion
(EventCode = "23" and (
TargetFilename matches /(?i)Default\.rdp/
or TargetFilename matches /(?i)Terminal Server Client.*Cache/
))
or
// Sysmon EventCode 1: CLI network history cleanup
(EventCode = "1" and (
CommandLine matches /(?i)(del|Remove-Item|erase|reg\s+delete).*Terminal Server Client/
or CommandLine matches /(?i)(del|Remove-Item|erase).*Default\.rdp/
or CommandLine matches /(?i)netsh\s+(wlan\s+delete|advfirewall\s+reset|int\s+ip\s+reset|interface\s+ip\s+reset)/
or CommandLine matches /(?i)(Clear-DnsClientCache|ipconfig\s+\/flushdns|dnscmd\s+\/clearcache)/
or CommandLine matches /(?i)arp\s+-d(\s|$)/
or CommandLine matches /(?i)route\s+delete/
))
)
| eval DetectionCategory = if (EventCode = "12", "RDP Registry History Deletion",
if (EventCode = "23", "RDP File History Deletion", "CLI Network History Cleanup"))
| eval ArtifactAffected = if (!isNull(TargetObject) and TargetObject != "", TargetObject,
if (!isNull(TargetFilename) and TargetFilename != "", TargetFilename, CommandLine))
| table _messageTime, Host, Actor, ProcessImage, CommandLine, ArtifactAffected, DetectionCategory, EventCode
| sort by _messageTime desc Sumo Logic detection for T1070.007 using Sysmon telemetry. Parses Sysmon EventCode 12 for registry key deletions targeting Terminal Server Client paths, EventCode 23 for file deletions of Default.rdp and RDP cache artifacts, and EventCode 1 for process execution of commands that erase network history including netsh resets, arp -d, route delete, and DNS cache flushing commands.
Data Sources
Required Tables
False Positives & Tuning
- Automated RDP history cleanup scripts deployed by system administrators as part of workstation security hardening or CIS benchmark compliance enforcement
- VDI platforms (Citrix Virtual Apps, VMware Horizon) that execute logoff scripts clearing RDP artifacts and flushing network state between user sessions
- Security orchestration tools (Splunk SOAR, Palo Alto XSOAR) issuing netsh or DNS flush commands as part of automated incident response playbook execution
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.
- 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.
- 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'.
- 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.
- 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.
- 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.
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.