-
Notifications
You must be signed in to change notification settings - Fork 14k
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 the ability to use numerics with info command #14053
Add the ability to use numerics with info command #14053
Conversation
unless mod && mod.respond_to?(:fullname) | ||
print_error("Invalid module index: #{mod_name}") | ||
return false | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if you do info
on an invalid number/multiple invalid numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dwelch-r7, you beat me on this: #14053 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great usability change!
@@ -110,6 +110,22 @@ def cmd_info_help | |||
print_line | |||
end | |||
|
|||
def print_module(mod, dump_json: false, show_doc: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I'd prefer this to be called something like print_info
thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure what to call it as I'm not used to naming conventions yet, so If you think print_info
would be better I can change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print_module_info
🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It a great feature! Thanks for adding this. I just left one comment, but otherwise, it looks good to me.
args.each { |name| | ||
# Use a module by search index | ||
index_from_list(@module_search_results, mod_name) do |mod| | ||
next unless mod && mod.respond_to?(:fullname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if we could have the same error message that has been added to the use
command when an index is invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I didn't see it happens later, when checking the return value of framework.modules.create(name)
.
769977c
to
e094a55
Compare
Release NotesImproved the |
Before
Before you were not able to use numerics with the info command
After
Now if you use a numeric with the info command it will display the corresponding modules info
Verification
List the steps needed to make sure this thing works
msfconsole
search winrm
info 0
info 9999999
returns[-] Invalid module: 9999999