Commit Graph

113 Commits

Author SHA1 Message Date
adfoster-r7 1f6009333e Add history support to nasm and metasm shells 2023-10-04 22:36:19 +01:00
adfoster-r7 a60e048e78 Fix msfrpc hanging when updating saved command history 2023-09-15 12:42:40 +01:00
adfoster-r7 449af8daa7 Fix broken msfconsole histories when switching between shell sessions 2023-07-27 16:12:57 +01:00
Spencer McIntyre dc179f6279 Fix stack trace on exit via Ctrl+D (EOF) 2023-02-03 14:38:07 -05:00
Spencer McIntyre 72ca957285 Don't use default values 2022-02-08 17:40:03 -05:00
Spencer McIntyre 1fe01087b6 Remove trailing whitespace from command output 2022-02-08 15:37:11 -05:00
Spencer McIntyre 7d9e6c2bb9 Don't crash when the hostname can't be determined
This fixes a framework-level crash when msfconsole initializes and the
HOSTNAME environment variable is not set and the hostname binary is
missing.
2022-02-08 15:14:36 -05:00
Gaurav Purswani 25d4a71ef8 Add rescue for load error in case pry gem is not present
Co-authored-by: Jeffrey Martin <jeffrey_martin@rapid7.com>
2021-07-02 08:11:27 +05:30
Gaurav Purswani ff7625ed7d Update lib/rex/ui/text/shell.rb
Co-authored-by: Jeffrey Martin <jeffrey_martin@rapid7.com>
2021-07-02 08:10:55 +05:30
Jeffrey Martin 9e447d33a5 ensure final history write 2021-07-01 09:19:45 -05:00
Gaurav Purswani c7749fa2c3 Update lib/rex/ui/text/shell.rb
Co-authored-by: Spencer McIntyre <58950994+smcintyre-r7@users.noreply.github.com>
2021-06-28 19:35:19 +05:30
pingport80 b404c90830 disable pry history by default when used as break points 2021-06-25 20:35:52 +05:30
Spencer McIntyre 0ea33ffee0 Consolidate session and shell context changes 2021-05-27 20:08:14 +05:30
Spencer McIntyre f2b69a559b Add and use a #with_context method 2021-05-27 20:08:09 +05:30
Spencer McIntyre ff1334ed14 Consolidate history management for sessions 2021-05-27 20:08:09 +05:30
pingport80 eed82f5d17 add 'name' key to history contexts 2021-05-27 20:02:48 +05:30
pingport80 26f4d66897 add history_manager support for meterpreter 2021-05-27 20:02:38 +05:30
pingport80 8eef55d5ce add separate history and history handler for meterpreter 2021-05-27 20:02:19 +05:30
Alan Foster af330874f5 Prefix time module with namespace resolution operator 2021-03-04 13:19:09 +00:00
dwelch-r7 1e8ec469fb Extract PseudoShell into it's own file for zeitwerk to pick it up properly 2021-03-02 12:39:41 +00:00
dwelch-r7 b95be3ed10 Zeitwerk rex folder 2021-02-08 12:24:12 +00:00
Chris Higgins e9c225aa49 Remove pry-byebug 2021-01-20 11:11:42 -06:00
Chris Higgins 273027845e Fix #14261 Prompt timestamp escape display error 2021-01-19 17:50:50 -06:00
Adam Galway babaee8c8e adds debug command with spec tests 2020-06-29 15:38:56 +01:00
Spencer McIntyre e771147046 Fix the default meterpreter prompt 2019-10-22 20:02:32 -04:00
Spencer McIntyre 8bb9f1798b Add a few more variables including local variants 2019-10-10 22:20:37 -04:00
Spencer McIntyre ef81205123 Add the %M meterpreter prompt var 2019-10-10 21:13:12 -04:00
Spencer McIntyre d87308e9c0 Fix a couple of bugs in the MeterpreterPrompt 2019-10-10 21:13:12 -04:00
Spencer McIntyre 48f1e1d909 Add the %D and %U meterpreter prompt chars 2019-10-10 21:13:12 -04:00
Spencer McIntyre f63fd37938 Support a dynmaic meterpreter prompt 2019-10-10 21:13:12 -04:00
Brent Cook 1b4a0e1abb switch back to source_address for now 2019-02-13 17:35:00 -06:00
Brent Cook a1522ffd06 use Ruby socket 2019-02-13 04:41:41 -06:00
Brent Cook 8083853cb9 don't create a new socket every time the command prompt is displayed 2019-02-13 04:30:57 -06:00
Adam Cammack 7c6c621a8f Remember to assign self.prompt in shell.rb
Not everything updates the prompt all the time, make them feel welcome.
2018-09-13 15:51:07 -05:00
Adam Cammack 7414b18f20 Move prompt_char space to correct place 2018-08-29 10:38:28 -05:00
Adam Cammack 94dd67f3a5 Add public readers for prompt and prompt_char
This allows various things to inspect the state of the console before
calling `update_prompt`.
2018-08-17 14:41:48 -05:00
Adam Cammack 410eee8537 Remove 'append' mode from update_prompt
Nothing used it meaningfully. Also, due to the way `init_prompt` was set
prior to b1401e2e4e, it would have been
very broken: the prompt_char would have been included in the line twice
and prompt substitutions like %T would have been cached. Even more,
trying to append the empty string to the prompt (removed in that commit)
caused us to add a number of workarounds removed in
1df442e0cf.
2018-08-17 14:32:48 -05:00
Adam Cammack b1401e2e4e Update the prompt every shell tick
This was inadvertently done as part of the tab completion
initialization but is what we want. Also move the prompt formatting to
the prompt update and make the code more readable.
2018-08-17 14:10:28 -05:00
Adam Cammack 4375a3fbfb Fix lurking bugs in the shell's prompt_yesno 2018-08-16 09:05:22 -05:00
Adam Cammack c045f70e80 Emulate prompt_yesno semantics for UI drivers 2018-08-15 17:30:37 -05:00
William Vu 298d5c3b30 Refactor history clearing 2018-08-07 16:53:17 -05:00
William Vu 3b2c3507d1 Refactor history deduplication on save
We move the check outside the block and clean up the syntax.
2018-08-07 11:18:13 -05:00
Auxilus cb01216e0c fix history issues as stated in #10423 2018-08-06 11:27:47 +05:30
Brent Cook 99965c142b remove duplicate check 2018-02-20 04:42:49 -06:00
Brent Cook bb3a11dd20 use ctrl-d to cancel input instead 2018-02-20 04:40:00 -06:00
Brent Cook f5f7b4d25a handle sessions still open 2018-02-20 03:31:20 -06:00
Brent Cook e995ccfc33 make this a little easier to read 2018-02-20 03:27:55 -06:00
Brent Cook e26fb49c99 if we have no more input from the console, quit 2018-02-20 03:27:38 -06:00
Spencer McIntyre 214c137b4a Don't use parenthesis around pgets 2018-02-07 15:53:11 -05:00
Spencer McIntyre 0ad7d10e05 Use a continuation flag to disable tab completion 2018-02-06 14:44:55 -05:00