Skip to content

Commit 4b47a9a

Browse files
committed
Land rapid7#3339, banner updates for Pro free trial
2 parents 6f83771 + 281b000 commit 4b47a9a

File tree

1 file changed

+40
-39
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+40
-39
lines changed

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

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -384,40 +384,42 @@ def cmd_banner_help
384384
def cmd_banner(*args)
385385
banner = "%cya" + Banner.to_s + "%clr\n\n"
386386

387-
if is_apt
387+
# These messages should /not/ show up when you're on a git checkout;
388+
# you're a developer, so you already know all this.
389+
if (is_apt || binary_install)
388390
content = [
389-
"Large pentest? List, sort, group, tag and search your hosts and services\nin Metasploit Pro -- type 'go_pro' to launch it now.",
390-
"Frustrated with proxy pivoting? Upgrade to layer-2 VPN pivoting with\nMetasploit Pro -- type 'go_pro' to launch it now.",
391-
"Save your shells from AV! Upgrade to advanced AV evasion using dynamic\nexe templates with Metasploit Pro -- type 'go_pro' to launch it now.",
392-
"Easy phishing: Set up email templates, landing pages and listeners\nin Metasploit Pro's wizard -- type 'go_pro' to launch it now.",
393-
"Using notepad to track pentests? Have Metasploit Pro report on hosts,\nservices, sessions and evidence -- type 'go_pro' to launch it now.",
394-
"Tired of typing 'set RHOSTS'? Click & pwn with Metasploit Pro\n-- type 'go_pro' to launch it now."
391+
"Trouble managing data? List, sort, group, tag and search your pentest data\nin Metasploit Pro -- learn more on http://rapid7.com/metasploit",
392+
"Frustrated with proxy pivoting? Upgrade to layer-2 VPN pivoting with\nMetasploit Pro -- learn more on http://rapid7.com/metasploit",
393+
"Payload caught by AV? Fly under the radar with Dynamic Payloads in\nMetasploit Pro -- learn more on http://rapid7.com/metasploit",
394+
"Easy phishing: Set up email templates, landing pages and listeners\nin Metasploit Pro -- learn more on http://rapid7.com/metasploit",
395+
"Taking notes in notepad? Have Metasploit Pro track & report\nyour progress and findings -- learn more on http://rapid7.com/metasploit",
396+
"Tired of typing 'set RHOSTS'? Click & pwn with Metasploit Pro\nLearn more on http://rapid7.com/metasploit",
397+
"Love leveraging credentials? Check out bruteforcing\nin Metasploit Pro -- learn more on http://rapid7.com/metasploit",
398+
"Save 45% of your time on large engagements with Metasploit Pro\nLearn more on http://rapid7.com/metasploit",
399+
"Validate lots of vulnerabilities to demonstrate exposure\nwith Metasploit Pro -- Learn more on http://rapid7.com/metasploit"
395400
]
396401
banner << content.sample # Ruby 1.9-ism!
397402
banner << "\n\n"
398403
end
399404

400-
banner << " =[ %yelmetasploit v#{Msf::Framework::Version} [core:#{Msf::Framework::VersionCore} api:#{Msf::Framework::VersionAPI}]%clr ]\n"
401-
banner << "+ -- --=[ "
402-
banner << "#{framework.stats.num_exploits} exploits - #{framework.stats.num_auxiliary} auxiliary - #{framework.stats.num_post} post ]\n"
403-
banner << "+ -- --=[ "
404-
405-
oldwarn = nil
406405
avdwarn = nil
407406

