Skip to content

Commit

Permalink
Show the tip while MSF is loading
Browse files Browse the repository at this point in the history
Give the users something to read while things are loading instead of
waiting until everything is ready to go.
  • Loading branch information
zeroSteiner committed Sep 8, 2023
1 parent 6e1753d commit 11c09b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/metasploit/framework/command/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

require 'metasploit/framework/command'
require 'metasploit/framework/command/base'
require 'rex/text'

# Based on pattern used for lib/rails/commands in the railties gem.
class Metasploit::Framework::Command::Console < Metasploit::Framework::Command::Base

# Provides an animated spinner in a seperate thread.
# Provides an animated spinner in a separate thread.
#
# See GitHub issue #4147, as this may be blocking some
# Windows instances, which is why Windows platforms
Expand Down Expand Up @@ -44,7 +45,12 @@ def start
when :version
$stderr.puts "Framework Version: #{Metasploit::Framework::VERSION}"
else
spinner unless parsed_options.options.console.quiet
unless parsed_options.options.console.quiet
colorizor = Struct.new(:supports_color?).new(false).extend(Rex::Text::Color)
$stdout.print colorizor.substitute_colors(Rex::Text.wordwrap("Metasploit tip: #{Msf::Ui::Tip.sample}\n", indent = 0, cols = 80))
spinner
end

driver.run
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/msf/ui/console/command_dispatcher/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def cmd_banner(*args)
banner << ("+ -- --=[ %-#{padding}s]\n" % eva)

banner << "\n"
banner << Rex::Text.wordwrap("Metasploit tip: #{Tip.sample}\n", indent = 0, cols = 60)
banner << Rex::Text.wordwrap('Metasploit Documentation: https://docs.metasploit.com/', indent = 0, cols = 60)

# Display the banner
Expand Down

0 comments on commit 11c09b9

Please sign in to comment.