Skip to content

How to Fix Metasploit Module Not Found

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Metasploit Module Not Found. We cover key concepts, practical examples, and best practices.

msfconsole says "Module not found" when you try to use an exploit. The module cache is outdated, the module path is wrong, or the exploit does not exist in your version.

The Wrong Way

# Typing a path that does not exist
use exploit/windows/smb/ms17_010_eternalblue_kscaner

The module path is slightly wrong or the module was renamed.

The Right Way

Step 1: Search for the module

msf6 > search eternalblue
# Matching Modules
#   0  exploit/windows/smb/ms17_010_eternalblue
#   1  auxiliary/scanner/smb/smb_ms17_010

Use search to find the exact module name.

Step 2: Update the module database

msf6 > db_rebuild_cache
# This rebuilds the module cache from disk
# Takes 1-2 minutes

Step 3: Update Metasploit framework

# If the module is still not found:
msfupdate
# This pulls the latest modules from the Metasploit repository

Step 4: Add custom module paths

# For custom/private modules:
# Edit ~/.msf4/config or set in msfconsole:
msf6 > setg MODULE_PATH /path/to/custom/modules

# Or create the directory:
mkdir -p ~/.msf4/modules/exploits/my_tool
# Copy your custom module there
# Run: db_rebuild_cache
Module exploit/windows/smb/ms17_010_eternalblue found and loaded — 2 compatible targets.

Prevention

  • Run msfupdate weekly to keep the module database current.
  • Use search to find module paths instead of guessing.
  • The module loading mechanism is similar to Doda Browser's extension registry — misspelled names are the most common "not found" cause.

Common Mistakes with module not found

  1. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  2. Using head and tail instead of pattern matching, causing runtime errors on empty lists
  3. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks

These mistakes appear frequently in real-world METASPLOIT code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### How do I find all modules related to a specific CVE?
msf6 > search cve:2023 cve:2024
# Shows all modules matching the CVE pattern
# Use: search type:exploit cve:2024

This lists every module referencing that CVE identifier in its metadata.

Why did a module disappear after an update?

The module may have been removed due to quality issues, merged into another module, or renamed. Check the Metasploit GitHub repository's commit history for the module name. The module database changelog is available at docs/metasploit-framework.wiki.

Can I write custom Metasploit modules?

Yes. Modules are Ruby files following the Metasploit module structure. Place them in ~/.msf4/modules/ and run db_rebuild_cache. The framework automatically loads them. Custom modules must include proper metadata (name, description, author, references).

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro