Macros allow to execute VBScript code uppon Office document opening.
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() [VBS PAYLOAD] End Sub
Use deceptive techniques to trick the user to enable macro and trigger execution.
Enable Macro Panel
In order to write a macro, you first need to enable the Developer tab of the Office application.
- Right-click on the Ribbon
- Customize the Ribbon
- Select Developer tab