Has deleted directories containing malware and archives with files collected from the victim environment.1234
- Tactic
- Stealth
- Platforms
- ESXi, Linux, macOS, Windows
- Version
- 2.0
- Created
- 31 January 2020
- Last modified
- 12 May 2026
- Contributor
- Walker Johnson
Adversaries may delete files left behind by the actions of their intrusion activity. Malware, tools, or other non-native files dropped or created on a system by an adversary (ex: Ingress Tool Transfer) may leave traces to indicate to what was done within a network and how. Removal of these files can occur during an intrusion, or as part of a post-intrusion process to minimize the adversary's footprint.
File Deletion MITRE reference T1070.004
47 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has configured malware to remove archives used in collection activities following successful exfiltration.1
Has deleted previously installed tools.1
Has used the the esxcli command line to remove files created by malicious vSphere Installation Bundles from disk.12
Has used tools including Wevtutil to remove malicious files from compromised hosts.1
All 47 groups for this technique · 6 newest in this preview
13 campaigns have been recorded using this technique. Listed newest first; dates are year-granularity and attribution is MITRE’s.
During RedPenguin, UNC3886 used malware capaple of removing scripts after execution.1
During Operation Digital Eye, threat actors deleted files delivered to compromised hosts, often named with the pattern do.* such as do.exe.1
During Cutting Edge, threat actors deleted /tmp/test1.txt on compromised Ivanti Connect Secure VPNs which was used to hold stolen configuration and cache files.12
Included multiple instances of file deletion or removal during execution and other adversary actions.12
Deleted various artifacts from victim systems following use.1
Removes on-disk copies of tools and other artifacts after it the primary botnet payload has been loaded into memory on the victim device.1
All 13 campaigns for this technique · 6 newest in this preview
251 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
Has deleted all artifacts to include gathered credential archives to reduce disk persistence and detection.1
Has deleted itself after execution.1
Has the ability to remove all staged files after exfiltration.1
Can delete a file containing configuration instructions after use.1
Has deleted generated files and folders from victim devices.1
Can delete files after download.1
All 251 software entries for this technique · 6 newest in this preview
Offense vs defense T1070.004
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
File Deletion detection strategy DET0140
MITRE names one behaviour worth catching for this technique and breaks it into 4 analytics, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Behavioral Detection of Malicious File Deletion
AN0392 · Windows
Detects adversary behavior deleting artifacts (e.g., dropped payloads, evidence files) using native or external utilities (e.g., del, erase, SDelete). Detects deletion events correlated with unusual process lineage or timing post-execution.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| File DeletionDC0040 | WinEventLog:Sysmon | EventCode=23 |
| File AccessDC0055 | WinEventLog:Security | EventCode=4663, 4670, 4656 |
| Command ExecutionDC0064 | WinEventLog:PowerShell | EventCode=4103, 4104, 4105, 4106 |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| TimeWindow | Defines correlation window after suspicious binary execution or login session. |
| FilePathPattern | Focuses on deletion of temp files, malware staging dirs, or known indicators. |
| UserContext | Privilege level or impersonated user deleting sensitive files. |
AN0393 · Linux
Detects deletion of suspicious files (e.g., payloads, temp exes, scripts) via rm, unlink, or secure deletion tools like shred, especially when performed by unexpected users or shortly after execution.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | auditd:SYSCALL | execve |
| File DeletionDC0040 | auditd:SYSCALL | PATH |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| PathRegex | Pattern matching known attacker staging directories or hidden file paths. |
| TimeWindow | Deletion shortly after process execution or privilege escalation. |
| SecureDeletionTool | Uncommon presence or use of shred, wipe, or srm. |
AN0394 · macOS
Detects removal of adversary artifacts via rm, unlink, or secure tools, with focus on shell sessions, temp files, and modified LaunchAgents or system directories.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | macos:unifiedlog | process |
| File ModificationDC0061 | fs:fsusage | unlink, write |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| FilePathRegex | Focus on LaunchAgents, /tmp/, or user folders. |
| ToolUsageAnomaly | Detecting use of unfamiliar tools by common users. |
AN0395 · ESXi
Detects manual or scripted removal of logs, artifacts, or malware droppings via rm or PowerCLI in ESXi shell. Focus on deletions from /tmp/, /var/core/, or /scratch.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| File DeletionDC0040 | esxi:shell | /var/log/shell.log |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| LogFilePath | Match deletion actions in system-critical locations or malware drop zones. |
| TimeWindow | Typically follows suspicious admin login or unexpected shell session. |
| # | Test | Platform | Executor | Elevation | Prereqs | Cleanup | Ref | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01 | Delete a single file - FreeBSD/Linux/macOS | linux, macos | sh | — | 1 | Yes | ||||||||||||||
Delete a single file from the temporary directory Input arguments
Attack command rm -f #{file_to_delete}
Cleanup command rm -rf #{parent_folder}
Prerequisite The file must exist in order to be deleted Check test -e #{file_to_delete} && exit 0 || exit 1
Satisfy mkdir -p #{parent_folder} && touch #{file_to_delete}
GUIDbb1ceb48-f917-49ef-bdac-2ab68b1d89c7 | ||||||||||||||||||||
| 02 | Delete an entire folder - FreeBSD/Linux/macOS | linux, macos | sh | — | 1 | — | ||||||||||||||
Recursively delete the temporary directory and all files contained within it Input arguments
Attack command rm -rf #{folder_to_delete}
Prerequisite The folder must exist in order to be deleted Check test -e #{folder_to_delete} && exit 0 || exit 1
Satisfy mkdir -p #{folder_to_delete}
GUIDd91bf4bc-053b-4509-901b-52075becc115 | ||||||||||||||||||||
| 03 | Overwrite and delete a file with shred | linux | sh | — | 1 | — | ||||||||||||||
Use the Input arguments
Attack command shred -u #{file_to_shred}
Prerequisite Check if file already exists Check if [ -f "#{file_to_shred}" ]; then echo "File already exists"; else echo "File does NOT exist yet"; exit 1; fi
Satisfy touch #{file_to_shred}
GUID528c60c4-51c6-4c53-a1b5-ab1930863868 | ||||||||||||||||||||
| 04 | Delete a single file - Windows cmd | windows | cmd | — | 1 | — | ||||||||||||||
Delete a single file from the temporary directory using cmd.exe. Upon execution, no output will be displayed. Use File Explorer to verify the file was deleted. Input arguments
Attack command del /f #{file_to_delete}
Prerequisite The file to delete must exist on disk at specified location (#{file_to_delete}) Check IF EXIST "#{file_to_delete}" ( EXIT 0 ) ELSE ( EXIT 1 )
Satisfy echo deleteme_T1551.004 >> #{file_to_delete}
GUID1c923050-7474-43dd-a927-50ad8163a26e | ||||||||||||||||||||
| 05 | Delete an entire folder - Windows cmd | windows | cmd | — | 1 | — | ||||||||||||||
Recursively delete a folder in the temporary directory using cmd.exe. Upon execution, no output will be displayed. Use File Explorer to verify the folder was deleted. Input arguments
Attack command rmdir /s /q #{folder_to_delete}
Prerequisite The file to delete must exist on disk at specified location (#{folder_to_delete}) Check IF EXIST "#{folder_to_delete}" ( EXIT 0 ) ELSE ( EXIT 1 )
Satisfy mkdir #{folder_to_delete}
GUIDfd78a7cc-05a1-4f9b-b1a3-fe0b1484286b | ||||||||||||||||||||
| 06 | Delete a single file - Windows PowerShell | windows | PowerShell | — | 1 | — | ||||||||||||||
Delete a single file from the temporary directory using Powershell. Upon execution, no output will be displayed. Use File Explorer to verify the file was deleted. Input arguments
Attack command Remove-Item -path #{file_to_delete}
Prerequisite The file to delete must exist on disk at specified location (#{file_to_delete}) Check if (Test-Path #{file_to_delete}) {exit 0} else {exit 1}
Satisfy New-Item -Path #{file_to_delete} | Out-Null
GUID7f39e933-a37f-4e9b-b3e2-002a5c778886 | ||||||||||||||||||||
| 07 | Delete an entire folder - Windows PowerShell | windows | PowerShell | — | 1 | — | ||||||||||||||
Recursively delete a folder in the temporary directory using Powershell. Upon execution, no output will be displayed. Use File Explorer to verify the folder was deleted. Input arguments
Attack command Remove-Item -Path #{folder_to_delete} -Recurse
Prerequisite The folder to delete must exist on disk at specified location (#{folder_to_delete}) Check if (Test-Path #{folder_to_delete}) {exit 0} else {exit 1}
Satisfy New-Item -Path #{folder_to_delete} -Type Directory | Out-Null
GUIDb0724100-fd40-4f27-9f2a-1901e3eb0bc0 | ||||||||||||||||||||
| 08 | Delete Filesystem - Linux | linux | sh | — | — | — | ||||||||||||||
This test deletes the entire root filesystem of a Linux system. This technique was used by Amnesia IoT malware to avoid analysis. This test is dangerous and destructive, do NOT use on production equipment. Attack command [ "$(uname)" = 'Linux' ] && rm -rf / --no-preserve-root > /dev/null 2> /dev/null || chflags -R 0 / && rm -rf / > /dev/null 2> /dev/null GUID7da627a3-66f6-41e6-a928-1d32516195af | ||||||||||||||||||||
| 09 | Delete Prefetch File | windows | PowerShell | Required | — | — | ||||||||||||||
Delete a single prefetch file. Deletion of prefetch files is a known anti-forensic technique. To verify execution, Run Attack command Remove-Item -Path (Join-Path "$Env:SystemRoot\prefetch\" (Get-ChildItem -Path "$Env:SystemRoot\prefetch\*.pf" -Name)[0]) GUID4d9528dd-c557-4cfa-b26e-583a9bac9a3a | ||||||||||||||||||||
| 10 | Delete TeamViewer Log Files | windows | PowerShell | — | — | — | ||||||||||||||
Adversaries may delete TeamViewer log files to hide activity. This should provide a high true-positive alert ration. This test just places the files in a non-TeamViewer folder, a detection would just check for a deletion event matching the TeamViewer log file format of TeamViewer_##.log. Upon execution, no output will be displayed. Use File Explorer to verify the folder was deleted. https://twitter.com/SBousseaden/status/1197524463304290305?s=20 Input arguments
Attack command New-Item -Path #{teamviewer_log_file} -Force | Out-Null
Remove-Item #{teamviewer_log_file} -Force -ErrorAction Ignore
GUID7fa6af28-2217-4b4e-9d61-f78eb781e8e5 | ||||||||||||||||||||
| 11 | Clears Recycle bin via rd | windows | cmd | Required | — | — | ||||||||||||||
An adversary clears the recycle bin in the system partition using rd to remove traces of deleted files. Reference Attack command rd /s /q %systemdrive%\$RECYCLE.BIN GUID13e25c46-b4df-4222-a9b1-a3cdb91c036f | ||||||||||||||||||||
Tests from Atomic Red Team (MIT licence) · technique definition