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

Add "privileged" to supported search columns #18990

Open
bobOnGitHub opened this issue Mar 22, 2024 · 5 comments · May be fixed by #19120
Open

Add "privileged" to supported search columns #18990

bobOnGitHub opened this issue Mar 22, 2024 · 5 comments · May be fixed by #19120
Labels
suggestion-feature New feature suggestions

Comments

@bobOnGitHub
Copy link

bobOnGitHub commented Mar 22, 2024

Summary

Allow the user to filter search results based on privileged value (Yes|No)

Basic example

search type:exploit priviliged:no

Motivation

Means user doesn't have to view info on each entry in list to find an exploit where they don't need privileges - saves time.

@bobOnGitHub bobOnGitHub added the suggestion-feature New feature suggestions label Mar 22, 2024
@bobOnGitHub bobOnGitHub changed the title allow user to filter search results for "Privileged: Nosearch -h" Add "privileged" to supported search columns Mar 22, 2024
@adfoster-r7
Copy link
Contributor

adfoster-r7 commented Mar 22, 2024

I don't think the metadata for this privileged field will always be accurate as it's user implemented and may not always be right. The definition isn't quite aligned with what you are asking for:

  #
  # Returns whether or not the module requires or grants high privileges.
  #
  def privileged?
    privileged == true
  end

However, pull requests are welcome. You can see an example of adding additional search logic here: #18361

@nrathaus
Copy link
Contributor

An easy test to verify that it works:

search cydia privileged:true

Should return:

   0  exploit/apple_ios/ssh/cydia_default_ssh  2007-07-02       excellent  No     Apple iOS Default SSH Password Vulnerability

While:

search cydia privileged:false

Should return empty

@nrathaus
Copy link
Contributor

We need to modify lib/msf/core/modules/metadata/obj.rb as the metadata of privileged is not exposed

@nrathaus
Copy link
Contributor

It seems that you need to remove the store to get things indexed:

rm ~/.msf4/store/modules_metadata.json

@nrathaus
Copy link
Contributor

@adfoster-r7 how can I get the modules_metadata updated with the privileged attribute?

Is there a way to populate the JSON file?

@nrathaus nrathaus linked a pull request Apr 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion-feature New feature suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants