Getting Started with Metasploit in Kali

CybersecurityBeginner
Practice Now

Introduction

Metasploit is a framework with many kinds of modules, including tools for basic information gathering. Understanding how to discover, inspect, configure, and run a module is useful before considering more advanced work.

You will use its interactive console to inspect a local HTTP title module and collect the response of a dedicated training page. This lab does not attempt exploitation or create a remote shell.

Explore an Auxiliary Module in the Console

In this step, you will start Metasploit, discover an information-gathering module, and inspect its required settings.

Enter Kali and select the shared workspace:

kali
cd /home/labex/project

Metasploit organizes functionality into modules. An auxiliary module can gather information without exploiting a vulnerability or opening a remote shell. This lab uses the HTTP title scanner against a dedicated local page.

Start the console. -q reduces the startup banner:

msfconsole -q

Startup can take a little time. When ready, the console displays a prompt such as msf > (some versions include a version number). You are now inside Metasploit rather than the Bash shell. The following commands go into that console; do not prefix them with the prompt.

spool records console output to a file. Start a record of your module inspection:

spool /home/labex/project/module-notes.txt

search finds modules. The type:auxiliary filter limits results to auxiliary modules; name:title looks for a title-related name:

search type:auxiliary name:title

Look for auxiliary/scanner/http/title. Use info with that full path to read its description:

info auxiliary/scanner/http/title

The description explains that this module requests web pages and collects information including the HTML title. It is not a proof of exploitation.

use selects a module:

use auxiliary/scanner/http/title

The prompt now includes the selected module. Inspect its settings before running it:

show options

Look for RHOSTS (target address or addresses) and RPORT (target service port). Other options may have defaults. This exercise uses one local target and ordinary HTTP.

Close the inspection record while staying in the selected module:

spool off

Keep the console open for the next step. The saved metadata captures what the module does and which target settings it expects.

Configure, Run, and Review the Local Title Scan

In this step, you will run the selected auxiliary module against the supplied training web page and preserve its actual findings.

Stay in the Metasploit console with the HTTP title module selected. Start a separate record for the assessment result:

spool /home/labex/project/msf-results.txt

set assigns a module option. The authorized target address is 127.0.0.1; its training web port is 8085:

set RHOSTS 127.0.0.1
set RPORT 8085

Each command should echo the setting you assigned. Execute the selected module:

run

The result should identify the local HTTP endpoint, a successful 200 response, and the page title Kali Guided Console. A title is useful service information; it does not establish that the page is vulnerable. The task is complete when this actual response is observed, not when a console merely starts.

back returns from module context to the main console:

back

Finish recording before leaving the console:

spool off
exit

You should return to the Kali Bash prompt. Inspect the recorded findings with a shell command:

cat /home/labex/project/msf-results.txt

The saved record should retain the actual target, response status, and title. No exploit module, payload listener, Meterpreter session, or database configuration is needed for this information-gathering task.

Summary

You used the interactive Metasploit console to search for, inspect, select, configure, and run an auxiliary module. You recorded actual HTTP information and distinguished a successful information-gathering result from a vulnerability or exploitation claim.