Office Macro

Macros allow to execute VBScript code uppon Office document opening.

Write Macro

Within a Word document, choose Visual Basic from the Developer tab. Then double-click on ThisDocument to open the macro editor.


In order to execute the macro on document opening, use the following code skeleton (see VBScript for payloads):

Private Sub Document_Open()
End Sub

Use deceptive techniques to trick the user to enable macro and trigger execution.


Document**: 2019-Employee-Benefits-macro.doc**

Enable Macro Panel

In order to write a macro, you first need to enable the Developer tab of the Office application.

  1. Right-click on the Ribbon
  2. Customize the Ribbon
  3. Select Developer tab