Basics of Metasploit Framework

In this part, we will looking at some of the basic operations of the Metasploit Framework.

Launching the Metasploit Framework

To launch and open Metasploit Framework, simply use:

msfconsole

IIIIII    dTb.dTb        _.---._
  II     4'  v  'B   .'"".'/|\`.""'.
  II     6.     .P  :  .' / | \ `.  :
  II     'T;. .;P'  '.'  /  |  \  `.'
  II      'T; ;P'    `. /   |   \ .'
IIIIII     'YvP'       `-.__|__.-'

I love shells --egypt

       =[ metasploit v6.3.5-dev                           ]
+ -- --=[ 2296 exploits - 1202 auxiliary - 410 post       ]
+ -- --=[ 965 payloads - 45 encoders - 11 nops            ]
+ -- --=[ 9 evasion                                       ]

Metasploit tip: Search can apply complex filters such as 
search cve:2009 type:exploit, see all the filters 
with help search
Metasploit Documentation: https://docs.metasploit.com/

[msf](Jobs:0 Agents:0) >>

Looking for some basic help

You can try to find some help on how to use metasploit, just by entering:

help

This produces a very comprehensive listing of all the possible commands of the tool.

Search for something

If you wish to search for something inside metasploit you simply use the “search” command followed by your search parameter.

search vsftpd (”vsftpd” is just an example of something we might search)

Interacting with a specific Metasploit module

At the time of writing, Metasploit is composed of thousands of different modules (and you can even add your own specific modules). So you need to select the specific module to use. There are two basic commands to interact with a module: info and use.

Get information on a module

Ini order to get more information about a module, it is possible to use the info command. In order to do that, simply type info followed by the name of the module.

For instance:

info exploit/unix/ftp/vsftpd_234_backdoor (”exploit/unix/ftp/vsftpd_234_backdoor” is the name of the module)

You’ll see information about module and what it does, as well as the different options the module supports. In this particular module, the two possible options are RHOSTS and RPORT.

Use a specific module

To be able to use a specific module from metasploit you need to use the “use” command, followed by the name of the module.

use exploit/unix/ftp/vsftpd_234_backdoor (”exploit/unix/ftp/vsftpd_234_backdoor” is the name of the module)

After this you’ll enter in the specific commands for the module. Bellow there is a list of commands that can used with a particular module:

In order to learn about the specific options of a module you can use either the options or the advanced commands.

If you which to leave the module, simply use the “back” command.

Location of Metasploit Framework

Metasploit Framework is located on Kali Linux on the following directory:

/usr/share/metasploit-framework

You may go to this directory and take a look at its structure and components and at the same time have a look at some metasploit scripts (they are written in Ruby programming language).

For instance edit:

nano /usr/share/metasploit-framework/modules/exploits/unix/ftp/vsftpd_234_backdoor.rb

And have a look at the source-code:

References

Here are some more additional references about Metasploit:

Last updated