23. Exploitation with Metasploit
23.1 What Metasploit Is
Metasploit Framework is a free, open-source collection of exploits, payloads and tools that fit together. Instead of writing attack code from scratch, you pick a tested module, set a few options, and run it.
Key words you must know:
| Term | Meaning | Everyday picture |
|---|---|---|
| Exploit | Code that uses a specific vulnerability | The key that fits one lock |
| Payload | What runs on the target after the exploit works | What you do once inside |
| Module | Any single tool in Metasploit (exploit, scanner, etc.) | One tool in the box |
| Listener / handler | Waits for the target to connect back | You waiting by the phone |
| Session | Your live connection to a compromised host | The open line |
| Meterpreter | A powerful in-memory payload with many commands | A remote control inside |
Payload types: a bind payload opens a port on the target and you connect to it; a reverse payload makes the target connect back to you (better, because firewalls usually allow outbound). LHOST/LPORT = your Kali machine; RHOSTS/RPORT = the target.
Ravindra Bagale's Tip
Students exploit aani payload gondhaltat. Sopa niyam: exploit = aat shirnyacha marg, payload = aat gelyavar kay karaycha. Ekach exploit la vegvegle payloads lavta yetat. Interview madhe ha farak nakki vichartat.
Practice task
In your notes, write one line each for exploit, payload, session and Meterpreter. Then explain in one sentence why a reverse payload usually works when a bind payload is blocked.