T1080

Taint Shared Content

Adversaries may deliver payloads to remote systems by adding content to shared storage locations, such as network drives or internal code repositories. Content stored on network drives or in other shared locations may be tainted by adding malicious programs, scripts, or exploit code to otherwise valid files. Once a user opens the shared tainted content, the malicious portion can be executed to run the adversary's code on a remote system. Variants include the directory share pivot (planting malicious .LNK files that masquerade as legitimate directories), binary infection (prepending or appending code to legitimate executables on shares), and Office document macro injection (as seen with Gamaredon Group). Threat actors including Conti, Ursnif, Ramsay, InvisiMole, and RedCurl have all leveraged this technique for lateral movement.

Microsoft Sentinel / Defender
kusto
let SuspiciousExtensions = dynamic([".exe", ".dll", ".scr", ".bat", ".cmd", ".vbs", ".js", ".hta", ".ps1", ".lnk"]);
let KnownSafeSources = dynamic(["MsMpEng.exe", "msiexec.exe", "TrustedInstaller.exe", "wuauclt.exe", "svchost.exe"]);
// Signal 1: Executable or script written to a UNC network path
let ExecOnShare = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath startswith @"\\\\"
| extend FileExt = tolower(tostring(split(FileName, ".")[-1]))
| where strcat(".", FileExt) in~ (SuspiciousExtensions)
| where InitiatingProcessFileName !in~ (KnownSafeSources)
| extend Signal = "ExecOnNetworkShare";
// Signal 2: LNK file creation on a mapped or UNC share path (directory share pivot)
let LnkOnShare = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FileName endswith ".lnk" or FileName endswith ".LNK"
| where FolderPath startswith @"\\\\" or FolderPath matches regex @"[A-Z]:\\.*\\(share|shares|public|users|common|docs|dept|data)"
| where InitiatingProcessFileName !in~ (KnownSafeSources)
| extend Signal = "LnkOnNetworkShare";
// Signal 3: Office document with macro-enabled extension written to a network share (Gamaredon pattern)
let OfficeOnShare = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FileName endswith ".docm" or FileName endswith ".xlsm" or FileName endswith ".pptm"
    or FileName endswith ".doc" or FileName endswith ".xls"
| where FolderPath startswith @"\\\\"
| where InitiatingProcessFileName !in~ (KnownSafeSources)
| extend Signal = "MacroOfficeOnShare";
// Combine signals
union ExecOnShare, LnkOnShare, OfficeOnShare
| extend FileExt = tolower(tostring(split(FileName, ".")[-1]))
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, FileExt, Signal,
    InitiatingProcessFileName, InitiatingProcessCommandLine,
    InitiatingProcessAccountName, InitiatingProcessId
| sort by Timestamp desc
high severity medium confidence

Data Sources

File: File Creation File: File Modification Microsoft Defender for Endpoint Network Share: Network Share Access

Required Tables

DeviceFileEvents

False Positives

  • Software deployment via SCCM or PDQ Deploy copying installation packages (.exe, .msi) to deployment shares
  • Backup agents or robocopy jobs replicating executables to archive network shares
  • IT administrators legitimately copying scripts (.ps1, .bat) to shared script repositories or SYSVOL for GPO deployment
  • Antivirus or EDR updates propagating via network share to air-gapped or slow-update endpoints
  • DFS replication (DFSR) synchronizing executables and documents across site shares
  • Development teams pushing compiled binaries to network-accessible build output directories

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections