Skip to content

Commit 7ec5ec6

Browse files
committed
Update doc
1 parent 34f0744 commit 7ec5ec6

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

documentation/modules/exploit/multi/fileformat/office_word_macro.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
## Description
23

34
This module generates a macro-enabled Microsoft Office Word document. It does not target a specific
@@ -8,10 +9,6 @@ There are many ways to create this type of malicious doc. The module injects the
89
payload in the comments field, which will get decoded back by the macro and executed as a Windows
910
executable when the Office document is launched.
1011

11-
Please note: By default, Microsoft Office does not execute macros automatically. If a macro is
12-
present, the user will most likely need to manually click on the "Enable Content" button in order
13-
to run the macro.
14-
1512

1613
## Vulnerable Application
1714

@@ -23,10 +20,11 @@ Specifically, this module was tested specifically against:
2320
* Microsoft Office 2010.
2421
* Microsoft Office 2013.
2522
* Microsoft Office 2016.
23+
* Microsoft Office Word 15.29.1 (161215).
2624

2725
## Verification Steps
2826

29-
1. ```use exploit/windows/fileformat/office_word_macro```
27+
1. ```use exploit/multi/fileformat/office_word_macro```
3028
2. ```set PAYLOAD [PAYLOAD NAME]```
3129
3. Configure the rest of the settings accordingly (BODY, LHOST, LPORT, etc)
3230
4. ```exploit```
@@ -62,3 +60,38 @@ While editing, you should avoid modifying the following unless you are an advanc
6260
in front of the payload string. The blank space is for making the payload less obvious
6361
at first sight if the user views the file properties.
6462
* The VB code in the macro.
63+
64+
## Trusted Document
65+
66+
By default, Microsoft Office does not execute macros automatically unless it is considered as a
67+
trusted document. This means that if a macro is present, the user will most likely need to manually
68+
click on the "Enable Content" button in order to run the macro.
69+
70+
Many in-the-wild attacks face this type of challenge, and most rely on social-engineering to trick
71+
the user into allowing the macro to run. For example, making the document look like something
72+
written from a legit source, such as [this attack](https://motherboard.vice.com/en_us/article/these-hackers-cleverly-disguised-their-malware-as-a-document-about-trumps-victory).
73+
74+
To truly make the macro document to run without any warnings, you must somehow figure out a way to
75+
sign the macro by a trusted publisher, or using a certificate that the targeted machine trusts.
76+
77+
For testing purposes, another way to have a certificate is to create a self-signed one using
78+
Microsoft Office's SELFCERT.exe utility. This tool can be found in the following path on
79+
Windows:
80+
81+
```
82+
C:\Program Files\Microsoft Office\root\Office16\SELFCERT.exe
83+
```
84+
85+
In Office 2010, the self-signing tool is actually an option in the Office tools folder in the
86+
start menu. It should be named "Digital Certificate for VBA Projects".
87+
88+
Double-click on the executable, enter a random name and click "OK", at this point you have a
89+
certificate to play with.
90+
91+
Next, we want to flag this certificate as trusted:
92+
93+
1. Click on Start, and then enter "Internet Options".
94+
2. Click on the Content tab, and then click on the Certificates button.
95+
3. You should see your new certificate under the Personal tab, export it.
96+
4. Click on the Trusted Publishers, and then import your personal certificate.
97+
5. Try the macro exploit again, it should run the malicious code without warning.

0 commit comments

Comments
 (0)