408-
banner << "#{framework.stats.num_payloads} payloads - #{framework.stats.num_encoders} encoders - #{framework.stats.num_nops} nops ]\n"
409-
if ( ::Msf::Framework::RepoRevision.to_i > 0 and ::Msf::Framework::RepoUpdatedDate)
410-
tstamp = ::Msf::Framework::RepoUpdatedDate.strftime("%Y.%m.%d")
411-
banner << " =[ svn r#{::Msf::Framework::RepoRevision} updated #{::Msf::Framework::RepoUpdatedDaysNote} (#{tstamp})\n"
412-
if(::Msf::Framework::RepoUpdatedDays > 7)
413-
oldwarn = []
414-
oldwarn << "Warning: This copy of the Metasploit Framework was last updated #{::Msf::Framework::RepoUpdatedDaysNote}."
415-
oldwarn << " We recommend that you update the framework at least every other day."
416-
oldwarn << " For information on updating your copy of Metasploit, please see:"
417-
oldwarn << " https://community.rapid7.com/docs/DOC-1306"
418-
oldwarn << ""
419-
end
420-
end
407+
banner_trailers = {
408+
:version => "%yelmetasploit v#{Msf::Framework::Version} [core:#{Msf::Framework::VersionCore} api:#{Msf::Framework::VersionAPI}]%clr",
409+
:exp_aux_pos => "#{framework.stats.num_exploits} exploits - #{framework.stats.num_auxiliary} auxiliary - #{framework.stats.num_post} post",
410+
:pay_enc_nop => "#{framework.stats.num_payloads} payloads - #{framework.stats.num_encoders} encoders - #{framework.stats.num_nops} nops",
411+
:free_trial => "Free Metasploit Pro trial: http://r-7.co/trymsp",
412+
:padding => 48
413+
}
414+
415+
banner << (" =[ %-#{banner_trailers[:padding]+8}s]\n" % banner_trailers[:version])
416+
banner << ("+ -- --=[ %-#{banner_trailers[:padding]}s]\n" % banner_trailers[:exp_aux_pos])
417+
banner << ("+ -- --=[ %-#{banner_trailers[:padding]}s]\n" % banner_trailers[:pay_enc_nop])
418+
419+
# TODO: People who are already on a Pro install shouldn't see this.
420+
# It's hard for Framework to tell the difference though since
421+
# license details are only in Pro -- we can't see them from here.
422+
banner << ("+ -- --=[ %-#{banner_trailers[:padding]}s]\n" % banner_trailers[:free_trial])
421423

422424
if ::Msf::Framework::EICARCorrupted
423425
avdwarn = []
@@ -428,22 +430,9 @@ def cmd_banner(*args)
428430
avdwarn << ""
429431
end
430432

431-
# We're running a two week survey to gather feedback from users.
432-
# Let's make sure we reach regular msfconsole users.
433-
# TODO: Get rid of this sometime after 2014-01-23
434-
survey_expires = Time.new(2014,"Jan",22,23,59,59,"-05:00")
435-
if Time.now.to_i < survey_expires.to_i
436-
banner << "+ -- --=[ Answer Q's about Metasploit and win a WiFi Pineapple Mk5 ]\n"
437-
banner << "+ -- --=[ http://bit.ly/msfsurvey (Expires #{survey_expires.ctime}) ]\n"
438-
end
439-
440433
# Display the banner
441434
print_line(banner)
442435

443-
if(oldwarn)
444-
oldwarn.map{|line| print_line(line) }
445-
end
446-
447436
if(avdwarn)
448437
avdwarn.map{|line| print_error(line) }
449438
end
@@ -3040,6 +3029,18 @@ def is_apt
30403029
File.exists?(File.expand_path(File.join(msfbase_dir, '.apt')))
30413030
end
30423031

3032+
# Determines if we're a Metasploit Pro/Community/Express
3033+
# installation or a tarball/git checkout
3034+
#
3035+
# @return [Boolean] true if we are a binary install
3036+
def binary_install
3037+
binary_paths = [
3038+
'C:/metasploit/apps/pro/msf3',
3039+
'/opt/metasploit/apps/pro/msf3'
3040+
]
3041+
return binary_paths.include? Msf::Config.install_root
3042+
end
3043+
30433044
#
30443045
# Module list enumeration
30453046
#

0 commit comments

Comments
 (0)