Name

setup_metasploit — Used to setup a runtime execution environment for the Metasploit framework exploit tool suite.

Synopsis

setup_metasploit [ -d [true]|false | --delete [true]|false ] [ -rd DEVICE | --ram-device DEVICE ] [ -rds SIZE | --ram-disk-size SIZE ] [ -rmp PATH | --ram-mount-point PATH ] [ -rdir DIRECTORY | --runtime-directory DIRECTORY ] [ -p PORT | --msfweb-port PORT ] [ -b HOSTNAME|IPv4ADDR | --msfweb-bind-addr HOSTNAME|IPv4ADDR ] [ -h [true]|false | --help [true]|false ] [ -H [true]|false | --help-long [true]|false ] [ -v [true]|false | --verbose [true]|false ] [ --version [true]|false ]

Description

The setup_metasploit is used with the NST distribution to setup a runtime execution environment for the Metasploit framework exploit tool suite. The main goal of the Metasploit project is to provide useful information to people who perform penetration testing, IDS signature development, and exploit research. The default configuration will create a 64MB RAM disk for Metasploit framework tool suite at directory location: "/mnt/ram4/metasploit".

Once the setup has completed, one can go to the runtime directory and start using the command line Metasploit tool: "msfconsole" or startup the web-based Metasploit framework: "msfweb" using the start/stop script: "/etc/init.d/msfwebd".

The examples below show how to use the setup_metasploit script:

This example creates a runtime execution environment for the Metasploit tool suite using RAM device: "/dev/ram7". A corresponding mount point at directory location: "/mnt/ram7" will be used. Verbose output was also specified.

Example 1. Setup Using A RAM Disk

        [root@probe ~]# setup_metasploit -rd /dev/ram7 -v
      

This example creates a runtime execution environment for the Metasploit tool suite at directory location: "/data4/msf". This directory must exist prior to running the command. The Metasploit framework web services port will be set to: "4560" with a binding IP network address set to: "10.10.3.2". The Metasploit framework web services are then started and managed by the text-based elinks web browser.

Example 2. Create Runtime At /data4/msf

        [root@probe ~]# setup_metasploit -rdir /data4/msf -p 4560 -b 10.10.3.2
        [root@probe ~]# /etc/init.d/msfwebd start
        [root@probe ~]# elinks http://10.10.3.2:4560
      

Note:

This script does not start up the Metasploit framework web services. Use the start/stop script: "/etc/init.d/msfwebd" or the NST WUI for managing Metasploit framework web services.

Options

The following command line options are available:

[-d [true]|false] | [--delete [true]|false]

Delete the previous metasploit runtime directory if it exists prior to setting up a new one.

[-rd DEVICE] | [--ram-device DEVICE]

Use this optional parameter to change the default RAM device that will be used for setting up the runtime environment for the metasploit framework exploit tool. The following RAM device names are available on NST: "/dev/ram0" - /dev/ram9". A cooresponding mount point path: "/mnt/ram0 - /mnt/ram9" will be automatically selected for the RAM device. One can use the following optional parameter: [-rmp PATH] to change the mount point path location for the selected RAM device. The default value is: "/dev/ram4".

[-rds SIZE] | [--ram-disk-size SIZE]

Use this optional parameter to change the default RAM disk size in MegaBytes (MB) that will be used for the metasploit framework exploit tool runtime environment. **Note: Use a reasonable value and make sure you to not exceed your available system RAM. The system memory utility: "free" can be used to help make your determination. The default value is: "64". The minimum value permitted is 10. The maximum value permitted is 1024.

[-rmp PATH] | [--ram-mount-point PATH]

Use this optional parameter to change the selected RAM device's: [-rd DEVICE] mount point path location for the metasploit framework exploit tool runtime environment.

[-rdir DIRECTORY] | [--runtime-directory DIRECTORY]

One can use this optional parameter to force the "setup_metasploit" script to use an existing runtime directory on a locally attached disk drive or a mounted network file system and bypass the creation of a RAM disk. To do this, make sure the directory initially exists prior to using this option.

[-p PORT] | [--msfweb-port PORT]

Use this optional parameter to change the default metasploit framework web services "port" value. The default value is: "55555". The minimum value permitted is 1. The maximum value permitted is 65535.

[-b HOSTNAME|IPv4ADDR] | [--msfweb-bind-addr HOSTNAME|IPv4ADDR]

Use this optional parameter to change the default metasploit framework web services bind address. The default configuration is for the listening bind address to be set to the loopback address: "127.0.0.1". You can set it to one of the NST probe's network interface IP addresses or to: "0.0.0.0" which will open the server up to the entire network.

[-h [true]|false] | [--help [true]|false]

When this option is specified, setup_metasploit will display a short one line description of setup_metasploit, followed by a short description of each of the supported command line options. After displaying this information setup_metasploit will terminate.

[-H [true]|false] | [--help-long [true]|false]

This option will attempt to pull up additional setup_metasploit documentation within a text based web browser. You can force which browser we use setting the environment variable TEXTBROWSER, otherwise, we will search for some common ones.

[-v [true]|false] | [--verbose [true]|false]

When you set this option to true, setup_metasploit will produce additional output. This is typically used for diagnostic purposes to help track down when things go wrong.

[--version [true]|false]

If this option is specified, the version number of the script is displayed.

Files

/etc/sysconfig/msfwebd

System configuration file for the Metasploit framework web services.

Environment

TEXTBROWSER

This controls what text based browser is used to display help information about the script. If not set, we will search your system for available text-based browsers (Ex: elinks, lynx ...).

RUBYLIB

Configure this environment variable prior to using the setup_metasploit script to set the path of the installed ruby library.

x86 Example: "export RUBYLIB=/usr/lib/ruby/site_ruby/1.8"

x86_64 Example: "export RUBYLIB=/usr/lib/ruby/site_ruby/1.8:/usr/lib64/ruby/1.8"

See Also

Network Security Toolkit