Metasploit

Metasploit Framework is a widely used penetration testing tool for discovering and exploiting known vulnerabilities in target systems. Its main interface, msfconsole, allows users to search for exploit modules, configure attack parameters, and manage active sessions after a successful exploit.

Core & Navigation

Command
help
Description

Displays the list of available commands.

Command
banner
Description

Displays the Metasploit banner.

Command
history
Description

Shows previously executed commands.

Command
back
Description

Returns to the main console from the current module.

Command
exit
Description

Exits the console.

Module Discovery

Command
search
Description

Searches for modules by name or keyword.

Command
use
Description

Selects a module to work with.

Command
info
Description

Displays details, author, and requirements of the selected module.

Command
show <type>
Description

Displays modules of a given type (e.g. show options, show payloads, show targets).

Configuration

Command
set
Description

Sets a value for a parameter (e.g. set RHOSTS 192.168.1.10).

Command
unset
Description

Removes a previously set value.

Command
check
Description

Tests whether the target is vulnerable, without launching the exploit.

Common Parameters

Command
RHOSTS
Description

The target system's IP address.

Command
RPORT
Description

The target port number.

Command
LHOST
Description

Your (attacker's) IP address, used for reverse connections.

Command
LPORT
Description

The port you're listening on for incoming connections.

Command
PAYLOAD
Description

The payload (shell type) to be delivered.

Command
TARGET
Description

Selects a specific target variant when the exploit offers multiple system/version options (via show targets).

Execution & Sessions

Command
exploit / run
Description

Launches the configured attack.

Command
handler
Description

Starts a payload handler (listener) as a background job.

Command
kill
Description

Stops a running job.

Command
sessions
Description

Lists active sessions.

Command
sessions -i [id]
Description

Connects to and takes control of a specific session.

Example Usage

Below is a real-world exploitation example using Metasploit — see the full attack walkthrough here.