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

Undocumented parameter in "notes" command #19128

Closed
pwndad opened this issue Apr 24, 2024 · 2 comments
Closed

Undocumented parameter in "notes" command #19128

pwndad opened this issue Apr 24, 2024 · 2 comments
Labels
suggestion-docs New documentation suggestions

Comments

@pwndad
Copy link
Contributor

pwndad commented Apr 24, 2024

Summary

notes -h
states that we can use this example command
notes -S 'nmap.nse.(http|rtsp)'
Example documentation

But this flag is neither documented here
missing documentation for search parameter
nor is it working correctly when used like this.

Acutally there seems to be code handling the -S parameter:
existing code for handling undocumented parameter

Motivation

To be consistent between parameter documentation, examples and code behind.

Steps to resolve this issue

EITHER

  • Remove the example from usage and the corresponding code which handles search_term
    OR
  • Document the -S parameter additionally to the example and test it accordingly e.g.

Draft the doc

-S, --search <filter> Search string to filter by

Open a pull request

Sorry for not proposing a PR but I could not figure out why the undocumented parameter is not working as expected.

@pwndad pwndad added the suggestion-docs New documentation suggestions label Apr 24, 2024
@nrathaus
Copy link
Contributor

@pwndad it doesn't "work" because:

@@notes_opts = Rex::Parser::Arguments.new(
    [ '-a', '--add' ] => [ false, 'Add a note to the list of addresses, instead of listing.' ],
    [ '-d', '--delete' ] => [ false, 'Delete the notes instead of searching.' ],
    [ '-n', '--note' ] => [ true, 'Set the data for a new note (only with -a).', '<note>' ],
    [ '-t', '--type' ] => [ true, 'Search for a list of types, or set single type for add.', '<type1,type2>' ],
    [ '-h', '--help' ] => [ false, 'Show this help information.' ],
    [ '-R', '--rhosts' ] => [ false, 'Set RHOSTS from the results of the search.' ],
    [ '-o', '--output' ] => [ true, 'Save the notes to a csv file.', '<filename>' ],
    [ '-O', '--order' ] => [ true, 'Order rows by specified column number.', '<column id>' ],
    [ '-u', '--update' ] => [ false, 'Update a note. Not officially supported.' ]
  )

Doesn't list '-S' as an option

If you add (at line 1240):

    [ '-S', '--search' ] => [ true, 'Search string to filter by.', '<filter>' ],

The code will get triggered - and the notes (appears) to be filtered - I am saying appears as I don't have nmap results that match your data

@smcintyre-r7
Copy link
Contributor

Fixed in #19129 which will be included in the next regularly scheduled release, 6.4.6 which should be posted tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion-docs New documentation suggestions
Projects
None yet
Development

No branches or pull requests

3 participants