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 Description
help Displays the list of available commands.
banner Displays the Metasploit banner.
history Shows previously executed commands.
back Returns to the main console from the current module.
exit Exits the console.

Module Discovery

Command Description
search Searches for modules by name or keyword.
use Selects a module to work with.
info Displays details, author, and requirements of the selected module.
show <type> Displays modules of a given type (e.g. show options, show payloads, show targets).

Configuration

Command Description
set Sets a value for a parameter (e.g. set RHOSTS 192.168.1.10).
unset Removes a previously set value.
check Tests whether the target is vulnerable, without launching the exploit.

Common Parameters

Command Description
RHOSTS The target system's IP address.
RPORT The target port number.
LHOST Your (attacker's) IP address, used for reverse connections.
LPORT The port you're listening on for incoming connections.
PAYLOAD The payload (shell type) to be delivered.
TARGET Selects a specific target variant when the exploit offers multiple system/version options (via show targets).

Execution & Sessions

Command Description
exploit / run Launches the configured attack.
handler Starts a payload handler (listener) as a background job.
kill Stops a running job.
sessions Lists active sessions.
sessions -i [id] 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.