Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error with message "undefined method `search_modules' for Msf::WebServices:Module" when call REST API #18472

Closed
TLGKien opened this issue Oct 20, 2023 · 3 comments · Fixed by #18712
Labels

Comments

@TLGKien
Copy link

TLGKien commented Oct 20, 2023

Steps to reproduce

How'd you do it?

  1. I have installed Metasploit Framework and set up the Metasploit web server (for using REST API).
  2. Send a request to http GET /api/v1/modules

Were you following a specific guide/tutorial or reading documentation?

Yes, I was following this docs https://docs.metasploit.com/docs/using-metasploit/advanced/metasploit-web-service.html

Expected behavior

It should return modules matching keywords with appropriate metadata.
Screenshot from 2023-10-19 21-27-57

Current behavior

It returned an error with message: "There was an error completing the module search: undefined method `search_modules' for Msf::WebServices:Module" and code 500
Screenshot from 2023-10-19 21-30-36

Metasploit version

Framework Version: 6.3.39-dev-

Additional Information

I updated to the latest version but my issue is still present.

Suggestion

"I found this API calling the method Msf::WebServices.search_modules() (in file /framework/lib/msf/core/web_services/servlet/module_search_servlet.rb line 21), but this method search_modules() is not defined in module Msf::WebServices. I think search_modules() might be mothod in module Msf::WebServices::ModuleSearch (because the method search_modules() is defined in module Msf::WebServices::ModuleSearch in the file framework/lib/msf/core/web_services/module_search.rb line 3)".

I have modified the source code, but I don't know how to rebuild it. It would be great if you could provide a guide for me to edit the code and rebuild the project on my own.

@adfoster-r7
Copy link
Contributor

I have modified the source code, but I don't know how to rebuild it. It would be great if you could provide a guide for me to edit the code and rebuild the project on my own.

You should be able to stop and start the server for it to pick up the latest code changes 👍

Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Nov 23, 2023
@adfoster-r7 adfoster-r7 removed the Stale Marks an issue as stale, to be closed if no action is taken label Nov 23, 2023
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Dec 25, 2023
@adfoster-r7 adfoster-r7 removed the Stale Marks an issue as stale, to be closed if no action is taken label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants