From 2aecab89bbdafea44db2c10a7fa69968dab39dec Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Mon, 14 Apr 2014 11:00:41 -0500 Subject: [PATCH] 14-day free trial banner for non-binary installs --- lib/msf/ui/console/command_dispatcher/core.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index fcd294fa6c..8237fd1682 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -406,6 +406,14 @@ class Core avdwarn = nil banner << "#{framework.stats.num_payloads} payloads - #{framework.stats.num_encoders} encoders - #{framework.stats.num_nops} nops ]\n" + + # Direct the user to the 14-day free trial of Metasploit Pro unless + # they are on an apt install or already using Metasploit Pro, + # Express, or Community edition + unless binary_install + banner << "+ -- --=[ 14-Day free trial: http://metasploit.pro ]" + end + if ( ::Msf::Framework::RepoRevision.to_i > 0 and ::Msf::Framework::RepoUpdatedDate) tstamp = ::Msf::Framework::RepoUpdatedDate.strftime("%Y.%m.%d") banner << " =[ svn r#{::Msf::Framework::RepoRevision} updated #{::Msf::Framework::RepoUpdatedDaysNote} (#{tstamp})\n" @@ -3040,6 +3048,18 @@ class Core File.exists?(File.expand_path(File.join(msfbase_dir, '.apt'))) end + # Determines if we're a Metasploit Pro/Community/Express + # installation or a tarball/git checkout + # + # @return [Boolean] true if we are a binary install + def binary_install + binary_paths = [ + 'C:/metasploit/apps/pro/msf3', + '/opt/metasploit/apps/pro/msf3' + ] + return binary_paths.include? Msf::Config.install_root + end + # # Module list enumeration #