T1070.010

Relocate Malware

Once a payload is delivered, adversaries may reproduce copies of the same malware on the victim system to remove evidence of their presence and/or avoid defenses. Copying malware payloads to new locations may be combined with file deletion to clean up older artifacts. Adversaries may rename payloads to blend into the local environment, target file/path exclusions (such as AV exclusion directories), or position payloads in persistence-related directories. Moving payloads does not alter the Creation timestamp, evading detection logic reliant on file creation time modifications.

Microsoft Sentinel / Defender
kusto
let SuspiciousTargetPaths = dynamic([
  "\\AppData\\Roaming\\",
  "\\AppData\\Local\\Temp\\",
  "\\ProgramData\\",
  "\\Windows\\Temp\\",
  "\\Users\\Public\\",
  "\\Windows\\System32\\",
  "\\Windows\\SysWOW64\\",
  "\\Recycle",
  "\\$Recycle.Bin"
]);
let SuspiciousExtensions = dynamic([
  ".exe", ".dll", ".bat", ".ps1", ".vbs", ".js", ".hta", ".cmd", ".scr", ".cpl", ".pif"
]);
let CopyTools = dynamic([
  "cmd.exe", "powershell.exe", "pwsh.exe", "xcopy.exe", "robocopy.exe", "copy", "cp"
]);
// Detect file copy/move via process command lines
let ProcessCopyEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "xcopy.exe", "robocopy.exe")
| where ProcessCommandLine has_any ("copy ", "xcopy ", "robocopy ", "Copy-Item", "Move-Item", "cp ", "mv ", "move ")
| where ProcessCommandLine has_any (SuspiciousExtensions)
| extend TargetsSuspiciousPath = ProcessCommandLine has_any (SuspiciousTargetPaths)
| extend IsRename = ProcessCommandLine has_any ("ren ", "rename ", "Rename-Item", "mv ")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          TargetsSuspiciousPath, IsRename, FolderPath, ProcessId
| extend EventSource = "ProcessCopy";
// Detect file creation events in suspicious directories for executable types
let FileCopyEvents = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileRenamed")
| where FolderPath has_any (SuspiciousTargetPaths)
| where FileName has_any (SuspiciousExtensions)
| where InitiatingProcessFileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "xcopy.exe", "robocopy.exe", "explorer.exe", "wscript.exe", "cscript.exe", "mshta.exe")
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName,
          FileName, FolderPath, ActionType,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          InitiatingProcessId, SHA256
| extend EventSource = "FileCopy", TargetsSuspiciousPath = true, IsRename = (ActionType == "FileRenamed");
ProcessCopyEvents
| union FileCopyEvents
| sort by Timestamp desc
medium severity medium confidence

Data Sources

Process: Process Creation File: File Creation File: File Modification Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceFileEvents

False Positives

  • Software installers and update mechanisms that copy executables to Program Files or Windows directories
  • IT administrators using robocopy or xcopy for legitimate software deployment and patch management
  • Antivirus or EDR quarantine operations that move suspicious files to quarantine directories
  • Legitimate application self-update routines that copy new versions to AppData or Temp before replacing the original
  • Backup software copying executable files as part of scheduled backup operations

Unlock Pro Content

Get the full detection package for T1070.010 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections