@@ -2294,8 +2294,8 @@ def cmd_use(*args)
2294
2294
mod . init_ui ( driver . input , driver . output )
2295
2295
2296
2296
# Update the command prompt
2297
- prompt = framework . datastore [ 'Prompt' ] || "%undmsf%clr "
2298
- prompt_char = framework . datastore [ 'PromptChar' ] || ">"
2297
+ prompt = framework . datastore [ 'Prompt' ] || Msf :: Ui :: Console :: Driver :: DefaultPrompt
2298
+ prompt_char = framework . datastore [ 'PromptChar' ] || Msf :: Ui :: Console :: Driver :: DefaultPromptChar
2299
2299
driver . update_prompt ( "#{ prompt } #{ mod . type } (%bld%red#{ mod . shortname } %clr) " , prompt_char , true )
2300
2300
end
2301
2301
@@ -2515,8 +2515,13 @@ def temp_output.write(msg = '')
2515
2515
# restore the prompt so we don't get "msf > >".
2516
2516
prompt = framework . datastore [ 'Prompt' ] || Msf ::Ui ::Console ::Driver ::DefaultPrompt
2517
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
2518
+ mod = active_module
2519
+ if mod # if there is an active module, give them the fanciness they have come to expect
2520
+ driver . update_prompt ( "#{ prompt } #{ mod . type } (%bld%red#{ mod . shortname } %clr) " , prompt_char , true )
2521
+ else
2522
+ driver . update_prompt ( "#{ prompt } " , prompt_char , true )
2523
+ end
2524
+
2520
2525
# dump the command's output so we can grep it
2521
2526
cmd_output = temp_output . dump_buffer
2522
2527
# put lines into an array so we can access them more easily and split('\n') doesn't work on the output obj.
@@ -2895,7 +2900,7 @@ def show_global_options
2895
2900
[ 'MinimumRank' , framework . datastore [ 'MinimumRank' ] || '' , 'The minimum rank of exploits that will run without explicit confirmation' ] ,
2896
2901
[ 'SessionLogging' , framework . datastore [ 'SessionLogging' ] || '' , 'Log all input and output for sessions' ] ,
2897
2902
[ 'TimestampOutput' , framework . datastore [ 'TimestampOutput' ] || '' , 'Prefix all console output with a timestamp' ] ,
2898
- [ 'Prompt' , framework . datastore [ 'Prompt' ] || '' , 'The prompt string, defaults to "%undmsf%clr "' ] ,
2903
+ [ 'Prompt' , framework . datastore [ 'Prompt' ] || '' , 'The prompt string, defaults to "#{Msf::Ui::Console::Driver::DefaultPrompt} "' ] ,
2899
2904
[ 'PromptChar' , framework . datastore [ 'PromptChar' ] || '' , 'The prompt character, defaults to ">"' ] ,
2900
2905
[ 'PromptTimeFormat' , framework . datastore [ 'PromptTimeFormat' ] || '' , 'A format for timestamp escapes in the prompt, see ruby\'s strftime docs' ] ,
2901
2906
] . each { |r | tbl << r }
0 commit comments