1

Any custom metasploit module I create isn't getting loaded.

I tried both of these demos:

https://www.offensive-security.com/metasploit-unleashed/building-module/ https://github.com/rapid7/metasploit-framework/wiki/Loading-External-Modules

and got the same result that the modules were NOT found.

Before posting here, I checked these out:

https://forums.kali.org/showthread.php?28940-Metasploit-modules-not-loading! https://www.offensive-security.com/metasploit-unleashed/modules-and-locations

and from SO:

I can't get new modules to load in metasploit How to add module in Metasploit?

no help

Just working with the github example, on the Kali host, I do indeed have the file in the right location (according to the demo):

root@kali:~/.msf4/modules/exploits/test# ls -al
total 12
drwxr-xr-x 2 root root 4096 Mar 19 13:59 .
drwxr-xr-x 3 root root 4096 Mar 19 13:58 ..
-rw-r--r-- 1 root root 9 Mar 19 13:59 test_module.rb

I then ran reload_all and when using this command:

use exploit/test/test_module it returns with Failed to load module.

I also tried to manually load that path and it failed too:

msf > loadpath ~/.msf4/modules/
Loaded 0 modules:
MGoBlue93
  • 644
  • 2
  • 14
  • 31

1 Answers1

2

Posting the answer for anyone who may come across this. I'm kinda new to this; didn't know where metasploit info gets logged.

It's in: ~/.msf4/logs/framework.log

The log told me I had a syntax error... must have happened from copying and pasting the text from the browser. Cleaned that up and everything works.

MGoBlue93
  • 644
  • 2
  • 14
  • 31
  • This solved it for me too, exact same issue, but there was no indication of what was wrong outside of that log that I could see. – Totem May 31 '22 at 18:54