rapid7/metasploit-framework — pull request #902 by todb-r7 (2012-10-14 01:32:03+00:00)
Title: Adds msfswitch to move over to GitHub SVN

The idea here is to convert a Metasploit checkout to being sourced from GitHub rather than metasploit.com, because github's CDN is about a million times better.

The intent here is to hang on to uncommitted changes as well -- people often like to monkey with their SVN checkout of metasploit-framework, and I don't want to delete their stuff out of hand. Some configs aren't going to be accomodated, though.

Specifically, only changes that have the status code of as one of `A C I M R ?` are going to be preserved. That should cover just about everything.

Note, this has a big *Are You Sure* step pasted on it, because this needs to be pretty thoroughly tested in lots of client environments. It's pretty much a one-way trip, and if it screws up half-way through, you're going to have a bad time.

That said, if you're particularly enterprising, on SVN, and want to pick up the new source, then by all means, back your checkout up and give it a whirl. The more testing the better.

*Usage: ./msfswitch*

Results in my preliminary testing on Linux:

````
mazikeen:./msf3-anon$ svn info
Path: .
URL: https://www.metasploit.com/svn/framework3/trunk
Repository Root: https://www.metasploit.com/svn
Repository UUID: 4d416f70-5f16-0410-b530-b9f4589650da
Revision: 15961
Node Kind: directory
Schedule: normal
Last Changed Author: rapid7
Last Changed Rev: 15961
Last Changed Date: 2012-10-13 02:07:04 -0500 (Sat, 13 Oct 2012)

[1.9.3-p125]
mazikeen:./msf3-anon$ svn st
? modules/exploits/windows/secret_0day.rb
M HACKING
[1.9.3-p125]
mazikeen:./msf3-anon$ patch -p0 < /tmp/switcher.diff
patching file lib/msf/util/switch.rb
patching file msfswitch
patching file spec/msf/util/svn_switch_config_spec.rb
patching file spec/msf/util/svn_switch_spec.rb
[1.9.3-p125]
mazikeen:./msf3-anon$ chmod +x msfswitch
[1.9.3-p125]
mazikeen:./msf3-anon$ ./msfswitch
[*]
[*] Switching Metasploit Framework to the official GitHub SVN repo.
[*] This procedure will take several minutes.
[*]

[*] Prepping current checkout /tmp/msf3-anon
[*] Creating temporary checkout at /tmp/msf3-anon/msf-github-32265
Checked out revision 32319.
[*] Staging the svn update.
... many, many files go by ...
A /tmp/msf3-anon/msf-github-32265/trunk/tools/reg.rb
A /tmp/msf3-anon/msf-github-32265/trunk/tools/verify_datastore.rb
A /tmp/msf3-anon/msf-github-32265/trunk/tools/vxdigger.rb
A /tmp/msf3-anon/msf-github-32265/trunk/tools/vxencrypt.rb
A /tmp/msf3-anon/msf-github-32265/trunk/tools/vxmaster.rb
Updated to revision 32319.
Summary of conflicts:
Tree conflicts: 1
[*] Preserving locally changed files and directories
[*] Copying /tmp/msf3-anon/msfswitch to /tmp/msf3-anon/msf-github-32265/trunk/
[*] Copying /tmp/msf3-anon/lib/msf/util/switch.rb to /tmp/msf3-anon/msf-github-32265/trunk/lib/msf/util
[*] Copying /tmp/msf3-anon/modules/exploits/windows/secret_0day.rb to /tmp/msf3-anon/msf-github-32265/trunk/modules/exploits/windows
[*] Copying /tmp/msf3-anon/spec/msf/util to /tmp/msf3-anon/msf-github-32265/trunk/spec/msf
[*] Copying /tmp/msf3-anon/HACKING to /tmp/msf3-anon/msf-github-32265/trunk/
[*] Replacing the current checkout with the new checkout
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/plugins to /tmp/msf3-anon
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/msfrpcd to /tmp/msf3-anon
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/msfbinscan to /tmp/msf3-anon
... etc ...
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/msfpescan to /tmp/msf3-anon
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/armitage to /tmp/msf3-anon
[*] Copying /tmp/msf3-anon/msf-github-32265/trunk/.svn to /tmp/msf3-anon
[*] Cleaning up
Reverted '/tmp/msf3-anon/Gemfile.lock'
[*] Removing empty dir /tmp/msf3-anon/lib/gemcache/ruby/1.9.1/cache
[*] Removing empty dir /tmp/msf3-anon/lib/gemcache/ruby/1.9.1/gems/coderay-1.0.6
[*] Removing empty dir /tmp/msf3-anon/lib/gemcache/ruby/1.9.1/gems/journey-1.0.3
... etc ...
[*] Removing empty dir /tmp/msf3-anon/external/source/exploits/CVE-2012-XXXX
[*] Removing empty dir /tmp/msf3-anon/external/source/exploits/bypassuac/x64/Release
[*] Removing empty dir /tmp/msf3-anon/external/source/exploits/bypassuac/Win32/Release
[*] Deleting the temporary Git checkout.
[+] Conversion complete!
? /tmp/msf3-anon/msfswitch
? /tmp/msf3-anon/lib/msf/util/switch.rb
? /tmp/msf3-anon/modules/exploits/windows/secret_0day.rb
? /tmp/msf3-anon/spec/msf/util
M /tmp/msf3-anon/HACKING
[*] Time elapsed: 6.31m
[1.9.3-p125]
mazikeen:./msf3-anon$ svn info
Path: .
URL: https://github.com/rapid7/metasploit-framework/trunk
Repository Root: https://github.com/rapid7/metasploit-framework
Repository UUID: 0c4406c3-be19-3c88-1c08-ce57b7db7bff
Revision: 32319
Node Kind: directory
Schedule: normal
Last Changed Author: jvazquez.r7
Last Changed Rev: 32318
Last Changed Date: 2012-10-13 02:05:34 -0500 (Sat, 13 Oct 2012)
````