Ravindra BagaleCourses & study guides

23. Exploitation with Metasploit

23.1 What Metasploit Is

In short: Metasploit Framework is a free, open-source collection of exploits, payloads and tools that fit together.

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 confuse exploit and payload. A simple rule: exploit = the way in, payload = what to do once you are in. The same exploit can be used with different payloads. Interviewers almost always ask about this difference.

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.