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. Let's take a look at the available payloads, using the msfvenom command with the -l option:
root@kali:~# msfvenom -l payloads

Because the output of the command is too extensive to fit in this recipe, I will leave that for you to try out.

  1. To generate a payload, we always need to use at least two options, -p and -f. The -p option is used to specify which payload to generate from all those available in the Metasploit Framework, in this example a bind shell via GNU AWK:
root@kali:~# msfvenom -p cmd/unix/bind_awk -f rawNo platform was selected, choosing Msf::Module::Platform::Unix from the payloadNo Arch selected, selecting Arch: cmd from the payloadNo encoder or badchars specified, outputting raw payloadPayload size: 96 bytes ...

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