From 6b004086eada346670b3d463f232ac06c01f1010 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Thu, 10 Oct 2013 12:25:00 +0000 Subject: [PATCH 1/3] Removed SVN from msfupdate --- .../19bdfeb3753b288b06b4205235b24238 | 13 ---- .../ae6796767fe833f43e1aac5614a3f229 | 13 ---- msfconsole | 21 ----- msfupdate | 78 ++++--------------- 4 files changed, 16 insertions(+), 109 deletions(-) delete mode 100755 data/svn/auth/svn.ssl.server/19bdfeb3753b288b06b4205235b24238 delete mode 100755 data/svn/auth/svn.ssl.server/ae6796767fe833f43e1aac5614a3f229 diff --git a/data/svn/auth/svn.ssl.server/19bdfeb3753b288b06b4205235b24238 b/data/svn/auth/svn.ssl.server/19bdfeb3753b288b06b4205235b24238 deleted file mode 100755 index 1bf636272d..0000000000 --- a/data/svn/auth/svn.ssl.server/19bdfeb3753b288b06b4205235b24238 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -ascii_cert -V 1844 -MIIFYzCCBEugAwIBAgIHBHTfnZklJzANBgkqhkiG9w0BAQUFADCByjELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydGlmaWNhdGVzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkxMDAuBgNVBAMTJ0dvIERhZGR5IFNlY3VyZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTERMA8GA1UEBRMIMDc5NjkyODcwHhcNMTAwMzE2MTIwOTU5WhcNMTMwNDAxMjIwMjI0WjBVMRcwFQYDVQQKEw5tZXRhc3Bsb2l0LmNvbTEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMRcwFQYDVQQDEw5tZXRhc3Bsb2l0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+V3Vs8M+48CofjzH5KE3M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Ybp4Ru4dy97CUBceUDCXQpC3t6CNU66RIg6UAa6MV7DmJrEUhNSAB5LqsY3oyhFcV5jT0QYGMC0XuUylzNBW4AWCnlMDysJhSJ75RHa9e76S6g8m4TWT3b02LCdunzcl1kq4cmH6xPr5X3U8CkV6YGBTQhltuNQMM5OBxga1lfCFa81hSSa3300f8YBhwMatloUgu5gzQh/o3nFDJL6CDh6/fCqZyI32r+ -K 8 -failures -V 1 -8 -K 15 -svn:realmstring -V 26 -https://metasploit.com:443 -END diff --git a/data/svn/auth/svn.ssl.server/ae6796767fe833f43e1aac5614a3f229 b/data/svn/auth/svn.ssl.server/ae6796767fe833f43e1aac5614a3f229 deleted file mode 100755 index 0a1825026f..0000000000 --- a/data/svn/auth/svn.ssl.server/ae6796767fe833f43e1aac5614a3f229 +++ /dev/null @@ -1,13 +0,0 @@ -K 10 -ascii_cert -V 1844 -MIIFYzCCBEugAwIBAgIHBHTfnZklJzANBgkqhkiG9w0BAQUFADCByjELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydGlmaWNhdGVzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkxMDAuBgNVBAMTJ0dvIERhZGR5IFNlY3VyZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTERMA8GA1UEBRMIMDc5NjkyODcwHhcNMTAwMzE2MTIwOTU5WhcNMTMwNDAxMjIwMjI0WjBVMRcwFQYDVQQKEw5tZXRhc3Bsb2l0LmNvbTEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMRcwFQYDVQQDEw5tZXRhc3Bsb2l0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+V3Vs8M+48CofjzH5KE3MA1CmfXhz2vweW3x27TKhZBxbLLxVOpnbFTxfc6gD1NmcRfBRy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NSAB5LqsY3oyhFcV5jT0QYGMC0XuUylzNBW4AWCnlMDysJhSJ75RHa9e76S6g8m4TWT3b02LCdunzcl1kq4cmH6xPr5X3U8CkV6YGBTQhltuNQMM5OBxga1lfCFa81hSSa3300f8YBhwMatloUgu5gzQh/o3nFDJL6CDh6/fCqZyI32r+ -K 8 -failures -V 1 -8 -K 15 -svn:realmstring -V 30 -https://www.metasploit.com:443 -END diff --git a/msfconsole b/msfconsole index 8a9b079156..4934fd86e5 100755 --- a/msfconsole +++ b/msfconsole @@ -30,27 +30,6 @@ if(RUBY_PLATFORM =~ /mswin32/) $stderr.puts " be handled correctly. Please install Cygwin or use Linux in VMWare.\n\n" end -def is_svn - File.directory?(File.join(@msfbase_dir, ".svn")) -end - -def print_deprecation_warning - $stdout.puts "" - $stdout.puts "[-] Deprecation Note: Metasploit source checkouts NO LONGER update" - $stdout.puts "[-] over SVN. You will need to reinstall Metasploit using" - $stdout.puts "[-] binary installers (from http://www.metasploit.com/download )," - $stdout.puts "[-] Debian packages (currently only supported on Kali Linux), or" - $stdout.puts "[-] a development source checkout from GitHub (see http://r-7.co/ZLhA8P )" - $stdout.puts "[-] " - $stdout.puts "[-] For more on msfupdate and migrating off of SVN, see http://r-7.co/MSF-UP" - $stdout.puts "" -end - -if is_svn - print_deprecation_warning -end - - class OptsConsole # # Return a hash describing the options. diff --git a/msfupdate b/msfupdate index 9ac8913bb7..9674943af7 100755 --- a/msfupdate +++ b/msfupdate @@ -1,8 +1,12 @@ #!/usr/bin/env ruby # -*- coding: binary -*- - +# # $Id$ +# +# This keeps the framework up-to-date +# # $Revision$ +# msfbase = __FILE__ while File.symlink?(msfbase) @@ -13,9 +17,6 @@ end @args = ARGV.dup -# May be changed -@configdir = File.expand_path(File.join(File.dirname(msfbase), "data", "svn")) - Dir.chdir(@msfbase_dir) $stderr.puts "[*]" @@ -43,10 +44,6 @@ def is_git File.directory?(File.join(@msfbase_dir, ".git")) end -def is_svn - File.directory?(File.join(@msfbase_dir, ".svn")) -end - # Adding an upstream enables msfupdate to pull updates from # Rapid7's metasploit-framework repo instead of the repo # the user originally cloned or forked. @@ -56,18 +53,6 @@ def add_git_upstream $stdout.puts "[*] Added remote 'upstream' to your local git repository." end -def print_deprecation_warning - $stdout.puts "" - $stdout.puts "[-] Deprecation Note: Metasploit source checkouts NO LONGER update" - $stdout.puts "[-] over SVN. You will need to reinstall Metasploit using" - $stdout.puts "[-] binary installers (from http://www.metasploit.com/download )," - $stdout.puts "[-] Debian packages (currently only supported on Kali Linux), or" - $stdout.puts "[-] a development source checkout from GitHub (see http://r-7.co/ZLhA8P )" - $stdout.puts "[-] " - $stdout.puts "[-] For more on msfupdate and migrating off of SVN, see http://r-7.co/MSF-UP" - $stdout.puts "" -end - # This only exits if you actually pass a wait option, otherwise # just returns nil. This is likely unexpected, revisit this. def maybe_wait_and_exit(exit_code=0) @@ -98,8 +83,6 @@ def apt_upgrade_available(package) end end -# Some of these args are meaningful for SVN, some for Git, -# some for both. Fun times. @args.each_with_index do |arg,i| case arg # Handle the old wait/nowait argument behavior @@ -107,14 +90,6 @@ end @wait_index = i @actually_wait = (arg == "wait") # An empty or absent config-dir means a default config-dir - when "--config-dir" - @configdir_index = i - # A defined config dir means a defined config-dir - when /--config-dir=(.*)?/ - # Spaces in the directory should be fine since this whole thing is passed - # as a single argument via the multi-arg syntax for system() below. - @configdir = $1 - @configdir_index = i when /--git-remote=([^\s]*)?/ @git_remote = $1 @git_remote_index = i @@ -125,40 +100,16 @@ end end @args[@wait_index] = nil if @wait_index -@args[@configdir_index] = nil if @configdir_index @args[@git_remote_index] = nil if @git_remote_index @args[@git_branch_index] = nil if @git_branch_index + @args = @args.compact -####### Since we're SVN, do it all this way ####### -if is_svn - # We're fully deprecated now, so just exit. - # Leaving in the commented code in case someone wants to - # get a last-chance at msfupdate before the SVN server goes - # off line, which will be ANY DAY NOW. Seriously. - print_deprecation_warning - $stdin.readline if @actually_wait - exit(0x11) # Comment this to get old functionality back. - @args.push("--config-dir=#{@configdir}") - @args.push("--non-interactive") - - res = system("svn", "cleanup") - if res.nil? - $stderr.puts "[-] ERROR: Failed to run svn" - $stderr.puts "" - $stderr.puts "[-] If you used a binary installer, make sure you run the symlink in" - $stderr.puts "[-] /usr/local/bin instead of running this file directly (e.g.: ./msfupdate)" - $stderr.puts "[-] to ensure a proper environment." - maybe_wait_and_exit 1 - else - # Cleanup worked, go ahead and update - system("svn", "update", *@args) - end -end - ####### Since we're Git, do it all that way ####### if is_git + $stdout.puts "[*] Checking for updates via git" + $stdout.puts "[*] Note, bleeding edge update" out = `git remote show upstream` # Actually need the output for this one. add_git_upstream unless $?.success? and out =~ %r{(https|git|git@github\.com):(//github\.com/)?(rapid7/metasploit-framework\.git)} @@ -220,15 +171,18 @@ if is_installed $stdout.puts "" $stdout.puts "[-] In order to update your Metasploit installation," $stdout.puts "[-] you must first register it through the UI, here:" - $stderr.puts "[-] https://localhost:3790 (note, Metasploit Community" - $stderr.puts "[-] Edition is totally free and takes just a few seconds" - $stderr.puts "[-] to register!)" + $stderr.puts "[-] https://localhost:3790" + $stderr.puts "[-] (Note, Metasploit Community Edition is totally" + $stderr.puts "[-] free and takes just a few seconds to register!)" maybe_wait_and_exit 11 end end if is_apt - $stdout.puts "[*] Checking for updates" + # For more information, see here: + # https://community.rapid7.com/community/metasploit/blog/2013/01/17/metasploit-updates-and-msfupdate + $stdout.puts "[*] Checking for updates via the OS repository" + $stdout.puts "[*] Note, expect weekly(ish) updates using this method" system("apt-get", "-qq", "update") packages = [] @@ -247,7 +201,7 @@ if is_apt end end -unless is_svn || is_git || is_installed || is_apt +unless is_git || is_installed || is_apt raise RuntimeError, "Cannot determine checkout type: `#{@msfbase_dir}'" end From fedf2322b6d4ede948dbfec4b7d14bc7beb925c0 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Thu, 10 Oct 2013 18:59:03 +0000 Subject: [PATCH 2/3] Fixed grammer --- msfupdate | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msfupdate b/msfupdate index 9674943af7..6ffdee3df6 100755 --- a/msfupdate +++ b/msfupdate @@ -109,7 +109,7 @@ end ####### Since we're Git, do it all that way ####### if is_git $stdout.puts "[*] Checking for updates via git" - $stdout.puts "[*] Note, bleeding edge update" + $stdout.puts "[*] Note: Updating from bleeding edge" out = `git remote show upstream` # Actually need the output for this one. add_git_upstream unless $?.success? and out =~ %r{(https|git|git@github\.com):(//github\.com/)?(rapid7/metasploit-framework\.git)} @@ -172,7 +172,7 @@ if is_installed $stdout.puts "[-] In order to update your Metasploit installation," $stdout.puts "[-] you must first register it through the UI, here:" $stderr.puts "[-] https://localhost:3790" - $stderr.puts "[-] (Note, Metasploit Community Edition is totally" + $stderr.puts "[-] (Note: Metasploit Community Edition is totally" $stderr.puts "[-] free and takes just a few seconds to register!)" maybe_wait_and_exit 11 end @@ -181,8 +181,8 @@ end if is_apt # For more information, see here: # https://community.rapid7.com/community/metasploit/blog/2013/01/17/metasploit-updates-and-msfupdate - $stdout.puts "[*] Checking for updates via the OS repository" - $stdout.puts "[*] Note, expect weekly(ish) updates using this method" + $stdout.puts "[*] Checking for updates via the APT repository" + $stdout.puts "[*] Note: expect weekly(ish) updates using this method" system("apt-get", "-qq", "update") packages = [] From 1882c3f483ca15dfaedef3eeae29bb55abced411 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Thu, 10 Oct 2013 19:28:40 +0000 Subject: [PATCH 3/3] Removed un-needed comment --- msfupdate | 1 - 1 file changed, 1 deletion(-) diff --git a/msfupdate b/msfupdate index 6ffdee3df6..0315f52eb1 100755 --- a/msfupdate +++ b/msfupdate @@ -89,7 +89,6 @@ end when "wait", "nowait" @wait_index = i @actually_wait = (arg == "wait") - # An empty or absent config-dir means a default config-dir when /--git-remote=([^\s]*)?/ @git_remote = $1 @git_remote_index = i