Expert · Deeper lab skills: passwords, privilege, Metasploit, wireless · topic 27 of 35 · 18 min
Metasploit basics (in the lab)
Explanation
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
| Term | Meaning |
|---|---|
| Module | A unit that does one thing (an exploit, a scanner, etc.) |
| Exploit | A module that uses a specific vulnerability |
| Payload | What runs on the target after a successful exploit |
| Options | Settings like RHOSTS (target) and LPORT you must fill in |
| msfconsole | The 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.
# 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 targetDetection 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 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)
Metasploit is…
In Metasploit, a "payload" is…
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
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Wireless security conceptsDeeper lab skills: passwords, privilege, Metasploit, wireless · same module
- Password hashing and cracking (your own hashes only)Deeper lab skills: passwords, privilege, Metasploit, wireless · same module
- Vulnerable targets: Metasploitable, DVWA and Juice ShopYour legal practice lab
- Intrusion detection and prevention (IDS/IPS)Cyber Security: from zero to SOC analyst · Identity and network defence
- SQL injection (SQLi)Web attacks and their fixes
- Cross-site scripting (XSS)Web attacks and their fixes
Questions people ask about this
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.
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.
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.
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 more topic in “Deeper lab skills: passwords, privilege, Metasploit, wireless” before its exam: Wireless security concepts.
- Module 8 exam: deeper lab skills · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Post-exploitation ethics and reporting. 35 topics left in the course before the final exam.