Skip to content

Expert · Deeper lab skills: passwords, privilege, Metasploit, wireless · topic 27 of 35 · 18 min

Metasploit basics (in the lab)

Explanation

Metasploit is a framework that organises known exploits and payloads so testers can safely verify a vulnerability. You learn what it is and its main parts — modules, options, payloads — and use it only against your own lab targets like Metasploitable, with the defence in mind.

What Metasploit is

The Metasploit Framework is a free, open-source toolkit that collects many known exploits in one place, with a consistent way to configure and run them. Instead of writing exploit code from scratch, a tester can select a module for a known issue, set a few options, and verify whether a target is vulnerable. It is used to prove and demonstrate findings, carefully, on authorised targets.

The main ideas

TermMeaning
ModuleA unit that does one thing (an exploit, a scanner, etc.)
ExploitA module that uses a specific vulnerability
PayloadWhat runs on the target after a successful exploit
OptionsSettings like RHOSTS (target) and LPORT you must fill in
msfconsoleThe command interface for the framework

A typical lab flow is: search for a module that matches a vulnerability you found, use it, set the target (RHOSTS) and other options, check them, and run it against your Metasploitable VM. The point is to confirm a finding you can then report with its fix — not to cause damage.

bash
# Inside msfconsole, against your own Metasploitable VM only:
search type:exploit name:vsftpd     # find a matching module
use <module path shown by search>   # select it
set RHOSTS 192.168.56.102           # your lab target
show options                        # check what still needs setting
# run only against your authorised lab target
The shape of a Metasploit session. Real module names change; always verify in your own lab.
Careful: Metasploit is powerful and can disrupt or damage a target. Use it only against machines you own or are explicitly authorised to test, and read what a module does before running it. Running exploits against systems without permission is a serious crime. On real engagements, exploitation must be inside the rules of engagement.

Detection and defence

Detection: many Metasploit exploits and payloads have known signatures that intrusion detection systems and endpoint protection recognise, and they create unusual network connections a SIEM can flag. Defence: patch the vulnerabilities the modules target (the single most effective step), run endpoint protection and IDS/IPS, segment the network, and monitor for the connections a payload makes. If there is no unpatched vulnerability, the matching exploit simply fails.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Metasploit basics (in the lab) · 1/7

Metasploit = exploit framework

Metasploit is a free framework that organises known exploits.

Prefer a video by a teacher? Find free videos on “metasploit framework basics msfconsole beginners lab” on YouTube ↗

In real life: Proving a finding safely

A learner scanned Metasploitable and found an old, vulnerable service. In his lab he uses the matching Metasploit module to confirm the service really is exploitable, getting a limited shell on his own VM. He takes a screenshot as evidence, then writes the report: the vulnerable version, proof it is exploitable, and the fix (patch or remove the service). He notes the defence too: IDS would likely have flagged the payload, and patching would have made the exploit fail.

Practice (0/3 done)

Task 1 · Question

Metasploit is…

Task 2 · Question

In Metasploit, a "payload" is…

Task 3 · Practice

Write a short, safe note on how you would use Metasploit to confirm a finding in your lab, and the defences you would list in the report.

Quick quiz

Question 1

1.The Metasploit command interface is…

Question 2

2.The single most effective defence against a Metasploit exploit is…

Question 3

3.You may run Metasploit exploits against…

Question 4

4.IDS/endpoint tools often catch Metasploit because…

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

The Metasploit command interface is…

Answer: msfconsole

msfconsole drives the framework.

The single most effective defence against a Metasploit exploit is…

Answer: Patching the vulnerability it targets

With no unpatched flaw, the matching exploit fails.

You may run Metasploit exploits against…

Answer: Only machines you own or are authorised to test

Exploitation requires authorisation.

IDS/endpoint tools often catch Metasploit because…

Answer: Many modules and payloads have known signatures

Known signatures and unusual connections are detectable.

To read a tool's manual you type…Related

Answer: man toolname

man toolname (or toolname --help) shows how a command works.

From Kali Linux: the attacker machine

The best defence a scanner points to is…Related

Answer: Patching and fixing the issues it reports

Run your own scans and fix what they find.

From Vulnerability scanners: OpenVAS and Nessus (concepts)

Metasploitable is most useful for practising…Related

Answer: Scanning, enumeration and service exploits

It is a Linux VM full of weak network services to scan and exploit in your lab.

From Vulnerable targets: Metasploitable, DVWA and Juice Shop

Signature-based detection is weakest against…Related

Answer: Brand-new attacks with no signature yet

It only knows patterns someone has already written.

From Intrusion detection and prevention (IDS/IPS)

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 1 more topic in “Deeper lab skills: passwords, privilege, Metasploit, wireless” before its exam: Wireless security concepts.
  2. Module 8 exam: deeper lab skills · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Post-exploitation ethics and reporting. 35 topics left in the course before the final exam.

← Previous: Privilege escalation concepts (labs only)