How to generate shellcode from custom exe in metasploit

To use a custom exe as a payload or to use your custom exe in a document or excel file, you have to “convert” your exe to shellcode. To accomplish this:

1> Run Kali Linux

2> Open a terminal window

3> Type


and hit enter

4> Type

use payload/generic/custom

and hit enter

5> Choose your custom exe:

set PAYLOADFILE /root/Desktop/mycustomexe.exe

6> Choose optionally a name-title:

set PAYLOADSTR mycustomexe

7> Type


and hit enter