How to Fix Metasploit Module Not Found
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
msfupdateweekly to keep the module database current. - Use
searchto 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
- Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists - 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
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro