@@ -384,40 +384,42 @@ def cmd_banner_help
384
384
def cmd_banner ( *args )
385
385
banner = "%cya" + Banner . to_s + "%clr\n \n "
386
386
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 )
388
390
content = [
389
- "Large pentest? List, sort, group, tag and search your hosts and services\n in Metasploit Pro -- type 'go_pro' to launch it now." ,
390
- "Frustrated with proxy pivoting? Upgrade to layer-2 VPN pivoting with\n Metasploit Pro -- type 'go_pro' to launch it now." ,
391
- "Save your shells from AV! Upgrade to advanced AV evasion using dynamic\n exe templates with Metasploit Pro -- type 'go_pro' to launch it now." ,
392
- "Easy phishing: Set up email templates, landing pages and listeners\n in Metasploit Pro's wizard -- type 'go_pro' to launch it now." ,
393
- "Using notepad to track pentests? Have Metasploit Pro report on hosts,\n services, 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\n in Metasploit Pro -- learn more on http://rapid7.com/metasploit" ,
392
+ "Frustrated with proxy pivoting? Upgrade to layer-2 VPN pivoting with\n Metasploit Pro -- learn more on http://rapid7.com/metasploit" ,
393
+ "Payload caught by AV? Fly under the radar with Dynamic Payloads in\n Metasploit Pro -- learn more on http://rapid7.com/metasploit" ,
394
+ "Easy phishing: Set up email templates, landing pages and listeners\n in Metasploit Pro -- learn more on http://rapid7.com/metasploit" ,
395
+ "Taking notes in notepad? Have Metasploit Pro track & report\n your progress and findings -- learn more on http://rapid7.com/metasploit" ,
396
+ "Tired of typing 'set RHOSTS'? Click & pwn with Metasploit Pro\n Learn more on http://rapid7.com/metasploit" ,
397
+ "Love leveraging credentials? Check out bruteforcing\n in Metasploit Pro -- learn more on http://rapid7.com/metasploit" ,
398
+ "Save 45% of your time on large engagements with Metasploit Pro\n Learn more on http://rapid7.com/metasploit" ,
399
+ "Validate lots of vulnerabilities to demonstrate exposure\n with Metasploit Pro -- Learn more on http://rapid7.com/metasploit"
395
400
]
396
401
banner << content . sample # Ruby 1.9-ism!
397
402
banner << "\n \n "
398
403
end
399
404
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
406
405
avdwarn = nil
407
406
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 ] )
421
423
422
424
if ::Msf ::Framework ::EICARCorrupted
423
425
avdwarn = [ ]
@@ -428,22 +430,9 @@ def cmd_banner(*args)
428
430
avdwarn << ""
429
431
end
430
432
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
-
440
433
# Display the banner
441
434
print_line ( banner )
442
435
443
- if ( oldwarn )
444
- oldwarn . map { |line | print_line ( line ) }
445
- end
446
-
447
436
if ( avdwarn )
448
437
avdwarn . map { |line | print_error ( line ) }
449
438
end
@@ -3040,6 +3029,18 @@ def is_apt
3040
3029
File . exists? ( File . expand_path ( File . join ( msfbase_dir , '.apt' ) ) )
3041
3030
end
3042
3031
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
+
3043
3044
#
3044
3045
# Module list enumeration
3045
3046
#
0 commit comments