Skip to content

Commit ad8516e

Browse files
author
kernelsmith
committed
fixed prompt issue, still need to restore context
see line 2519 area. msf exploit(psexec) > grep -i -A 2 encoding show <snip> msf>
1 parent 4d33742 commit ad8516e

File tree

1 file changed

+7
-4
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+7
-4
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ def cmd_back(*args)
315315
driver.destack_dispatcher
316316

317317
# Restore the prompt
318-
prompt = framework.datastore['Prompt'] || "%undmsf%clr "
319-
prompt_char = framework.datastore['PromptChar'] || ">"
318+
prompt = framework.datastore['Prompt'] || Msf::Ui::Console::Driver::DefaultPrompt
319+
prompt_char = framework.datastore['PromptChar'] || Msf::Ui::Console::Driver::DefaultPromptChar
320320
driver.update_prompt("#{prompt}", prompt_char, true)
321321
end
322322
end
@@ -2512,8 +2512,11 @@ def temp_output.write(msg = '')
25122512
orig_driver.run_single(cmd)
25132513
# restore original output
25142514
orig_driver.init_ui(orig_driver_input,orig_driver_output)
2515-
# @todo fix the prompt so we don't get "msf > >". I've tried everything to fix this... nada
2516-
# orig_driver.update_prompt(orig_prompt,orig_prompt_char,true) # <-- dependent on other code I added & removed
2515+
# restore the prompt so we don't get "msf > >".
2516+
prompt = framework.datastore['Prompt'] || Msf::Ui::Console::Driver::DefaultPrompt
2517+
prompt_char = framework.datastore['PromptChar'] || Msf::Ui::Console::Driver::DefaultPromptChar
2518+
driver.update_prompt("#{prompt}", prompt_char, true)
2519+
#@todo restore the prompt context
25172520
# dump the command's output so we can grep it
25182521
cmd_output = temp_output.dump_buffer
25192522
# put lines into an array so we can access them more easily and split('\n') doesn't work on the output obj.

0 commit comments

Comments
 (0)