-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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 sort by category and reverse search results flags to the search command #14917
Conversation
Updated description to more accurately note that the date sorting issue was the only one mentioned in the issue linked, just so people can note which features were specifically customer requested. Also adding trailing quotes to close off the code section and fixed a spacing issue on the list that was causing it to render odd. |
Looks like this is working reliably at least from the perspective of sorting by Output
|
Also good thing to note here that isn't shown above but all color highlighting still works normally so no affects on that. |
This is pretty neat, I can definitely see it being useful. Couple of things I noticed though is that this adds the option as a keyword which right now are all basically module attributes on which the search is applied, not necessarily modifiers on the data being processed. I think this would be better set as an option like |
sure, I will try to achieve all that...Thanks for suggestions |
Added the option -s for sorting based on name, date, type and rank. Also added -r option for reversing the search_results. |
VerificationStart The examples below show different sorting categories:
|
Alright with the proposed changes all looks good and the output of help has fixed those minor typos and now looks good:
|
…ng by if modules have a check method or not, and support outputting an appropriate error message if the -s option is used with an invalid parameter
19489c6
to
9713402
Compare
Sorry for the rebase I realized I had completely messed up some of the output with one of the previous commits so I undid that and then squashed the commits so the commit history doesn't show that anymore. |
Updated description to properly reflect which options we currently support sorting on. Technically we could do more but since the others are not really displayed as output by the |
Full complete test below showing everything is working as expected and that if just the Full Exhaustive Test Output
|
Going to go ahead and land this so long. Nice work on this PR @pingport80, and congrats on your first MSF PR and first library PR! |
Release NotesImproved the |
Thanks a lot @gwillcox-r7 and @zeroSteiner for the suggestions, till now I was focusing on protocol libs but those helped me understand the UI better, really appreciate that! |
This PR adds sort utility to search command after which the user can sort the search results based on different categories:
This is implemented via the new command line flag
-s
which takes one argument, the column to sort by, and orders the results in ascending order. If users wish to view the results in descending order, they can use the newly added-r
flag.The date feature was described in issue #13101
Verification
msfconsole
search shellshock
search shellshock -s rank
search shellshock -s rank -r
returns the same results as above but in descending order.search shellshock -s disclosure_date
search shellshock -s date
search shellshock -s name
search shellshock -s type
search shellshock -s check
search shellshock -s fake
returns an error message about having an invalid value for the-s
switch.The examples below show different sorting categories: