Metasploit Express 4.9 User Guide PDF
Metasploit Express 4.9 User Guide PDF
Release 4.9
Overview
Features Overview
i
Administration
Administration Overview..............................................................................................................13
User Account Management .........................................................................................................13
Creating a User Account.......................................................................................................13
Editing a User Account .........................................................................................................13
Changing a User Account Password ....................................................................................14
Resetting a User Account Password on Windows................................................................14
Resetting a User Account Password on Linux......................................................................14
Deleting a User Account .......................................................................................................14
System Management...................................................................................................................15
Product News .......................................................................................................................15
Configuring Global Settings ..................................................................................................15
Managing License Keys........................................................................................................17
Managing the System ...........................................................................................................17
Project Management ...................................................................................................................19
Configuring Project Settings .................................................................................................19
Projects
Discovering Hosts
Discovery Overview.....................................................................................................................23
Discovery Scan............................................................................................................................23
IPv6 Addresses for Target Hosts..........................................................................................23
Discovery Scan Options .......................................................................................................24
Discovering Hosts.................................................................................................................26
Discovering Virtual Hosts......................................................................................................26
Scanning the Network for H.323 Video Conferencing Systems ...........................................27
Defining Nmap Arguments....................................................................................................27
Nexpose Scan .............................................................................................................................27
Nexpose Scan Options .........................................................................................................28
Configuring a Nexpose Console ...........................................................................................30
Running a Nexpose Scan .....................................................................................................31
Running a Nexpose Scan with a Custom Scan Template ....................................................31
Passing the Hash from Metasploit Express ..........................................................................32
ii
Purging Scan Data................................................................................................................32
Imported Scan and Vulnerability Data .........................................................................................33
Supported Scan Data Formats .............................................................................................33
Importing Data ......................................................................................................................34
Host Data.....................................................................................................................................34
Viewing Host Notes ..............................................................................................................35
Viewing Host Services ..........................................................................................................35
Viewing Host Evidence .........................................................................................................35
Viewing Host Vulnerabilities .................................................................................................35
Vulnerability Management ...........................................................................................................35
Adding a Vulnerability ...........................................................................................................35
Exploiting a Known Vulnerability...........................................................................................36
Editing a Vulnerability ...........................................................................................................36
Deleting a Vulnerability .........................................................................................................36
Host Management .......................................................................................................................36
Adding a Host .......................................................................................................................37
Deleting a Host .....................................................................................................................37
Host Badges ................................................................................................................................37
Gaining Access
iii
Post-Exploitation Modules ....................................................................................................60
Post-Exploitation Macros ......................................................................................................61
Listeners ...............................................................................................................................61
Session Overview........................................................................................................................64
Active Sessions ...........................................................................................................................64
Command Shell Session ......................................................................................................64
Meterpreter Session .............................................................................................................65
Authentication Notes.............................................................................................................65
Session Tasks .............................................................................................................................66
Session Details .....................................................................................................................66
Proxy Pivot............................................................................................................................66
VPN Pivot .............................................................................................................................67
VNC Sessions.......................................................................................................................68
File Systems .........................................................................................................................68
Evidence Collection
Reports
iv
ABOUT THIS GUIDE
This guide provides information and instructions for Metasploit Express. The following
sections describe the audience, organization, and conventions used within this guide.
Target Audience
This guide is for IT and security professionals who use Metasploit Express as a penetration
testing solution.
Organization
This guide includes the following chapters:
Document Conventions
The following table describes the conventions and formats that this guide uses:
Convention Description
1
Convention Description
Support
Rapid7 and the community strive to provide you with a variety of support options. For a list of
support options that are available, view the support section for the Metasploit product that you
are using.
You can visit the Customer Center or e-mail the Rapid7 support team to obtain support for
Metasploit Pro and Metasploit Express. To log in to the Customer Center, use the e-mail and
password provided by Rapid7.
The following table describes the methods you can use to contact the Rapid7 support team.
Support Method Contact Information
An official support team is not available for the Metasploit Framework or for Metasploit
Community. However, there are multiple support channels available for you to use, such as
the IRC channel and mailing list.
You can visit the Metasploit Community to submit your question to the community or you can
visit the help page to view the support options that are available.
You can visit the Metasploit Community to submit your question to the community or you can
visit the help page to view the support options that are available.
2
Joining the IRC Channel
IRC, or Internet Relay Chat, lets you communicate with other members of the Metasploit IRC
channel in real time. There are several IRC clients that you can use to connect to the
Metasploit IRC channel, such as Pidgin, Xchat, and Chatzilla. Choose the client that works
best for you.
After you install an IRC client, use the following channel and server information to connect to
the Metasploit channel.
Server: irc.freenode.net
Channel: #metasploit
3
6.) Enter a user name and password for the IRC account.
10.) After you press enter, NickServ alerts you that an activation e-mail has been sent to your
e-mail address. Check your e-mail and follow the activation instructions.
11.) After you activate your IRC account, go back to the Pidgin Buddy List.
4
12.) Select Buddies > Join a Chat. The Join a Chat window appears.
13.) Enter #metasploit in the Channel field. The channel does not require a password.
The mailing list provides access to active discussions between Metasploit users and
developers. Subscribe to the mailing list to view the latest questions and ideas from the
Metasploit community.
To join the mailing list, you can send a blank e-mail to framework-
[email protected] or you can fill out the Metasploit mailing list form.
5
OVERVIEW
This chapter covers the following topics:
Metasploit Express automates the process of discovery and exploitation and provides you
with the necessary tools to perform the manual testing phase of a penetration test. You can
use Metasploit Express to perform tasks like scan for open ports and services, exploit
vulnerabilities, collect evidence, and create a report of the test results.
Ultimately, Metasploit Express helps you identify the weakest point to exploit a target and
prove that a vulnerability or security issue exists and help you to mitigate any security risks.
Metasploit Framework
An open source penetration testing and development platform that provides you with access
to every module that Metasploit Express needs to perform tasks. The Metasploit Framework
contains an exploit database that provides you with the latest exploit code for various
applications, operating systems, and platforms. You can leverage the power of the Metasploit
Framework to create additional custom security tools or write your own exploit code for new
vulnerabilities. The Metasploit team regularly releases weekly updates that contain new
6
modules and bi-weekly updates that contain fixes and enhancements for known issues with
Metasploit Express.
Services
Metasploit Express uses PostgreSQL, Ruby on Rails, and Pro Service. PostgreSQL runs the
database that Metasploit Express uses to store data from a project. Ruby on Rails runs the
web Metasploit Express web interface. Pro service, or the Metasploit service bootstraps Rails,
the Metasploit Framework, and the Metasploit RPC server.
Modules
A prepackaged collection of code from the Metasploit Framework that performs a specific
task, such as run a Nmap scan or an exploit. Every task in Metasploit Express uses modules.
Some tasks, like a bruteforce attack or discovery scan, use multiple modules, whereas an
exploit uses a single module.
User Interface
The component that you use to interact with Metasploit Express. To launch the user interface,
open a web browser and go to https://localhost:3790.
Metasploit Implementation
Rapid7 distributes Metasploit Express as an executable file for Linux and Windows operating
systems. Download and run the executable to install Metasploit Express on your local
machine or on a remote host, like a web server. Regardless of where you install Metasploit
Express, you always access the user interface through a web browser. Metasploit Express
uses a secure connection to connect to the server or machine that runs it.
If you install Metasploit Express on a web server, users can use a web browser to access the
user interface from any location. Users will need the address and port for the server that
Metasploit Express uses. By default, the Metasploit service uses port 3790. You can change
the port that Metasploit uses during the installation process. So, for example, if Metasploit
Express runs on 192.168.184.142 and port 3790, users can use https://192.168.184.142:3790
to launch the user interface.
If Metasploit Express runs on your local machine, you can use localhost and port 3790 to
access Metasploit Express. For example, type https://localhost:3790 in the browser URL box
to load the user interface.
If you have not installed Metasploit Express, you can download the installer from the Rapid7
website. You will need a license key to activate the product. If you do not have a license key,
please contact the Rapid7 support team.
7
Common Metasploit Terminology
The following sections describe the most commonly used terms in Metasploit.
Database
The database stores target host data, system logs, collected evidence, and report data.
Discovery Scan
A discovery scan is the Metasploit internal scanner that combines Nmap and several
Metasploit modules to scan and fingerprint targets. If you do not have Nexpose or scan data to
import into Metasploit Express, you can run a discovery scan to gather information about the
target. There are several scan speeds that you can configure for a discovery scan. The scan
speed determines the method that the discovery scan uses to perform the discovery process.
Exploit
Listener
A listener waits for an incoming connection from either the exploited target or the attacking
machine and manages the connection when it receives it.
Meterpreter
Meterpreter is an advanced multi-function payload that provides you an interactive shell. From
the Meterpreter shell, you can do things like download a file, obtain the password hashes for
user accounts, and pivot into other networks. Meterpreter runs on memory, so it is
undetectable by most intrusion detection systems.
8
Module
Payload
A payload is the actual code that executes on the target system after an exploit successfully
executes.
A payload can be a reverse shell payload or a bind shell payload. The major difference
between these payloads is the direction of the connection after the exploit occurs.
A bind shell attaches a listener on the exploited system and waits for the attacking machine to
connect to the listener.
Project
A project is a container for the targets, tasks, reports, and data that are part of a penetration
test. A project represents the workspace that you use to create a penetration test and
configure tasks. Every penetration test runs from within a project.
Shell
A shell is a console-like interface that provides you with access to a remote target.
Shellcode
9
Target
A target is the system that you want to exploit. The term target can represent a single host,
multiple hosts, a network range, or an entire network.
Task
A task represents an action that Metasploit Express can perform, such as a scan, bruteforce
attack, exploit, or report generation.
Vulnerability
Metasploit Workflow
The overall process of penetration testing can be broken down into a series of steps or
phases. Depending on the methodology that you follow, there can be anywhere between four
and seven phases in a penetration test. The names of the phases can vary, but they generally
include reconnaissance, scanning, exploitation, post-exploitation, maintaining access,
reporting, and cleaning up.
The Metasploit Express workflow follows the general steps of a penetration test. Besides
reconnaissance, you can perform the other penetration testing steps from Metasploit Express.
1.) Information Gathering- Use the Discovery scan, Nexpose scan, or import tool to supply
Metasploit Express with a list of targets and the running services and open ports associ-
ated with those targets.
2.) Exploitation - Use smart exploits or manual exploits to launch attacks against target
machines. Additionally, you can run bruteforce attacks to escalate account privileges and
to gain access to exploited machines.
3.) Post-Exploitation - Use post-exploitation modules or interactive sessions to interact
gather more information from compromised targets. Metasploit Express provides you with
several tools that you can use to interact with open sessions on an exploited machine. For
example, you can view shared file systems on the compromised target to identify
information about internal applications. You can leverage this information to obtain even
more information about the
4.) Reporting - Use the reporting engine to create a report that details the findings of the
penetration test. Metasploit Express provides several types that let you to determine the
type of information that the report includes.
10
5.) Cleaning Up - Use the Clean Up tool to close any open sessions on an exploited target
and to remove any evidence of any data used during the penetration test. This step
restores the original settings on the target system.
11
FEATURES OVERVIEW
This chapter covers the following topics:
Features Overview 12
The Dashboard 12
Navigational Tour 13
Administration Tour 14
Features Tour 16
Features Overview
Metasploit Express provides a comprehensive and intuitive workspace that you can use to
perform administrative tasks and to configure penetration tests.
The Dashboard
The Dashboard provides access to quick tasks and displays a project overview. The project
overview shows a numerical breakdown of discovered hosts, opened and closed sessions,
and collected evidence. Use the Dashboard for a high level overview of the project.
The following figure shows the Dashboard:
Navigational Tour
You can use the navigational features to navigate between the different areas of Metasploit
Express.
1.) Main menu - Use the main menu to manage project settings, configure user account
information, and perform administration tasks.
2.) Task bar - Use the task bar to navigate between task pages.
3.) Navigational breadcrumbs - Use the navigational breadcrumbs to switch between task
pages.
13
The following figure shows the navigational features:
Administration Tour
Administrators can perform administrative tasks, like manage projects, accounts, global
settings, and software updates, from the main menu.
Project Management
A Metasploit Express project contains the penetration test that you want to run. A project
defines the target systems, network boundaries, modules, and web campaigns that you want
to include in the penetration test. Additionally, within a project, you can use discovery scan to
identify target systems and bruteforce to gain access to systems.
14
The following figure shows the project management area:
Global Settings
Global settings define settings that all projects use. You can access global settings from the
Administration menu.
From the global settings, you can set the payload type for the modules and enable access to
the diagnostic console through a web browser.
15
System Management
As an administrator, you can update the license key and perform software updates. You can
access the system management tools from the Administration menu.
Features Tour
Metasploit Express provides a comprehensive penetration testing system that you can use to
scan for target hosts, open and control sessions, exploit vulnerabilities, and generate reports.
Host Scan
A host scan identifies vulnerable systems within the target network range that you define.
When you perform a scan, Metasploit Express provides information about the services,
vulnerabilities, and captured evidence for hosts that the scan discovers. Additionally, you can
add vulnerabilities, notes, tags, and tokens to identified hosts.
You can scan target systems and view discovered host information from the Analysis tab.
16
The following figure shows the features that you can access from the Analysis tab:
Bruteforce
Bruteforce uses a large number of user name and password combinations to attempt to gain
access to a host. Metasploit Express provides preset bruteforce profiles that you can use to
customize attacks for a specific environment. If you have a list of credentials that you want to
use, you can import the credentials into the system.
If a bruteforce is successful, Metasploit Express opens a session on the target system. You
can take control of the session through a command shell or Meterpreter session. If there is an
open session, you can collect system data, access the remote file system, pivot attacks and
traffic, and run post-exploitation modules.
Exploitation
Modules expose and exploit vulnerabilities and security flaws in target systems. Metasploit
Express offers access to a comprehensive library of exploit modules, auxiliary modules, and
post-exploitation modules. You can run automated exploits or manual exploits.
Automated exploitation uses the minimum reliability option to determine the set of exploits to
run against the target systems. You cannot select the modules or define evasion options that
Metasploit Express uses.
Manual exploitation provides granular control over the exploits that you run against the target
systems. You run one exploit at a time, and you can choose the modules and evasion options
that you want to use.
17
The following figure shows the modules area:
Reports
A report provides comprehensive results from a penetration test. Metasploit Express provides
several types of standard reports that range from high level, general overviews to detailed
report findings. You can generate a report in PDF, Word, XML, and HTML.
You can use reports to compare findings between different tests or different systems. Reports
provide details on compromised hosts, executed modules, cracked passwords, cracked SMB
hashes, discovered SSH keys, discovered services, collected evidence, and web campaigns.
18
ADMINISTRATION
This chapter covers the following topics:
Administration Overview 19
User Account Management 19
System Management 21
Project Management 26
Administration Overview
As an administrator, you manage user accounts, perform system maintenance, and manage
projects.
1.) Click Administrator > User Administration from the main menu.
2.) Click New User.
3.) Enter a user name.
4.) Enter the first and last name in the Full Name field.
5.) Enter a password. Use mixed case, punctuation, numbers, and at least six characters to
create a strong password. You must create a strong password because Metasploit
Express runs as root.
6.) Reenter the password in the Password Confirmation field.
7.) Select a role for the user. If you do not choose “Administrator,” the default user role is
basic.
8.) Save the changes to the user account.
19
Editing a User Account
1.) Click Account > User Settings from the main menu.
2.) Edit the Full Name, Email, Organization, or Time Zone fields for the user account.
3.) Save the changes.
1.) Click Administration > User Administration from the main menu.
2.) Click the user account that you want to modify.
3.) Enter a new password for the user account. Use mixed case, punctuation, numbers, and
at least six characters to create a strong password. You must create a strong password
because Metasploit Express runs as root.
4.) Reenter the new password.
5.) Apply the changes to the password.
If you forget the Metasploit Express user account password, you can reset the password. The
system resets the password to a random value, which you can change after you log back in to
Metasploit Express.
1.) From the Start menu, choose All Programs > Metasploit > Password Reset. The Pass-
word Reset window appears. Wait for the environment to load and prompt you to con-
tinue.
2.) Type yes to continue. The system resets the password to a random value.
3.) Copy the password and use the password the next time you log in to Metasploit Express.
4.) Exit the Password Reset window.
20
Deleting a User Account
1.) Click Administration > User Administration from the main menu.
2.) Click the user account that you want to delete.
3.) Click Delete.
4.) Click OK to confirm that you want to delete the account.
System Management
The administrator can configure the global settings for projects, create API keys, manage
license keys, and update the system.
Product News
When you access the Projects page, the Product News displays and lists the latest blog posts
from the Metasploit Community site. You can click on any of the blog links to access the blog
entry.
21
Configuring Global Settings
Metasploit Express applies global settings to all projects. Use global settings to set HTTP and
HTTPS payloads and to access diagnostic data through a Web browser. Additionally, you can
configure an HTTP proxy so that the system can alert you when updates are available for
Metasploit Express.
1.) Select Administration > Global Settings from the main menu.
2.) Select or deselect payload_prefer_http from the Global Settings.
3.) Update the settings.
1.) Choose Administration > Global Settings from the main menu.
2.) Choose payload_prefer_https from the Global Settings.
3.) Update the settings.
1.) Choose Administration > Global Settings from the main menu.
2.) Choose payload_prefer_access from the Global Settings.
3.) Update the settings.
1.) Choose Administration > Global Settings from the main menu.
2.) Choose automatically_check_updates from the Global Settings.
3.) Update the settings.
22
Setting HTTP Proxy Settings for Update Notifications
1.) Choose Administration > Global Settings from the main menu.
2.) Choose use_http_proxy from the Global Settings.
3.) Enter the settings for the HTTP proxy server. You must define the IP address, port, user
name, and password for the proxy server.
4.) Update the settings. The settings that you define automatically fill the HTTP proxy server
settings when you perform an update.
License keys define the product edition and the registered owner of Metasploit Express.
Metasploit Express uses the license key to identify the number of days that remain on the
license.
1.) Select Administration > Software Licenses from the main menu.
2.) Enter the license key in the Product Key field.
3.) Activate the license.
If you do not have network access, use the offline activation file to activate Metasploit
Express. To obtain an offline activation file, contact customer support.
1.) Select Administration > Software Licenses from the main menu. The Offline Activa-
tion window appears.
2.) Browse to the location of the activation file.
3.) Select the activation file.
4.) Click Activate Product to complete the activation.
You can revert to a previous license key if Metasploit Express detects that a previous license
key exists on the system. Use license key reversion to switch between different versions of
Metasploit products. For example, if you install a trial version of a Metasploit product, use
license key reversion to switch back to the full version.
23
1.) Select Administration > Software Licenses from the main menu.
2.) Click Change Key.
3.) Click Revert License. The License Details window appears if Metasploit Express reverts
to the previous version.
If you are an administrator, you must regularly check for available updates to Metasploit
Express. When you check for updates, Metasploit Express alerts you when a newer version is
available for you to install. If a newer version of Metasploit Express is not available, the system
notifies you that you have the latest version.
1.) Click Administration > Software Updates from the main menu. The Software Updates
window appears.
2.) Select Use an HTTP Proxy to reach the internet if you want to use an HTTP proxy
server to check for updates. If you select this option, the proxy settings appear. Configure
the settings for the HTTP proxy that you want to use.
3.) Check for updates.
After the update completes, Metasploit Express prompts you to restart the back end services.
If you restart the services, Metasploit Express terminates active sessions and requires up to
five minutes to restart.
Update Notifications
Metasploit Express alerts you when there is a software update available. The notification
appears in the main menu of the interface. The figure below shows the update notification.
The log file sizes can become large over time because there is no automatic rotation for log
files. To reduce the amount of disk space the log files consume, regularly review and clear log
files.
24
The following table describes the log files that are available:
Log File Log File Location
When you uninstall Metasploit Express, you remove the components and modules from the
system and the data stored within the penetration tests.
1.) Navigate to the root installation directory and enter ./ctlscript.sh.stop to stop all
Metasploit Express services.
2.) Enter ./uninstall.
3.) Click Yes to confirm that you want to uninstall Metasploit Express components and
modules.
4.) Click Yes to confirm that you want to delete the data saved in the penetration tests. If you
click No, the $INSTALLER_ROOT/apps directory remains intact, and you can access
Metasploit Express data stored in this directory.
25
Project Management
A project is a penetration test. Use projects to define the target systems that you want to test
and to configure tasks for the penetration test.
You want to create multiple projects to test different networks or different components of a
single network. For example, if you want to perform an internal and external penetration test,
create separate projects for each penetration test.
Project settings define the project name, description, network range, and user account
access.
When you create a project, you can define optional network boundaries that Metasploit
Express enforces on the penetration test. Use network boundaries to maintain the scope of a
project. If you enforce network boundaries, you ensure that you do not target devices outside
the range of targeted devices. Additionally, the network range defines the default range that all
tasks use.
Administrators and project owners can define the network range for a project.
Restrict the network range to enforce network boundaries on a project. When you restrict the
network range for a project, a user cannot run the penetration test unless the network range
for the project falls within network range that you define.
Before you restrict the network range, you must define the network range.
26
1.) Open the project.
2.) Click Project > Project Settings.
3.) Select Restrict to Network Range.
4.) Update the project.
27
PROJECTS
This chapter covers the following topics:
Project Overview 28
Working with a Project 29
Project Overview
A project contains the workspace that you use to perform the different steps for a penetration
test and store the data that you collect from the target. Projects are useful tools that you can
use to set up tests and organize the data that you gather from target machines. You can
create as many projects as you need, and you can switch between projects while tasks are in
progress.
From within a project, you define the targets that you want to test and configure the tasks that
you want to run against those targets. You can scan targets for active services and hosts,
attempt to exploit vulnerabilities, collect data from exploited machines, and generate reports
that detail your findings.
You can create projects to separate an engagement into logical groupings. Oftentimes, you
may have different requirements for the various departments, or subnets, within an
organization. Therefore, it may be more efficient for you to have different projects to represent
those requirements.
For example, you may want to create a project for the human resources department and
another project for the IT department. Your requirements for these departments may vary
greatly, so it would be logical for you to separate the targets into different projects. At the end
of the engagement, you can generate separate reports for each department to perform a
comparative analysis and present your findings to your organization or client.
Project Components
28
Network range restriction - An option that restricts a project to a specific network range.
Enable this option if you want to ensure that the test does not target devices outside the
scope of the engagement. If you enable this option, Metasploit Express will not run tasks
against a target whose address does not fall within the network range.
Within a project, you can scan for hosts, open and take control of sessions, and generate
reports.
You create a project when you want to test multiple networks or different components of a
single network. For example, if you want to perform an internal and external penetration test,
you create a separate project for each test. Each project generates a separate report for each
test scenario that you can use to compare test results.
Creating a Project
1.) Select Project > Create New Project from the main menu.
2.) Enter the project name.
3.) Enter a description for the project.
4.) Define an optional network range. To enter multiple network ranges, use a comma to
separate each range.
5.) Select Restrict to network range if you want to enforce network boundaries on the
project.
6.) Create the project.
Editing a Project
1.) Select Project > Project Settings from the main menu.
2.) Edit the project name, description, network range, or network range restriction.
3.) Update the project.
To view a list of all projects, select Project > Show All Projects from the main menu.
29
Restricting a Project to a Network Range
You can restrict the network range to enforce network boundaries on a project. When you
restrict a project to a network range, you cannot run any tasks unless the target addresses fall
within network range that you define.
For example, if you have a client who wants you to test a specific network range, you can set
the network range and restrict the project to it to ensure that you do not accidently target any
devices that are outside of that range.
30
4.) Select Restrict to Network Range.
31
DISCOVERING HOSTS
This chapter covers the following topics:
Discovery Overview 32
Discovery Scans 32
Nexpose Scan 42
Imported Scan and Vulnerability Data 48
Host Data 49
Vulnerability Management 50
Host Management 51
Host Badges 52
Discovery Overview
Before you can begin the exploitation phase of a penetration test, you must add host data to
the project. Host data refers to the IP addresses of the systems that you want to exploit and
the active ports, services, and vulnerability information associated with those systems. To add
host data to a project, you can either run a discovery scan or you can import scan data from a
vulnerability scanner, such as Nexpose or Nessus. If you import data from vulnerability
analysis tool, or some other third party vendor, you should still run a discovery scan to identify
new or additional information for those hosts.
A discovery scan is the port scanner included with Metasploit Express. It combines Nmap with
several modules to identify the systems that are alive and to uncover the open ports and
services. A port is a data connection that serves as a gateway for communication and enables
traffic to travel between systems. Network services, like SSH, telnet, and HTTP, typically run
on standard port numbers and can indicate the purpose of the system. You can use the
results to filter the list of attackable targets.
For example, if you discover a service that allows remote code execution, like VNC, you can
bruteforce the service to attempt to log into the system.
Discovery Scans
One of the first steps in penetration testing is reconnaissance. Reconnaissance is the process
of gathering information to obtain a better understanding of a network. It enables you to create
list of target IP addresses and devise a plan of attack. Once you have a list of IP addresses,
you can run a discovery scan to learn more about those hosts. A discovery scan identifies the
operating systems that are running on a network, maps those systems to IP addresses, and
enumerates the open ports and services on those systems.
32
A discovery scan is the internal Metasploit scanner. It uses Nmap to perform basic TCP port
scanning and runs additional scanner modules to gather more information about the target
hosts. By default, the discovery scan includes a UDP scan, which sends UDP probes to the
most commonly known UDP ports, such as NETBIOS, DHCP, DNS, and SNMP. The
discovery scan tests approximately 250 ports that are typically exposed for external services
and are more commonly tested during a penetration test.
During a discovery scan, Metasploit Express automatically adds the host data to the project.
You can review the host data to obtain a better understanding of the topology of the network
and to determine the best way to exploit each target. Oftentimes, the network topology
provides insight into the types of applications and devices the target has in place. The more
information that you can gather about a target, the more it will help you fine-tune a test for it.
A discovery scan can be divided into four distinct phases: ping scan, port scan, OS and
version detection, and data import.
The first phase of a discovery scan, ping scanning, determines if the hosts are online. The
discovery scan sets the -PI option, which tells Nmap to perform a standard ICMP ping sweep.
A single ICMP echo request is sent to the target. If there is an ICMP echo reply, the host is
considered ‘up’ or online. If a host is online, the discovery scan includes the host in the port
scan.
During the second phase, port scanning, Metasploit Express runs Nmap to identify the ports
that are open and the services are available on those ports. Nmap sends probes to various
ports and classifies the responses to determine the current state of the port. The scan covers
a wide variety of commonly exposed ports, such as HTTP, telnet, SSH, and FTP.
The discovery scan uses the default Nmap settings, but you can add custom Nmap options to
customize the Nmap scan. For example, the discovery scan runs a TCP SYN scan by default.
If you want to run a TCP Connect Scan instead of a TCP SYN Scan, you can supply the -sT
option. Any options that you specify override the default Nmap settings that the discovery
scan uses.
After the discovery scan identifies the open ports, the third phase begins. Nmap sends a
variety of probes to the open ports and detects the service version numbers and operating
system based on how the system responds to the probes. The operating system and version
33
numbers provide valuable information about the system and help you identify a possible
vulnerability and eliminate false positives.
Finally, after Nmap collects all the data and creates a report, Metasploit Express imports the
data into the project. Metasploit Express uses the service information to send additional
modules that target the discovered services and to probe the target for more data. For
example, if the discovery scan sweeps a target with telnet probes, the target system may
return a login prompt. A login prompt can indicate that the service allows remote access to the
system, so at this point, you may want to run a bruteforce attack to crack the credentials.
By default, the discovery scan includes the following set of port lists:
Standard and well known ports, such as ports 20, 21, 22, 23, 25 53, 80, and 443.
Alternative ports for a service, such as ports 8080 and 8442, which are additional ports that
HTTP and web services can use.
Ports listed as the default port in a module.
In total, the discovery scan includes over 250 ports. The following table lists the ports that the
are scanned during discovery:
34
Port and Service Port and Service Port and Service Port and Service
35
Port and Service Port and Service Port and Service Port and Service
If you do not see the port that you want to scan, you can manually add the port to the
discovery scan. For example, if you know that your company runs web servers with port 9998
36
open, you need to manually add port 9998 to the discovery scan. This ensures that the
discovery scan includes every port that is potentially open.
If you want to scan all ports, you can specify 1-65535 as the port range. Keep in mind that a
discovery scan that includes all ports can take several hours to complete.
If there is a port that you do not want to scan, you can exclude the port from the discovery
scan. The discovery scan will not scan any ports on the excluded list. For example, if your
company uses an application that runs on port 1234, and you do not want to affect the
application’s performance, you can add the port to the excluded list
The following table describes the default Nmap settings used by the discovery scan:
Option Description
Metasploit Express supports the import of scan data from vulnerability analysis tools, like
Nexpose, other penetration testing tools, like Core Impact, and non-vulnerability analysis
products, like PWDump files. If you want to use the scan data in your penetration test, you can
import the reports or scan data files into Metasploit Express.
37
Microsoft MBSA SecScan XML
nCircle IP360 (XMLv3 and ASPL)
NetSparker XML
Nessus NBE
Nessus XML (v1 and v2)
Qualys Asset XML
Qualys Scan XML
Burp Session XML
Acunetix XML
AppScan XML
Nmap XML
Retina XML
Amap Log
IP Address List
Libcap
Spiceworks Inventory Summary CSV
Core Impact XML
Raw XML is only available in commercial editions of Nexpose and includes additional
vulnerability information.
Note: Metasploit Express does not import service and port information from Qualys Asset
files. If you import a Qualys Asset file, you must run a discovery scan to enumerate
services and ports that are active on the imported hosts.
Metasploit Express does not automatically detect IPv6 addresses during a discovery scan.
For hosts with IPv6 addresses, you must know the individual IP addresses that are in use by
the target devices and specify those addresses to Metasploit Express. To identify individual
IPv6 addresses, you can use SNMP, Nmap, or thc-alive6, which is part of the thc-ipv6 tool kit.
After you identify the IPv6 addresses for the target devices, you can either import a text file
that contains the host addresses into a project or manually add the hosts to a project. If you
choose to import the addresses, the text file that you use must list one IPv6 address on each
line.
To import a host address file, select Analysis > Hosts > Import. The Import Data window
appears. Browse to the location of the host address file and import the host address file.
38
Discovery Scan Options
The following table describes the settings that you can configure for a discovery scan:
Option Description
Perform initial portscan Performs a portscan before the discovery scan performs
service version verification.
Custom Nmap arguments Sends flags and commands to the Nmap executable.
Discovery scan supports most Nmap options except for:
-o
-i
-resume
-script
-datadir
-stylesheet
Additional TCP ports Appends additional TCP ports to the existing Nmap scan
ports. Discovery scan appends the ports to -p.
Excluded TCP ports Excludes the TCP ports from service discovery, which
includes all Nmap options.
Custom TCP port range Specifies a range of TCP ports for the discovery scan to
use instead of the default ports.
39
Option Description
Portscan speed Controls the Nmap timing option (-T). Choose from the
following timing templates::
40
Discovering Hosts
When you perform a discovery scan, Metasploit Express automatically discovers guest
operating systems on the target system. Metasploit Express displays a list of virtual machines
on the host page and denotes the virtual machine with a VM icon. For example, a machine
that runs VMware ESX displays the VMware icon and the guest operating system and version.
Virtualization support enables you to easily differentiate between actual machines and virtual
machines. This ability becomes useful when you plan the scope of a penetration test.
VMware
Xen
BreakingPoint
Virtual PC
Virtual Iron
QEMU
VirtualBox
41
Compromised Virtual Systems
If you gain access to a target system that a runs virtual environment, Metasploit Express
captures screenshots of the guest operating systems on the host system. To view the
screenshots of the guest operating systems, go to Analysis > Host s > Captured Evidence.
The Captured Evidence tab displays a list of looted evidence, such as screenshots from
virtual machines.
Administrators can define a list of command line arguments to the Nmap executable for a
discovery scan. The command line arguments take precedence over any internal system
settings. You can use Nmap arguments to perform custom scan techniques, alternate
configurations, and modify scan speeds.
The discovery scan supports most Nmap options except for -o, -i, -resume, -datadir, and -
stylesheet.
1.) Open a project and launch a discovery scan. The New Discovery Scan window appears.
2.) Click Show Advanced Options.
3.) Enter the Nmap arguments in the Custom Nmap arguments field.
4.) Configure any additional options for the scan.
5.) Run the scan.
Nexpose Scan
You can use the Community and Enterprise editions of Nexpose to discover and scan devices
for known vulnerabilities. After you complete a Nexpose scan, you can import the scan data
into Metasploit Express. Metasploit Express imports the scan data and enables you to validate
and test the scan results.
42
Metasploit Express provides a connector that allows you to run and automatically import the
results of a Nexpose scan into a project.
Before you can run a Nexpose scan, you must download, install, and configure Nexpose.
Additionally, you must configure a Nexpose console through Metasploit Express.
Metasploit Express only supports the number of hosts that you have licenses for in Nexpose.
If you provide more hosts than you have licenses for, the scan fails. For example, if you have
a Community license, the most number of hosts Nexpose supports is 32. If you provide 35
hosts, the scan fails.
The following table describes the settings that you can configure for a discovery scan:
Option Description
Nexpose scan targets Defines the target address range for the Nexpose
scan.
Scan Template: Penetration Test Uses safe checks to perform an in-depth penetration
Audit test of the target systems. Enables host discovery
and network penetration options, which allows
Nexpose to dynamically discover additional systems
in the target network.
Scan Template: Full Audit Uses safe checks to perform a full network audit of
all target systems. The network audit includes
network-based vulnerability checks, patch/hot fix
checks, and application layer audits. The Full Audit
scan only scans default ports. Policy checking is
disabled, which makes the Full Audit scan perform
faster than the Exhaustive scan.
Scan Template: Exhaustive Audit Uses safe checks to perform an exhaustive network
audit of all target systems and services. The network
audit includes network-based vulnerability checks,
patch/hot fix checks, and application layer audits. An
Depending on the number of target hosts, an
Exhaustive scan can take several hours or days to
complete.
43
Option Description
44
Option Description
Before you can run a Nexpose scan, you must add a Nexpose console to the system. You can
manage Nexpose consoles globally. Connections to the Nexpose console act as a persistent
connections that you can use to import individual sites into a project.
After you set up the Nexpose console, you can access and use the console for a Nexpose
scan. Configured Nexpose consoles are automatically available for you to use.
45
7.) Click Show Advanced Options to configure additional options for the scan.
8.) Launch the Nexpose scan.
To use a custom scan template for a Nexpose scan, you must supply the scan template ID,
not the scan template name. To identify the scan template ID, log into the Nexpose Security
Console, select Administration > Scan Templates, and choose the scan template that you
want to use.
When the Scan Template Configuration page displays, locate the URL address box at the top
of the Nexpose Console. The URL address box displays the address and the template ID for
the scan template. For example, in the following address, https://my.console.address:3780/
admin/wizard/scan-template.html?templateid=dos-audit, the template id is dos-audit.
For more information on scan template IDs, visit the Nexpose documentation.
46
Passing the Hash from Metasploit Express
Passing the hash is a technique that enables attackers to use the NTLM and LM of a user’s
password to authenticate to a remote server or service. During exploitation, Metasploit
Express collects data, such as password hashes, from the exploited system. After Metasploit
Express collects password hashes from a target system, you can pass the hash and run a
Nexpose scan to perform a credentialed scan.
Before you can pass the hash in Metasploit Express, you must configure a Nexpose console
from the Global Settings. After you configure a Nexpose console, you can launch a Nexpose
scan from the Metasploit Express interface to pass the hash to the Nexpose scan.
A purge removes all scan data from the Nexpose console and ensures optimal performance
from the Nexpose scanner.
If you enable the purge scan option, Nexpose automatically deletes the scan data when the
scan completes.
47
5.) Enter addresses for the scan targets. You can specify an IP address or a host name.
There can be one address on each line.
Note: Metasploit Express supports IPv4 and IPv6 addresses. You can use standard IPv6
addressing to define individual IPv6 addresses. For example, use
fe80::202:b3ff:fe1e:8329 for single addresses and 2001:db8::/32 for CIDR
notations. For link local addresses, you must append the interface ID to the
address. For example, enter fe80::1%eth0 for a link local address.
6.) Select a scan template.
7.) Click Show Advanced Options to configure additional options for the scan.
8.) Select Purge Scan results upon completion.
9.) Launch the Nexpose scan.
Raw XML is only available in commercial editions of Nexpose and includes additional
vulnerability information.
48
Note: Metasploit Express does not import service and port information from Qualys Asset
files. If you import a Qualys Asset file, you need to run a discovery scan on the imported
hosts to enumerate services and ports that are active on those hosts.
Importing Data
Host Data
During a scan, Metasploit Express collects additional host information that you can view from
the Analysis page. Metasploit Express collects information from notes, services,
vulnerabilities, and captured evidence.
You can view host data though a grouped view or an individual view. The grouped view shows
the information grouped together by service type, vulnerability type, and evidence type. The
individual view lists all services, vulnerabilities, and evidence.
49
Viewing Host Services
Vulnerability Management
When Metasploit Express scans target systems, it identifies and fingerprints hosts as well as
determines the details of the hosts within a target address range. During the scanning
process, Metasploit Express identifies any known vulnerabilities for the target hosts.
If Metasploit Express does not identify a known vulnerability during a scan, you can add the
vulnerability to a target host.
Note: Before you modify or add a vulnerability, you must run a discovery scan for the project.
Adding a Vulnerability
50
8.) Save the vulnerability.
After Metasploit Express identifies the vulnerabilities that exist on a host, you can access and
run the exploit for each vulnerability directly from the host page. If you want to view more
information about the vulnerability, you can click the reference number that Metasploit Express
lists for each vulnerability.
Editing a Vulnerability
Deleting a Vulnerability
Host Management
You can manually configure a host if there is a host that you want to add to the project. You
can configure the details for the host, which includes the network, operating system, and
51
service information. You can also delete any hosts that you no longer need to access for the
project.
Adding a Host
Deleting a Host
Host Badges
A host badge identifies the status of each discovered host. Use the host badge to determine
whether Metasploit Express has scanned, cracked, shelled, or looted the host.
52
You can view the host badge for a host from the Status column on the Analysis window.
Host Badge Description
53
GAINING ACCESS
This chapter covers the following topics:
Bruteforce Attacks
A bruteforce attack attempts a large number of common user name and password
combinations to gain access to hosts. You can use preset bruteforce profiles to customize the
bruteforce attack for the environment.
After Metasploit Express opens the session, you can select the services that you want to
target in the bruteforce attack.You can target the following services:
SMB
Postgres
DB2
MySQL
MSSQL
HTTP
HTTPS
SSH
SSH_PUBKEY
54
Telnet
FTP
POP3
EXEC
Login
Shell
VMAUTHD
VNC
SNMP
Metasploit Express color codes bruteforce task logs to help you identify successful and
unsuccessful attacks. Metasploit Express records successful attacks in the database as
authentication notes. You can view the authentication notes from the Analysis window.
The following list describes the color codes that Metasploit Express uses for bruteforce tasks:
55
Bruteforce Attack Options
Option Description
Bruteforce Depth: Identifies the basic password combinations. Quick has the shortest
Quick duration because it attempts less than 25 known user name and
password combinations. Quick uses a static list of credentials and tries
them against discovered services. The list of credentials include:
Admin:admin
Admin:admin1
Admin:admin!
Test:test
Test:test1234
Test123:test123
cisco:cisco
user:user
administrator:administrator
root:root
root:toor
After the bruteforce attack tries the static credentials list, it tries the
user names with a blank password. The bruteforce attack prepends
known credentials to the static list.
56
Option Description
Bruteforce Depth: Attempts a fixed maximum number of credentials. The normal mode
Normal takes approximately 5 minutes per host on a fast LAN. The normal
mode focuses on common, protocol-specific user names as well as
discovered user names and passwords. The normal mode identifies
discovered passwords from a list of common passwords. Most
protocols have common defaults, which Metasploit Express tries after
known good credentials on other services.
The system tries these generated credentials after the current known
good credentials. The system adjusts the credentials figures after each
successive run, if the credentials become known as the modules run.
Bruteforce Depth: Attempts three times more passwords than the normal mode. The
Deep deep mode takes 15-20 minutes for each host on a fast LAN, if all
services are enabled. The additional passwords come from the
common password list.
For the few protocols that support fast enough guesses, passwords
are subject to a fixed set of transformations. For example, 1 for I and 0
for O.
SSH and Telnet are not subject to the deep multiplier because these
credentials take longer to test than the other services.
57
Option Description
Bruteforce Depth: Attempts 50,000 user name and password combinations for each
50K service.
Bruteforce Depth: Uses the user name and password list, or credential file, that you
Imported Only import into the system.
Bruteforce Depth: Attempts credentials that are already known for all services in the
Known Only target workspace. This includes SSH keys and passwords.
Bruteforce Use the Turbo speed on a fast LAN.
Speed: Turbo
Bruteforce Use the Fast speed on most LANs.
Speed: Fast
Bruteforce Use the Normal speed for external use.
Speed: Normal
Bruteforce Use the Slow speed for slow WAN links or to hide the scan.
Speed: Slow
Bruteforce Use the Stealthy speed if you want the attack to be sneaky.
Speed: Stealthy
Bruteforce Requires the most amount of time to complete.
Speed: Glacial
Target Services SMB, Postgres, DB2, MySQL, MSSQL, Oracle, HTTP, HTTPS, SSH,
Telnet, FTP, EXEC, Login, Shell, VNC, SNMP
Target Addresses Defines the hosts that the system includes in the bruteforce attack.
Excluded Defines the hosts that the system excludes from the bruteforce attack.
Addresses
Dry run Runs a bruteforce attack, prints a transcript of the modules, and quits
the attack. Metasploit Express does not run a live bruteforce attack
against the target system.
Produce verbose Records the successes and failures of the modules that the bruteforce
in the output task attack runs.
log
58
Option Description
Additional Defines the user name and password combinations that the bruteforce
credentials attack uses. Use commas to separate user name and password
combinations.
For user names with no password, define the user name only.
For user names with multiple passwords, use the following format:
username password1, password2, password 3.
SMB Domains Adds the domain as a space delimited list for services that accept
Windows-based authentication.
Payload Type Specifies the type of payload that the bruteforce attack uses. You can
choose Meterpreter or command shell.
Listener Ports Defines the port or port range that the bruteforce attack uses in
reverse connect payloads.
Connection Type Defines the connection type that the payload uses. Choose from auto,
reverse, or bind.
Listener Host Defines the IP address that the payload uses to connect back. Use this
option to override the listener port.
Auto Launch Defines the macro that runs during the bruteforce attack. You can
Macro create macros from the Global Settings.
Automatically Opens the session when a credentials is successful.
open sessions
with guessed
credentials
Limit to one Stops the bruteforce attack after the system collects the first
cracked credential.
credential per
service
Max guesses per Limits the number of guesses for each user - not each user name.
user
Timeout per Limits the total time that the attack limits to each service instance.
service
Timeout overall Limits the total amount of time that the system allocates to the
bruteforce attack.
Max guesses Limits the total number of guesses that the bruteforce attack attempts.
overall
59
Option Description
60
Option Description
Mutation: Strips off up to two digits within a password and replaces it with up to
substitute two digits. Passwords with more than three digits are ignored.
numbers within
candidate
passwords
Mutation: Rotates through a number of alpha to numeric substitutions before
transpose letters substituting all of them.
for “l33t-sp34k”
alternatives in
candidate
passwords
Mutation: append Appends a punctuation mark to the beginning of a password or
special replaces an existing punctuation mark.
characters to
candidate
passwords
Mutation: Prepends a punctuation mark to the end of a password or replaces an
prepend special existing punctuation mark.
characters to
candidate
passwords
Recombine Takes the user names and passwords from the known credentials list,
known, imported, imported list, and credentials text box, and assigns all the passwords
and additional to all users.
credentials
Include known Uses all known credentials from the project. The bruteforce attack tries
credentials the known passwords first. All credentials that are “known only” and
“quick” are not affected by the credential generation switch.
61
8.) Launch the bruteforce attack.
You can run a bruteforce attack against vmauthd, the authentication daemon for VMware’s
virtual infrastructure client, and for VMware Web Service. If the bruteforce attack successfully
guesses the credentials, then you can use the credentials to administer VMware.
Note: You cannot access VMware directly from Metasploit Express. However, after you gain
access to a virtual machine, you can run post-exploitation modules to identify more
information about the machine, such as configuration settings, logins, and other virtual
machines.
Before you can run a bruteforce attack using an imported credential list, you must import the
user name and password list. To import credentials, click the Manage Credentials button and
select the file that you want to upload.
62
Testing a Single Credential
Credential Management
You can import sets of untested credentials into Metasploit Express. Use imported credentials
when you run the scan in normal, deep, or imported only mode.
If you import multiple files, Metasploit Express consolidates the credentials from each file and
stores the data within a single, running file. The imported credentials do not display under the
credentials area. To view the imported credentials, you can download the imported credentials
as a single text file.
Note: You should use the Additional Credentials option for known credentials or for
bruteforce attacks that use the Include known credentials option.
For imported credential files, you can add spaces and any other special characters to
passwords by specifying them as \x20 or any other hex value -- \x09 for tab, \x90 for a
password with a NOP. If you have a password that contains the string \x20, you can use
\x5cx20 to protect the password.
63
The following table describes the credential file formats that Metasploit Express supports:
Format Description
PWDump A PWDump file can contain SMB hashes and space delimited user
name and password pairs. Each item must be on a separate line. The
bruteforce attack attempts the SMB hash credentials against services
that accept SMB hashes as plain text.
When you use a PWDump file, you must define the SMB domains to
target services that accept Windows authentication.
When you use a PWDump file, use the imported only bruteforce
depth to test only this list of credentials.
When you use a user name and password file, use the imported
only bruteforce depth to test only this list of credentials.
Use this format if you have a list of user names and passwords.
Example:
username1 passwordA
username2 passwordA passwordB
username3 passwordA passwordB passwordC
64
Format Description
Passwords only A passwords only file is a text file that contains only passwords.
There can be only one password for each line in the file.
When you use a plain password file, do not use the imported only
bruteforce depth. You must choose a different bruteforce depth so
that Metasploit Express can assign a user names to each password.
Use the plain password format if you have a list of passwords and
you want Metasploit Express to specify user names to test against.
Example:
password1
password2
password3
User names only A user names only file is a text file that contains only user names.
There can be one user name for each line in the file.
When you use a user names only file, do not use the imported only
bruteforce depth. You must choose a different bruteforce depth so
that Metasploit Express can assign a password to each user name.
Example:
jack
joe
john
All credential files, or custom word lists, must use a newline delimited format.
65
7.) Click Open after you select the credentials file.
8.) Select the type of content that the list contains. The file type can be UserPass,
Usernames, Passwords, PWDump, or SSH key. For example, choose Usernames if the
list contains only user names or Passwords if the list contains only passwords.
9.) Enter a name for the imported file.
10.) Enter a description for the imported file.
11.) Upload the file.
After you import a credential file or custom word list, you can select the file that you want the
bruteforce attack to use.
66
5.) Locate the credentials that you want to view. Click Delete for each file that you want to
delete.
You can use credential generation switches to specify how Metasploit Express generates
credentials.
The following table describes the credential generation switches that are available:
Credential Generation Switch Description
Include known credentials Uses all credentials already in the project. These
credentials are tried first. All credentials with the
“known only” and “quick” are not affected by the
Credential Generation Switch.
SMB: Preserve original domain Tries the original domain name.
names
Skip blank password generation Disables using blank passwords.
Excludes machine names as Skips using known computer names and user names
passwords as passwords.
Skip common Windows machine Skips Windows accounts that don’t have remote login
accounts rights or randomly generated passwords. These
include: TsInternetUser krbtgt NetShowServices,
IUSR_<anything>, IWAM_<anything>,
WMUS_USER-<anything>.
Skip common Unix machine Skips Unix accounts that don’t have remote login
accounts rights or randomly generated passwords. This
includes: daemon, bin, sys, sync, games, man, lp,
mail, news, uucp, proxy, www-data backup list, irc,
gnats, nobody, libuuid, syslog, messagebus,
haldaemon, hplip, avahi, couchdb, kernoops, saned,
pulse, gdm, sshd, telnetd, dhcp, avahi-autoipd,
speech-dispatcher.
Recombine known, imported, and Takes all the usernames:passwords from the known
additional credentials credentials list, imported list, and credentials text box,
and assigns all the passwords to all users.
67
Enabling Credential Generation Switches
You can use credential mutation switches to mutate known and imported credentials to detect
common password variations during a bruteforce attack.
Credential Mutation Switch Description
Mutate known credentials Determines the portion of the credential list subjected to
mutations – in this case, all known credentials.
Mutate additional credentials Determines the portion of the credential list subjected to
mutations – in this case, all credentials manually added
by the user.
Mutate imported credentials Determines the portion of the credential list subjected to
mutations – in this case, all imported credentials.
Mutation: append numbers to Strips off all trailing digits off a password and replaces it
candidate passwords with a single digit and skips all passwords that do not
contain a letter.
Mutation: prepend numbers to Strips off all digits at the beginning of a password and
candidate passwords replaces it with a single digit and skips all passwords that
do not contain a letter.
Mutation: substitute numbers Strips off up to two digits within a password and replaces
within candidate passwords it with up to two digits. Passwords with more than three
digits are ignored.
Mutation: transpose letters for Rotates through a number of alpha to numeric
“i33t-sp34k” alternatives in substitutions before substituting all of them.
candidate passwords
Mutation: append special Appends a punctuation mark to the beginning of a
characters to candidate password or replaces an existing punctuation mark.
passwords
68
Credential Mutation Switch Description
Modules
A module is the component that Metasploit Express uses to perform an attack or a specific
action. The attack or action that the module performs depends on the module type.
Module Types
The Metasploit Framework categorizes modules based on the action that the module
performs.
Exploit - A module that targets and exploits the vulnerabilities that the vulnerability
scanners discover.
Auxiliary - A module that performs tasks other than exploitation, such as fuzzing and
scanning.
Post-Exploitation - A module that runs after Metasploit Express compromises a target
system.
Excluded Modules
Most modules that are available in the Metasploit Framework are available in Metasploit
Express. However, some modules may be excluded if their dependencies are unavailable.
Modules that are currently excluded are modules that depend on the following libraries:
69
Libpcap - Affects modules that target sniffers.
DECT - Affects modules that target telephony.
Module Search
The module search engine searches the module database for the keyword expression and
returns a list of results that match the query. Use the module search engine to find the module
that you want to run against a target system.
Keyword Tags
Keyword Tag Description
name Searches for the keyword expression within the module descriptive
name.
path Searches for the keyword expression within module path name.
platform Searches for the modules that affect the platform or target that you
define in the keyword expression.
type Searches for the modules that belong to the module type that you
define in the keyword expression. For example, use exploit, auxiliary, or
post.
app Searches for modules that are either a client or server attack.
author Searches for modules by author.
cve Searches for modules by CVE ID.
bid Search for modules by Bugtraq ID.
osvdb Search for modules by OSVDB ID.
Key Tag KeyWord Expression Example
name name:Java
70
Key Tag KeyWord Expression Example
path path:windows/smb
platform platform:linux
type type:exploit
app app:client
author author:todb
cve cve:2009
bid bid:10078
osvdb osvdb:875
Module Statistics
Module statistics show the total number of modules that are available and show the number of
modules that are available for each type of module. Module types include exploit modules,
auxiliary modules, server-side exploits, and client-side exploits.
71
IPv6 Payloads
The following table describes the IPv6 payloads that are available for Windows, Linux, BSD,
Shell, and PHP targets. If the IPv6 payload successfully executes on the target machine, then
a session opens on the target machine.
IPv6 Target Payloads
Exploits
An exploit executes a sequence of commands to target a specific vulnerability found in a
system or application. An exploit takes advantage of a vulnerability to provide the attacker with
access to the target system. Exploits include buffer overflow, code injection, and web
application exploits.
Metasploit Express offers automated exploits and manual exploits. The type of exploit that you
use depends on the level of granular control you want over the exploits.
Automated Exploits
An automated exploit uses reverse connect or bind listener payloads and do not abuse normal
authenticated control mechanisms. Automated exploits cross reference open ports, imported
vulnerabilities, and fingerprint information with exploit modules.
72
When you run an automated exploit, Metasploit Express builds an attack plan based on the
service, operating system, and vulnerability information that it has for the target system.
Metasploit Express obtains this information from the discovery scan or from the information
that you provide for the target host. The attack plan defines the exploit modules that
Metasploit Express will use to attack the target systems.
To run an automated exploit, you must specify the hosts that you want to exploit and the
minimum reliability setting that Metasploit Express should use. The minimum reliability setting
indicates the potential impact that the exploits have on the target system. If you use a high
ranking, such as excellent or great, Metasploit Express uses exploits that will be unlikely to
crash the service or system. Exploits that typically have a high reliability ranking include SQL
injection exploits, web application exploits, and command execution exploits. Exploits that
corrupt memory will most likely not have a high reliability ranking.
You can also specify the payload type that you want the exploit to use. By default, automated
exploits use Meterpreter, but you can choose to use a command shell instead.
The following table describes the options that are available for automated exploits:
Option Description
Minimum Reliability: Low Exploits fail more than 50% of the time for common
platforms.
Minimum Reliability: Average Exploits are difficult to reliably leverage against some
systems.
Minimum Reliability: Normal Exploits are reliable, but depend on a specific version.
Exploits cannot consistently auto-detect.
Minimum Reliability: Good Exploits have a default target and are common to specific
types of software.
Minimum Reliability: Great Exploits have a default target. Exploits can auto-detect the
appropriate target or use an application specific return
address after it runs a version check. Exploits can crash
the target, but are the most likely to succeed.
Minimum Reliability: Excellent Exploits never crash the service. Exploits include SQL
injection, CMD execution, and certain weak
configurations. Most web application flaws belong to this
category.
Ignore known fragile devices Bypasses known fragile devices.
Payload Type Defines whether the exploit executes a Meterpreter or
command shell payload.
Connection Type Defines the payload connection type.
73
Option Description
Listener Ports Defines the range of ports that reverse bind payloads use.
Listener Host Defines the IP address that the payload uses to connect
back. Use this option when the address needs to be
overridden, such as NAT or Amazon Elastic IPs.
Auto Launch Macro Defines the macro that the exploit runs.
Included Ports Defines the ports to include in the exploit selection.
Excluded Ports Defines the ports to exclude in the exploit selection.
Skip exploits that do not Bypasses exploits that do not apply to the target OS.
match the host OS
Match exploits based on open Uses port information to match exploits.
ports
Match exploits based on Uses the vulnerability reference information to match
vulnerability references exploits.
Concurrent Exploits Defines the number of simultaneous exploit attempts that
the system runs. The best number varies based upon
available CPU horsepower. If you utilize one concurrent
attempt, you can debug issues with the task log if you
encounter any issues.
Time out in Minutes Defines the number of minutes that the system waits for a
given exploit. The default setting ensures that all exploits
have sufficient time to complete, but you may need to
increase this setting if target hosts are slow.
Transport Evasion This option enables you to send small TCP packets and
insert delays between them.
74
Option Description
DCERPC
Low – Adds fake UUIDs before and after the actual UUID
that the exploit targets.
High – Sets the maximum fragmentation size of DCERPC
calls to a value between 4 and 64.
SMB
Obtain one session per target Opens one session per target and bypasses any targets
that have a session open.
Dry run Performs a dry run on the exploit, which provides you with
details of the exploit, but does not run the exploit.
75
4.) Click Exploit. The New Automated Exploitation Attempt window appears.
5.) Verify that target address field contains the addresses that you want to exploit.
6.) Select the minimum reliability for the exploit.
7.) Click Show Advanced Options.
8.) Define the target hosts that you want to include or exclude from the exploit.
9.) Define the payload options. This determines the type of payload the exploit uses, the type
of connection the payload creates, and the listener ports that the exploit uses.
10.) Define the exploit selection options. This determines the ports that the exploit includes
and excludes from the attack.
11.) Define the advanced options. The advanced options lets you define the number of
exploits you can run concurrently, the time out for each exploit, and evasion options.
12.) Run the exploit.
Manual Exploits
A manual exploit is a module that you can select and run individually. You perform a manual
exploit when you want to exploit a known vulnerability.
You choose the exploit module based on the information you have about the host. For
example, if you know that the host runs Windows Service Pack 1, you can run an exploit that
targets Windows Service Pack 1 vulnerabilities. Or if you know that the target system has a
specific vulnerability that you want to test, you can run the exploit that targets that particular
weakness.
Manual exploitation provides granular control over the module and evasion options that an
exploit uses. Whereas automated exploits enable you to run simultaneously multiple exploits,
manual exploits enable you to run one exploit at a time.
The options and instructions that you perform for manual exploits vary based on the exploit
that you choose to run. Therefore, use the following instructions as a guideline to manually run
exploits.
76
Running a Manual Exploit
Post-Exploitation
After you gain access to a target system, you can run scripts through the command shell or
run post-exploitation modules to take control of the system.
Post-Exploitation Modules
A post-exploitation module provides a standardized interface that you can use to perform
post-exploit attacks. The post-exploitation phase enables you to collect further information
about a target system and to gain further access to the network. During the post-exploitation
phase, you can identify things like additional subnets, routers, server names, network
services, and installed applications.
After you obtain a session on the target system, you can view the post-exploitation modules
that are applicable for that session.
77
appears.
6.) Select the module options you wan to use.
7.) Define the advanced options for the module.
8.) Run the module.
After you gain access to a virtual target, you can utilize post-exploitation modules to interact
with the virtual machines. The post-exploitation modules that are available for virtual
machines enable you to log into VMware and terminate user sessions and enumerate
VirtualBox machines on the target machine.
The following are post-exploitation modules that you can use for virtual machines:
post/multi/gather/find_vmx
post/multi/gather/enum_vbox
Post-Exploitation Macros
A post-exploitation macro is a set of predefined actions that deploy when Metasploit Express
obtains an active session. The session can be an existing session or a session that a task
creates, like a campaign task. You can use a post-exploitation macro to automate the events
that occur after Metasploit Express opens a session on a target system.
A post-exploitation macro automatically runs after a target system runs an exploits and
connects the post-exploitation macro to a listener. Therefore, before you can execute a post-
exploitation macro, you must create a listener and assign the listener to the post-exploitation
macro.
To create a listener, you can define a global listener, or you can assign a macro to a
campaign. If you create a macro through a campaign, the campaign automatically creates a
listener and connects the macro to the listener.
You can manage post-exploitation macros and persistent listeners from the global settings
area of the project.
78
5.) Enter a description for the post-exploitation macro.
6.) Enter a time limit, in seconds, for the post-exploitation macro.
7.) Save the post-exploitation macro. After you save the post-exploitation macro, a list of
available actions displays.
8.) Search through the list of modules and find the module that you want to add to the post-
exploitation macro.
9.) Add the module. The Module Configuration window appears.
10.) Configure the options for the module. Options vary between modules. Refer to the in-
product help for descriptions of the options.
11.) Repeat the previous step for each module that you want to add to the post-exploitation
macro. Add the modules in the order in which you want the modules to execute.
Listeners
After an exploit successfully compromises a target system, Metasploit Express uses a listener
to wait for an incoming connection from the exploited system. The listener is the component
that handles persistent agents from exploited systems.
When you create a listener, you associate the listener to a specific project. Therefore, when
an exploited target makes a connection with the listener, you see an active session open in
the project.
Note: You can create global listeners that you can use across multiple projects. However,
only one project can use the listener at a time.
You assign a post-exploitation macro to each listener. When the exploited system makes a
connection with the attacking system, Metasploit Express launches the post-exploitation
macro. Listeners stop after you delete a project or you manually stop a listener.
Creating a Listener
When you create a listener, Metasploit Express uses the listener address and port to assign a
listener name. For example, if the listener address is 10.10.10.1, and the port is 47385, then
the port name is 10:10:10:1:47835.
79
Note: Metasploit Express supports IPv4 and IPv6 addresses.
7.) Enter a port for the listener.
8.) Choose a post-exploitation macro to deploy after the listener connects to the target
system.
9.) Enable the listener.
10.) Save the listener.
Stopping a Listener
To stop a listener, you can either delete the listener from the system or you can stop the
listener from the Task screen.
80
TAKING CONTROL OF A
SESSION
This chapter covers the following sections:
Active Sessions 81
Session Tasks 83
Session Overview
An active session provides a connection between the target system and the attacker.
Metasploit Express opens an active session if it can gain access to the host and run a
successful attack. After you gain obtain an active session, you can use the active session to
take control of the target system.
Active Sessions
Metasploit Express opens an active session on a target system if an exploit or bruteforce
attack is successful. An active session enables you to interact with and run tasks against the
compromised host.
A session can be a Meterpreter or command shell session. The type of session that Metasploit
Express opens depends on the type of attack that the system used to obtain the session.
The session type depends on the mechanism that the attacker uses to create the session and
the type of environment on which the session runs. To determine a the session type, open the
Sessions window and view the Type column. The Type column lists each session for the
session appears.
An active session enables you to take control of the session to perform tasks within the target
system.
A command shell session runs a collection of scripts and provides a shell that you can use to
run arbitrary commands against the host.
81
Metasploit Express opens a command shell session when the following events occur:
The command shell functions as a terminal emulator. You can use the command shell to run
any non-interactive process on the target host.
Meterpreter Session
A Meterpreter session enables you to use VNC to gain access to the device and enables you
to use a built-in file browser to upload or download sensitive information.
Metasploit Express opens a Meterpreter session when the following events occur:
Before you can interact with a Meterpreter session, you must have an active session on a
compromised Windows target.
82
Authentication Notes
All successful authentication results in an authentication note attached to the host and an
entry in the corresponding reports. Some protocols and servers do not allow you to execute
commands directly. For example, you can utilize FTP to bruteforce credentials, but after the
attack finds a valid credential, you cannot run commands directly on the server. Therefore, the
attacker cannot obtain a session.
When a case like this occurs during a bruteforce attack or an exploit, an alert appears on the
Analysis tab that indicates that the system identified a valid account, but could not create a
session. If the system identifies new credential information for a particular host, you can use
the credentials to authenticate the host outside Metasploit Express.
Session Tasks
A session task is an action that you can perform within the active session. For example, an
action enables you to collect evidence, access the file system, run a command shell, and
create a pivot through the compromised host.
To view the tasks that are available for a session, you must view the session details.
Session Details
The session details describe information about a particular session, such as the session type
and attack module that Metasploit Express used to obtain the session. Additionally, when you
view the session details for an active session, you can access the actions that available for
that session.
The session details for a closed session describe the event history for the session.
83
3.) Click on an active session name. The session details appear and show the actions that
are available for the session.
Proxy Pivot
A proxy pivot send attacks through the remote host and uses the remote host as a gateway
over TCP/UDP. When a proxy pivot is active, discovery scans, bruteforce, and exploitation
tasks source from the pivoted host.
Note: Metasploit Express does not support IPv6 addresses for pivoting.
VPN Pivot
A VPN pivot creates a type of VPN tunnel to an exploited Windows host and turns the host
into a pivot point for traffic. To create a VPN pivot, Metasploit Express creates a a hook at the
kernel level of the target system. The hook does not create an interface on the remote system
and acts as a sniffer to return all traffic that Metasploit Express initiates.
When Metasploit Express creates a VPN Pivot, the VPN Pivot appears as a local interface,
which enables you to use IP forwarding and use the interface as a gateway to the target
network.
However, Metasploit Express cannot create a bridge to a network that it is already attached to
because it creates a conflicting route for the target network system. Therefore, you must verify
that Metasploit Express does not have an existing direct connection to any networks that have
the same IP range and netmask as the target network.
Note: Metasploit Express does not support IPv6 addresses for pivoting.
Virtual Interfaces
In order to provide VPN pivot functionality on the Windows platform, Metasploit Express must
install a new network driver. The driver, msftap.sys, creates four virtual interfaces on the
installed system, which provides the ability to run up to four concurrent VPN Pivot sessions.
84
If Metasploit Express does not locate the virtual interfaces when MetasploitProSvc starts,
Metasploit Express automatically installs the network drivers. To reinstall or uninstall these
drivers, you can use one of the batch scripts that are available. You can locate the batch
scripts at: $INSTALLROOT\apps\pro\data\drivers\<arch>\. You can use the scripts to
disable the VPN Pivot virtual interfaces or restore a previously removed driver.
VNC Sessions
You can use an active Meterpreter session to obtain a VNC session with the compromised
system. You can either connect to the remote desktop manually or use the VNC client that is
available through Metasploit Express.
The VNC client is a Java applet that you can use to remote desktop to the target system.
Before you use the Java applet, install the latest Java for your platform. You can download the
latest version of Java at http://www.java.com/en/download/manual.jsp. If you do not want to
use the Java applet, you can use an external client, such as VNC Viewer.
File Systems
For Meterpreter sessions, you can use the Metasploit Express interface to browse the file
system on the compromised system. Additionally, you can upload, download, or delete files.
85
Accessing the File System
86
EVIDENCE COLLECTION
This chapter covers the following topics:
Collecting Evidence
You can collect system data for an active session.
87
13.) Collect the system data.
Password Cracking
Metasploit Express automatically performs offline password cracking when it runs the
collection task. If Metasploit Express finds a hash supported by John the Ripper (JtR) during
the collection process, the password cracker uses the LANMAN and NTLM formats to attempt
to crack the password. Metasploit Express tries to crack the word list using a combination of
rules and incremental modes in both LANMAN and NTLM formats. Metasploit Express parses
any cracked passwords and adds the password to the word list.
Collected Evidence
Evidence is information that Metasploit Express collects about a target system.
88
4.) Click the Stored Data & Files tab.
5.) Scroll through the list to view the stored data or download the evidence.
Session Clean Up
When you need to close an active session, you perform a session clean up. A session clean
up retrieves evidence from the session and closes the session.
After you close a session, the session appears under the Closed Sessions list. You can view
the session event history, but you can no longer interact with the session.
Cleaning Up a Session
89
REPORTS
This chapter covers the following topics:
Reports Overview 90
Standard Reports 90
Replay Scripts 92
Reports Overview
A report provides detailed information and results for the penetration test. Use reports to
perform an analysis of the target network and to provide valuable information to help solve
and mitigate security vulnerabilities.
A report contains the information that you obtain during a penetration test. Reports help you
identify vulnerabilities in a target network and help you to pinpoint how an organization can
strengthen their security infrastructure.
You can generate and export a report in PDF, Word, RTF, and HTML.
Standard Reports
A standard report provides default report formats that you can use to generate a report.
Audit reports – Combines the high-level results from the other reports and presents them in
a single comprehensive report.
Compromised reports – Lists all hosts on which Metasploit Express was able to open a
session, successfully run a module, or record a vulnerability.
Authentication token reports – Lists all cracked hosts and includes all cracked passwords,
SMB hashes, and SSH keys discovered.
Services reports – Lists all network services discovered by Metasploit Express.
Collected evidence reports – Lists all looted hosts and includes the files and screen shots
collected from the compromised hosts.
Campaigns reports – Lists all Web Campaigns run as part of the project.
Webapp reports – Lists all websites and the vulnerabilities, forms, and pages associated
with the websites.
90
Generating a Standard Report
Viewing a Report
Downloading a Report
Deleting a Report
91
6.) Click the Report button.
Replay Scripts
A replay script enables you to replay an attack without Metasploit Express. Anyone who has
access to the Metasploit Framework can use a replay script to replay an attack.
92
INDEX host
add 37
management 36
host badge 37
host data 34
host notes 35
host services 35
HTTP payloads 16
A HTTPS payloads 16
active session 64
audit reports 73
authentication token reports 73
K
automated exploits 56 keyword expression 53, 54
auxiliary 53 keyword tags 53
B L
bruteforce 11, 39 license key
options 40 revert 17
update 17
license keys 17
C listener 61
campaigns reports 73 create 62
collected evidence reports 73 LM 32
command shell 64 log files 18
compromised reports 73
credential files 47
credential generation switches 50
M
credential mutation switches 51 manual exploits 59
credentials 47 Meterpreter 65
import 49 Meterpreter session 65
module 53
module statistics 55
D modules 11
Dashboard 7 msftap.sys 67
data file formats 33
discovery scan 23
N
network boundaries 19
E network range 20
evidence 70 restrict 20
exploit 53, 55 Nexpose console 30
Nexpose scan 27
Nmap arguments 27
F NTLM 32
file system 68
O
G offline activation file 17
global settings 9, 15
P
H password cracking 71
H.323 27 post-exploitation macro 61
hash 32 post-exploitation module 53
post-exploitation modules 60
project 19
create 21
edit 22
project settings 19
proxy pivot 66
R
replay script 75
report 12, 73
standard 73
S
scan template 28, 29
aggressive discovery 29
discovery 29
DoS Audit 29
exhaustive audit 29
full audit 28
service listeners 4
services reports 73
session 64
details 66
session clean up 72
standard report 73, 74
system updates 17
U
uninstall
Metasploit 19
updates 17
user account 13
delete 14
edit 13
reset 14
V
virtual interfaces 67
VNC 65, 68
VPN pivot 67
vulnerability 35
delete 36
edit 36
management 35
W
webapp reports 73
word list 49