Metasploitable Framework Testing
The Metasploit Framework is an open-source security testing platform used to identify, validate, and understand security vulnerabilities in computer systems. Rather than being a single "hacking tool," Metasploit is a modular framework that organizes offensive security techniques into structured components with clear rules and workflows. Metasploit is designed to help us learn how attacks work, reproduce vulnerabilities in a controlled environment, and assess the effectiveness of security controls.
How Metasploit Is Structured
Metasploit is built around modules, each with a specific role:
-
Auxiliary Module
Used for scanning, enumeration, and information gathering. This module does not exploit the system and is typically used first to understand the target's vulnerabilities. This is the recommended starting point for beginners.
-
Exploit Module
Used to exploit known vulnerabilities in software or systems. This module attempts to gain unauthorized access and should only be used in authorized environments.
-
Payload
Code that runs after successful exploitation. The payload defines what happens after access is gained, such as opening a command shell or establishing a remote session.
-
Post-exploitation module
Used after access is gained to gather additional information, maintain access, or analyze the compromised system.
-
Encoder and evasion module
Advanced components used to modify the payload or evade detection. These are typically explored in later learning stages.
The Metasploit framework does not work simply by executing commands in the terminal. Each module follows a structured process:
- Select the appropriate module
- Review its configuration options
- Set the required parameters
- Execute the module
Steps
-
Install the Metasploitable Framework on Linux
Curl https://raw.githubusercontent.com/rapid7/metasploit omnibus/master/config/templates/metasploit-framework wrappers/msfupdate.erb > msfinstall && chmod 755 msfininstall && ./msfinstall
-
Run Metasploitable
msfconsole
-
Metasploit Testing
Metasploit can be tested in several ways
a) TCP Port Scanning
We will test by scanning the local host
-
use auxiliary/scanner/portscan/tcp
-
show options
-
set RHOSTS 127.0.0.1
-
set PORTS 22,80,443
-
run
b) HTTP Enumeration
HTTP enumeration refers to the process of gathering information from a web server, such as the server type, accessible directories, and exposed resources, without exploiting vulnerabilities. In newer versions of Metasploit, this functionality is implemented through several dedicated auxiliary modules, rather than a single enumeration module. For this example, I will identify the web server.
-
use auxiliary/scanner/http/http_version
-
show options
-
set RHOSTS 127.0.0.1
-
set RPORT 80
-
run
The identification results indicate that the server is using Apache version 2.4.65 on a Debian-based operating system. This information is obtained through a standard HTTP response.
-