Detect SyncAppvPublishingServer in Google Chronicle
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.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1216 System Script Proxy Execution
- Sub-technique
- T1216.002 SyncAppvPublishingServer
- Canonical reference
- https://attack.mitre.org/techniques/T1216/002/
YARA-L Detection Query
rule t1216_002_syncappv_powershell_proxy {
meta:
author = "Detection Engineering"
description = "Detects T1216.002 SyncAppvPublishingServer.vbs abuse for PowerShell proxy execution. Three branches: (1) wscript/cscript invoking SyncAppv with embedded PS payload keywords, (2) PowerShell spawned as child of wscript/cscript SyncAppv proxy, (3) SyncAppv launched from unexpected parent process."
mitre_attack_tactic = "Defense Evasion"
mitre_attack_technique = "T1216.002"
severity = "HIGH"
priority = "HIGH"
reference = "https://attack.mitre.org/techniques/T1216/002/"
events:
$e.metadata.event_type = "PROCESS_LAUNCH"
(
/* Branch 1: wscript/cscript directly invoking SyncAppv with PowerShell payload in command line */
(
re.regex($e.target.process.file.full_path, `(?i)(wscript|cscript)\.exe$`) and
re.regex($e.target.process.command_line, `(?i)syncappvpublishingserver`) and
re.regex($e.target.process.command_line,
`(?i)(invoke-expression|iex[\s(]|invoke-webrequest|net\.webclient|downloadstring|downloadfile|-encodedcommand|-enc\s|new-object|start-process|invoke-command|bypass|shellcode|frombase64string|amsiutils|mimikatz|reflection)`
)
) or
/* Branch 2: PowerShell spawned as child of wscript/cscript that invoked SyncAppvPublishingServer */
(
re.regex($e.target.process.file.full_path, `(?i)(powershell|pwsh)\.exe$`) and
re.regex($e.principal.process.file.full_path, `(?i)(wscript|cscript)\.exe$`) and
re.regex($e.principal.process.command_line, `(?i)syncappvpublishingserver`)
) or
/* Branch 3: wscript/cscript executing SyncAppvPublishingServer from an unexpected parent process */
(
re.regex($e.target.process.file.full_path, `(?i)(wscript|cscript)\.exe$`) and
re.regex($e.target.process.command_line, `(?i)syncappvpublishingserver`) and
not re.regex($e.principal.process.file.full_path,
`(?i)(explorer|svchost|services|winlogon|cmd)\.exe$`)
)
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting T1216.002 SyncAppvPublishingServer.vbs abuse using UDM PROCESS_LAUNCH events. Branch 1 fires on wscript/cscript invoking SyncAppvPublishingServer with PowerShell payload keywords in the command line using the principal-target process model. Branch 2 detects powershell.exe or pwsh.exe spawned as a child of wscript/cscript (principal) where the parent command line references SyncAppvPublishingServer. Branch 3 triggers when wscript/cscript runs SyncAppvPublishingServer from a parent process not in the expected whitelist. Requires Windows process telemetry forwarded to Chronicle via forwarder or Microsoft Defender integration.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate App-V application publishing sequences initiated by IT administrators where wscript.exe calls SyncAppvPublishingServer.vbs with PowerShell arguments for genuine App-V package streaming configuration or refresh operations
- Enterprise software packaging tools such as SCCM App-V integration components or Flexera AdminStudio that automate SyncAppvPublishingServer invocations as part of managed application deployment pipelines where PowerShell keywords appear in delivery arguments
- Third-party IT automation scripts or runbooks that use SyncAppvPublishingServer.vbs in combination with PowerShell for App-V virtual environment configuration on managed endpoints as part of approved change management processes
Other platforms for T1216.002
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1SyncAppvPublishingServer PowerShell Proxy — Benign Command
Expected signal: Sysmon Event ID 1: wscript.exe with CommandLine containing 'SyncAppvPublishingServer.vbs' and the argument 'n; whoami'. PowerShell ScriptBlock Log Event ID 4104 may capture the proxied command execution depending on the App-V configuration. Security Event ID 4688 (if command line auditing enabled) for wscript.exe.
- Test 2SyncAppvPublishingServer PowerShell Proxy — Encoded Command
Expected signal: Sysmon Event ID 1: wscript.exe with CommandLine containing 'SyncAppvPublishingServer.vbs', '-encodedCommand', and the Base64 payload. PowerShell ScriptBlock Log Event ID 4104 capturing the decoded command 'Write-Output Argus-Test-T1216.002'. If PowerShell spawns as a child process, a second Sysmon Event ID 1 for powershell.exe with parent=wscript.exe.
- Test 3SyncAppvPublishingServer PowerShell Proxy — Download Cradle Simulation
Expected signal: Sysmon Event ID 1: wscript.exe with CommandLine containing 'SyncAppvPublishingServer.vbs', 'Net.WebClient', 'DownloadString', and 'IEX'. Sysmon Event ID 3: network connection attempt to 127.0.0.1:8080 originating from wscript.exe or a child powershell.exe. PowerShell ScriptBlock Log Event ID 4104 capturing the download cradle code.
- Test 4SyncAppvPublishingServer via cmd.exe — Indirect Invocation
Expected signal: Sysmon Event ID 1 for cmd.exe (from whatever launched the test), then Sysmon Event ID 1 for wscript.exe with ParentImage=cmd.exe and CommandLine containing 'SyncAppvPublishingServer.vbs' and the PowerShell Get-Process command. The parent-child chain cmd.exe -> wscript.exe -> [powershell proxy] is captured.
References (9)
- https://attack.mitre.org/techniques/T1216/002/
- https://lolbas-project.github.io/lolbas/Scripts/Syncappvpublishingserver/
- https://www.trellix.com/en-ca/about/newsroom/stories/research/suspected-darkhotel-apt-activity-update/
- https://securelist.com/bluenoroff-methods-bypass-motw/108383/
- https://strontic.github.io/xcyclopedia/library/SyncAppvPublishingServer.exe-3C291419F60CDF9C2E4E19AD89944FA3.html
- https://x.com/monoxgas/status/895045566090010624
- https://www.hackingarticles.in/indirect-command-execution-defense-evasion-t1202/
- https://learn.microsoft.com/en-us/windows/application-management/app-v/appv-getting-started
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1216.002/T1216.002.md
Unlock Pro Content
Get the full detection package for T1216.002 including response playbook, investigation guide, and atomic red team tests.