Overview of Metasploit Framework

Aug 4, 2024

Lecture on Metasploit

Introduction

  • Metasploit is widely used by Information Security Professionals and hackers.
  • The lecture will cover basics to advanced techniques of Metasploit.
  • Created by HD Moore in October 2003.
  • First Perl-based version released in April 2004 with 11 exploits.
  • Rapid7 acquired Metasploit in 2009, releasing Metasploit Express and Pro.

What is Metasploit?

  • A powerful framework for developing, testing, and executing exploits against software vulnerabilities.
  • Crucial tool for hackers, penetration testers, and security professionals.
  • Comprises tools, libraries, modules, and user interfaces.
  • Functions as a module launcher for configuring and deploying exploit modules.
  • Offers hundreds of exploits and numerous payload options.

Installation

  • Easy to install, especially on Linux distributions like Kali Linux.
  • Open terminal and type msfconsole to launch Metasploit.
  • Other ways to access Metasploit: msfgui, msfcli, msfweb, Metasploit Pro, and Armitage.

Metasploit Directory Structure

  • Key Directories: data, external, tools, plugins, and scripts.
  • Data Directory: Contains helper modules like Meterpreter exploits, wordlists, and templates.
    • Meterpreter Directory: Contains staged payloads, executables, server components, and Python scripts.
    • Wordlists Directory: Lists of usernames and passwords for different services.
    • Exploits Directory: Files and directories related to different security exploits, often with CVE identifiers.
  • Modules Directory: Holds various functionalities.
    • Exploit Modules: Categorized by operating systems and services (e.g., Windows, FTP).
    • Auxiliary Modules: Exploits without payloads for tasks like port scanning and service scanning.
    • Payloads Directory: Contains singles, stagers, adapters, and stages.

Basic Exploitation

  • Exploitation: Breaking into computer systems by taking advantage of vulnerabilities.
    • Steps: Scanning IP addresses, finding open ports, identifying weak spots, and using exploits.
  • Metasploit Exploitation Example: Powershell Payload
    • Generate payload with msfvenom.
    • Set up a listener with Metasploit using the multi-handler module.
    • Execute the payload on the target machine.

Meterpreter Basics

  • A powerful post-exploitation tool in Metasploit.
  • Injects code into a running process in memory.
  • Allows for actions like acquiring password hashes, running keyloggers, escalating privileges, and more.
    • Commands: sysinfo, screenshot, ps, keyscan_start, keyscan_dump, keyscan_stop, among others.

Information Gathering

  • Involves footprinting and scanning.
  • Footprinting: Collecting data about a target (e.g., domain names, public IP addresses).
  • Scanning: Identifying vulnerabilities.
    • Example: whois for domain information.
  • Email Harvesting: Using Metasploit's auxiliary module search_email_collector.
  • Telnet Version Scanning: Using auxiliary/scanner/telnet/telnet_version module.
  • Telnet: A network protocol for remote communication, but insecure.

Conclusion

  • Metasploit is a versatile tool for penetration testing and security assessments.
  • Recommended resources: Metasploit GitHub page and specific scanning tools.
  • Encourage further exploration and practice to enhance skills.