T1216.002

SyncAppvPublishingServer

Adversaries may abuse SyncAppvPublishingServer.vbs to proxy execution of malicious PowerShell commands, bypassing execution restrictions and evading defensive countermeasures. SyncAppvPublishingServer.vbs is a legitimate, Microsoft-signed Visual Basic script associated with Windows Application Virtualization (App-V), located in System32 and commonly executed via wscript.exe. By embedding PowerShell commands in the script's argument using the syntax `SyncAppvPublishingServer.vbs "n; {PowerShell}"`, adversaries can invoke PowerShell logic through a trusted signed host process rather than calling powershell.exe directly. This technique has been observed in DarkHotel APT and BlueNoroff campaigns as a means of evading script-block logging, execution policy restrictions, and process-based detection rules that focus on powershell.exe as the initiating process.

Microsoft Sentinel / Defender
kusto
// Branch 1: wscript.exe directly invoking SyncAppvPublishingServer.vbs with embedded PowerShell content
let SyncAppvPath = dynamic(["syncappvpublishingserver.vbs", "syncappvpublishingserver"]);
let PowerShellIndicators = dynamic([
  "invoke-expression", "iex(", "iex ",
  "invoke-webrequest", "net.webclient", "downloadstring", "downloadfile",
  "-encodedcommand", "-enc ", "-e ",
  "start-process", "new-object", "invoke-command",
  "bypass", "hidden", "mimikatz", "shellcode",
  "invoke-mimikatz", "amsiutils", "reflection",
  "frombase64string", "io.memorystream"
]);
let SyncAppvEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "wscript.exe" or FileName =~ "cscript.exe"
| where ProcessCommandLine has_any (SyncAppvPath)
| where ProcessCommandLine has_any (PowerShellIndicators)
| extend ExecutionVector = "Direct-SyncAppv-PowerShell-Proxy"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          InitiatingProcessAccountName, ProcessId, InitiatingProcessId,
          ExecutionVector;
// Branch 2: PowerShell spawned by wscript.exe/cscript.exe where parent command line references SyncAppvPublishingServer
let PSFromSyncAppv = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where InitiatingProcessFileName in~ ("wscript.exe", "cscript.exe")
| where InitiatingProcessCommandLine has_any (SyncAppvPath)
| extend ExecutionVector = "PowerShell-Child-Of-SyncAppv"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          InitiatingProcessAccountName, ProcessId, InitiatingProcessId,
          ExecutionVector;
// Branch 3: Any process spawning SyncAppvPublishingServer.vbs from unexpected parent (not system/winlogon)
let UnexpectedParent = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("wscript.exe", "cscript.exe")
| where ProcessCommandLine has_any (SyncAppvPath)
| where InitiatingProcessFileName !in~ ("explorer.exe", "svchost.exe", "services.exe", "winlogon.exe", "cmd.exe")
| extend ExecutionVector = "SyncAppv-Unexpected-Parent"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          InitiatingProcessAccountName, ProcessId, InitiatingProcessId,
          ExecutionVector;
union SyncAppvEvents, PSFromSyncAppv, UnexpectedParent
| sort by Timestamp desc
high severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Legitimate App-V administrators running SyncAppvPublishingServer.vbs as part of application publishing workflows — the script may be invoked with parameters that superficially resemble PowerShell patterns
  • MDM solutions (Microsoft Intune, SCCM) invoking SyncAppvPublishingServer.vbs during App-V package deployment and synchronization tasks on managed endpoints
  • System administrators testing App-V virtualization environments where PowerShell is legitimately used alongside the SyncAppvPublishingServer script in the same session
  • Security red team exercises or authorized penetration tests validating detection coverage for LOLBin-based PowerShell execution

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections