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

Consolidate and reuse pager code for inline console docs #11961

Closed
wants to merge 1 commit into from

Conversation

wvu
Copy link
Contributor

@wvu wvu commented Jun 10, 2019

This offers increased readability with the command help near the prompt. Taking the pager approach presently.

  • Type help
  • See available msfconsole commands without scrolling up
  • Type help repeat or help jobs
  • See available repeat or jobs options near the prompt

A pager approach is also an option (@acammack-r7), but I think this can be an easy win for me and @wchen-r7. Thoughts welcome.

msf5 > help repeat
Repeat
======

The `repeat` command repeats one or more console commands for a fixed number of
times, a certain length of time, or forever. The repeat command is most useful
for repeating module runs like memory dumpers or scanners that have a random
element to them.

Usage
-----

### Flags

#### -t, --time SECONDS

Start the list of commands until the number of seconds has elapsed.

#### -n, --number TIMES

Start the list of commands a fixed number of times.

#### -h, --help

Display the help banner.



Examples
--------

Run the heartbleed module every 10 seconds against a server for an hour:

    msf5 > use auxiliary/scanner/ssl/openssl_heartbleed
    msf5 auxiliary(scanner/ssl/openssl_heartbleed) > set ACTION DUMP
    # Set other options...
    msf5 auxiliary(scanner/ssl/openssl_heartbleed) > repeat -t 3600 run; sleep 10


Usage: repeat [OPTIONS] COMMAND...
Repeat (loop) a ;-separated list of msfconsole commands indefinitely, or for a
number of iterations or a certain amount of time.

    -t, --time SECONDS               Number of seconds to repeat COMMAND...
    -n, --number TIMES               Number of times to repeat COMMAND..
    -h, --help                       Help banner.
msf5 >

#11407, #11498

This offers increased readability with the command help near the prompt.
@jrobles-r7
Copy link
Contributor

jrobles-r7 commented Jun 14, 2019

Is this PR delayed?

@acammack-r7
Copy link
Contributor

No, although I would rather not make the output less like man(1). As a note, you can skip the markdown entirely by doing repeat -h.

@wvu wvu added the blocked Blocked by one or more additional tasks label Jun 14, 2019
@wvu
Copy link
Contributor Author

wvu commented Jun 14, 2019

I'm moving and refactoring my pager code from the developer dispatcher into the dispatcher shell this morning, and we'll see how it looks after that. Output that's closer to man(1) is a good thing.

Our primary gripe is that you can't suppress the Markdown output for msfconsole help, @acammack-r7. This is where the conversation started. The individual commands are less of an issue.

msf5 > help -h
[-] No such command
msf5 > help help
There's only so much I can do
msf5 >

While we could add -h to help, I think the pager approach is better and more correct. less(1) does something similar for its own help.

@acammack-r7
Copy link
Contributor

msf5 > repeat -h
Usage: repeat [OPTIONS] COMMAND...
Repeat (loop) a ;-separated list of msfconsole commands indefinitely, or for a
number of iterations or a certain amount of time.

    -t, --time SECONDS               Number of seconds to repeat COMMAND...
    -n, --number TIMES               Number of times to repeat COMMAND..
    -h, --help                       Help banner.

@wvu wvu removed the easy label Jun 14, 2019
@wvu wvu changed the title Move Markdown documentation for commands to top Consolidate and reuse pager code for inline console docs Jun 17, 2019
@wvu
Copy link
Contributor Author

wvu commented Jun 28, 2019

This is a little too niche of barely a problem for me to be willing to solve right now. Portable pager invocation is not something I want to deal with at the moment, and there are bigger fish to fry.

Someone else can take a stab at this if they'd like. Thanks.

@wvu wvu closed this Jun 28, 2019
@wvu wvu deleted the feature/help branch June 28, 2019 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by one or more additional tasks docs enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants