Indicator Removal
Adversaries may delete or modify artifacts generated within systems to remove evidence of their presence or hinder defenses. Various artifacts may be created by an adversary or something that can be attributed to an adversary's actions. Typically these artifacts are used as defensive indicators related to monitored events, such as strings from downloaded files, logs that are generated from user actions, and other data analyzed by defenders. Removal of these indicators may interfere with event collection, reporting, or other processes used to detect intrusion activity. This may compromise the integrity of security solutions by causing notable events to go unreported. This activity may also impede forensic analysis and incident response, due to lack of sufficient data to determine what occurred.
let RegistryCleanupPatterns = dynamic([
"reg delete", "reg.exe delete",
"Remove-ItemProperty", "Remove-Item.*HKLM", "Remove-Item.*HKCU",
"RegDeleteKey", "RegDeleteValue"
]);
let FileCleanupPatterns = dynamic([
"ProcessIdleTasks",
"advapi32.dll",
"DeleteLeftovers",
"CleanupArtifacts"
]);
let SelfDeletionPatterns = dynamic([
"cmd /c del", "cmd.exe /c del",
"/c del \"", "ping -n 1",
"del /f /q", "erase /f"
]);
// Registry deletion events
let RegDeletions = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryKeyDeleted", "RegistryValueDeleted")
| where RegistryKey has_any (
"\\Run\\", "\\RunOnce\\", "\\Services\\",
"\\Scheduled Tasks", "\\AppInit_DLLs",
"\\NetworkProvider\\Order",
"\\Internet Explorer\\notes",
"\\CurrentVersion\\Image File Execution",
"\\TESTSIGNING", "\\user32.dll"
)
| extend DetectionSource = "RegistryDeletion"
| project Timestamp, DeviceName, AccountName, ActionType,
RegistryKey, RegistryValueName,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, DetectionSource;
// Process-based cleanup commands
let ProcCleanup = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (RegistryCleanupPatterns)
or ProcessCommandLine has_any (SelfDeletionPatterns)
or (InitiatingProcessFileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe")
and ProcessCommandLine has "del" and ProcessCommandLine has ".exe")
| extend DetectionSource = "ProcessCleanupCommand"
| project Timestamp, DeviceName, AccountName,
FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, DetectionSource;
// Combine results
union RegDeletions, ProcCleanup
| extend SuspicionFlags = pack_array(
iff(DetectionSource == "RegistryDeletion", "registry_key_deleted", ""),
iff(ProcessCommandLine has_any (SelfDeletionPatterns), "self_deletion_pattern", ""),
iff(ProcessCommandLine has_any (RegistryCleanupPatterns), "registry_cleanup_cmd", ""),
iff(ProcessCommandLine has "del" and ProcessCommandLine has ".exe", "executable_deletion", "")
)
| project Timestamp, DeviceName, AccountName,
DetectionSource, RegistryKey, RegistryValueName,
FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
SuspicionFlags
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Software uninstallers that legitimately remove their own registry run keys and service entries during clean uninstallation
- IT management tools (SCCM, Intune, Group Policy) that delete temporary registry values as part of deployment or policy application
- System cleanup utilities (CCleaner, Windows Disk Cleanup) that remove cached artifacts and registry entries as part of routine maintenance
- Developers running build/clean scripts that delete test artifacts, temporary executables, and configuration entries
- Self-updating software that deletes old version run keys before writing new ones during an update cycle
References (12)
- https://attack.mitre.org/techniques/T1070/
- https://www.sentinelone.com/labs/operation-bleeding-bear/
- https://www.proofpoint.com/us/threat-insight/post/ta505-distributes-new-sdbbot-remote-access-trojan-get-installer-tool
- https://sandfly.io/linux-threat-hunting-with-bpfdoor/
- https://securelist.com/shadowpad-in-corporate-networks/81432/
- https://www.crowdstrike.com/blog/how-crowdstrike-falcon-protects-against-wiper-malware-used-in-ukraine-attacks/
- https://www.welivesecurity.com/en/eset-research/a-journey-to-the-darkside-the-hermetic-wiper-malware/
- https://github.com/redcanaryco/atomic-red-team/tree/master/atomics/T1070
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/builtin
- https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-registry
- https://github.com/TheWover/donut
Unlock Pro Content
Get the full detection package for T1070 including response playbook, investigation guide, and atomic red team tests.
Related Detections
Sub-techniques (10)
- T1070.001Clear Windows Event Logs
- T1070.002Clear Linux or Mac System Logs
- T1070.003Clear Command History
- T1070.004File Deletion
- T1070.005Network Share Connection Removal
- T1070.006Timestomp
- T1070.007Clear Network Connection History and Configurations
- T1070.008Clear Mailbox Data
- T1070.009Clear Persistence
- T1070.010Relocate Malware