Metasploit basics against the lab target
Search modules, set options and run a scanner against your own target.
Roman Urdu: Metasploit mein module dhoondo, options set kro aur apne lab target pe scanner chalao.
Video transcript
Metasploit is the standard framework for testing known vulnerabilities. Think of it as a big, organised toolbox.
Inside are thousands of small modules. Scanners look at a target and report what they see. Exploits use one known weakness. Payloads are what runs after an exploit works. And a database remembers every host and service you find.
Every module works the same way. Search for it. Set its options, like which target and which port. Run it. Then read the result. Learn that loop once, and you can use any module.
Start with scanners, long before any exploit. A scanner can fingerprint a web server: which software it runs, and which version. The version tells you which known weaknesses could apply. That is what you record.
So: search, set, run, read. Scanners first. In the lab, you will fingerprint the web servers on the practice target, and record the results. Only point it at the practice lab, or at systems you are allowed to test.
Rules: Only test systems you own or have written permission to test. Everything in this track runs against practice targets inside your own machine. Scanning or attacking anyone else’s system without permission is a crime in most countries.
Goal
Use Metasploit to fingerprint the web servers on target.lab and save the results.
Why it matters
Metasploit is the standard framework for testing known vulnerabilities. Its scanners are useful long before any exploit.
Your machine · learn-cyber · lab cyber-07
A terminal on your own cyber machine, right in this page. It keeps your files between lessons.
First time: make your course machine from any terminal (Mac, Linux and Windows 10+ all have ssh). Your ssh key is your login; a new key picks a handle and accepts the terms first.
$ ssh -t -p 2200 m.logicpacks.io new cyber --name learn-cyberAfter that, come back to the same machine any time. Your files are still there:
$ ssh -t -p 2200 learn-cyber@m.logicpacks.ioTo use the terminal in this page, sign this browser in once: run this and open the link it prints.
$ ssh -p 2200 m.logicpacks.io webAll your machines in the browser: logicpacks.io/m. A guest key gets one machine: if you already use it for something else, rm that one or link a free account (3 machines). How machines work, credits and terms: logicpacks.io/machines
Step by step
Start the practice targets (about 20 seconds; Juice Shop is the slowest).
$ lab start$ lab statusEvery module works the same way: search, set options, run, read. Start Metasploit. The very first launch sets itself up and can take up to about 5 minutes on a small machine; let it finish. After that it starts much faster.
$ msfconsole -qInside msfconsole: find and load the HTTP version scanner, point it at the target and run it. Then type exit.
$ search type:auxiliary http_version$ use auxiliary/scanner/http/http_version$ set RHOSTS target.lab$ set RPORT 80$ runThe same in one line, saved for your report. Try RPORT 3000 too.
$ mkdir -p ~/scans && msfconsole -q -x "use auxiliary/scanner/http/http_version; set RHOSTS target.lab; set RPORT 80; run; set RPORT 3000; run; exit" | tee ~/scans/msf-http.txt
Check my work
Run this in your machine. It checks your work and prints PASS, or FAIL with a hint about what is missing.
$ lab check cyber-07