Skip to content

Commit d336c56

Browse files
committed
Merge remote-tracking branch 'upstream/master' into land_2551
2 parents 03ad810 + e05904c commit d336c56

File tree

1,023 files changed

+43444
-25199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,023 files changed

+43444
-25199
lines changed

.gitignore

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.bundle
2+
Gemfile.local
3+
Gemfile.local.lock
24
# Rubymine project directory
35
.idea
46
# Sublime Text project directory (not created by ST by default)
@@ -13,8 +15,6 @@
1315
config/database.yml
1416
# simplecov coverage data
1517
coverage
16-
data/meterpreter/ext_server_pivot.x86.dll
17-
data/meterpreter/ext_server_pivot.x64.dll
1818
doc/
1919
external/source/meterpreter/java/bin
2020
external/source/meterpreter/java/build
@@ -51,3 +51,22 @@ tags
5151
# ignore release/debug folders for exploits
5252
external/source/exploits/**/Debug
5353
external/source/exploits/**/Release
54+
55+
# Avoid checking in Meterpreter binaries. These are supplied upstream by
56+
# the meterpreter_bins gem.
57+
data/meterpreter/elevator.*.dll
58+
data/meterpreter/ext_server_espia.*.dll
59+
data/meterpreter/ext_server_extapi.*.dll
60+
data/meterpreter/ext_server_incognito.*.dll
61+
data/meterpreter/ext_server_kiwi.*.dll
62+
data/meterpreter/ext_server_lanattacks.*.dll
63+
data/meterpreter/ext_server_mimikatz.*.dll
64+
data/meterpreter/ext_server_priv.*.dll
65+
data/meterpreter/ext_server_stdapi.*.dll
66+
data/meterpreter/metsrv.*.dll
67+
data/meterpreter/screenshot.*.dll
68+
69+
# Avoid checking in Meterpreter libs that are built from
70+
# private source. If you're interested in this functionality,
71+
# check out Metasploit Pro: http://metasploit.com/download
72+
data/meterpreter/ext_server_pivot.*.dll

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ todb-r7 <todb-r7@github> Tod Beardsley <[email protected]>
1818
todb-r7 <todb-r7@github> Tod Beardsley <[email protected]>
1919
todb-r7 <todb-r7@github> Tod Beardsley <[email protected]>
2020
trosen-r7 <trosen-r7@github> Trevor Rosen <[email protected]>
21+
trosen-r7 <trosen-r7@github> Trevor Rosen <[email protected]>
2122
wchen-r7 <wchen-r7@github> sinn3r <[email protected]> # aka sinn3r
2223
wchen-r7 <wchen-r7@github> sinn3r <[email protected]>
2324
wchen-r7 <wchen-r7@github> Wei Chen <[email protected]>

.rubocop.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
LineLength:
2+
Enabled: true
3+
Max: 180
4+
5+
MethodLength:
6+
Enabled: true
7+
Max: 100
8+
9+
Style/ClassLength:
10+
Exclude:
11+
# Most modules are quite large and all contained in one class. This is OK.
12+
- 'modules/**/*'
13+
14+
Style/NumericLiterals:
15+
Enabled: false
16+
17+
Documentation:
18+
Exclude:
19+
- 'modules/**/*'

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.3-p484
1+
1.9.3-p547

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
language: ruby
2-
env: MSF_SPOTCHECK_RECENT=1
32
before_install:
43
- rake --version
54
- sudo apt-get update -qq
65
- sudo apt-get install -qq libpcap-dev
6+
# Uncomment when we have fewer shipping msftidy warnings.
7+
# Merge committers will still be checking, just not autofailing.
8+
# See https://dev.metasploit.com/redmine/issues/8498
9+
# - ln -sf ../../tools/dev/pre-commit-hook.rb ./.git/hooks/post-merge
10+
# - ls -la ./.git/hooks
11+
# - ./.git/hooks/post-merge
712
before_script:
8-
- ./tools/msftidy.rb
913
- cp config/database.yml.travis config/database.yml
1014
- bundle exec rake --version
1115
- bundle exec rake db:create

.yardopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
--files CONTRIBUTING.md,COPYING,HACKING,LICENSE
66
lib/msf/**/*.rb
77
lib/rex/**/*.rb
8+
plugins/**/*.rb

CONTRIBUTING.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
# Contributing to Metasploit
1+
# Hello, World!
22

33
Thanks for your interest in making Metasploit -- and therefore, the
4-
world -- a better place! What you see here in CONTRIBUTING.md is a
5-
bullet-point list of the do's and don'ts of how to make sure *your*
6-
valuable contributions actually make it into Metasploit's master branch.
4+
world -- a better place!
5+
6+
Are you about to report a bug? If so, please use our [Redmine Bug
7+
Tracker](https://dev.metasploit.com/redmine/projects/framework). An
8+
account is required but it only takes a minute or two.
9+
10+
Are you about to report a security vulnerability in Metasploit?
11+
If so, please take a look at Rapid's [Vulnerability
12+
Disclosure Policy](https://www.rapid7.com/disclosure.jsp) policy.
13+
14+
Are you about to contribute some new functionality, a bug fix, or a new
15+
Metasploit module? If so, read on...
16+
17+
# Contributing to Metasploit
18+
19+
What you see here in CONTRIBUTING.md is a bullet-point list of the do's
20+
and don'ts of how to make sure *your* valuable contributions actually
21+
make it into Metasploit's master branch.
722

823
If you care not to follow these rules, your contribution **will** be
924
closed (*Road House* style). Sorry!
1025

11-
Incidentally, this is a **short** list. The
26+
This is intended to be a **short** list. The
1227
[wiki](https://github.com/rapid7/metasploit-framework/wiki) is much more
1328
exhaustive and reveals many mysteries. If you read nothing else, take a
1429
look at the standard [development environment setup
@@ -18,11 +33,13 @@ and Metasploit's [Common Coding Mistakes](https://github.com/rapid7/metasploit-f
1833
## Code Contributions
1934

2035
* **Do** stick to the [Ruby style guide](https://github.com/bbatsov/ruby-style-guide).
36+
* Similarly, **try** to get Rubocop passing or at least relatively quiet against the files added/modified as part of your contribution
2137
* **Do** follow the [50/72 rule](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for Git commit messages.
2238
* **Do** create a [topic branch](http://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches) to work on instead of working directly on `master`.
2339

2440
### Pull Requests
2541

42+
* **Do** target your pull request to the **master branch**. Not staging, not develop, not release.
2643
* **Do** specify a descriptive title to make searching for your pull request easier.
2744
* **Do** include [console output](https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks), especially for witnessable effects in `msfconsole`.
2845
* **Do** list [verification steps](https://help.github.com/articles/writing-on-github#task-lists) so your code is testable.
@@ -34,14 +51,15 @@ Pull requests [#2940](https://github.com/rapid7/metasploit-framework/pull/2940)
3451
#### New Modules
3552

3653
* **Do** run `tools/msftidy.rb` against your module and fix any errors or warnings that come up. Even better would be to set up `msftidy.rb` as a [pre-commit hook](https://github.com/rapid7/metasploit-framework/blob/master/tools/dev/pre-commit-hook.rb).
37-
* **Do** use the [API](https://dev.metasploit.com/documents/api/). Wheel improvements are welcome; wheel reinventions, not so much.
54+
* **Do** use the [many module mixin APIs](https://dev.metasploit.com/api/). Wheel improvements are welcome; wheel reinventions, not so much.
3855
* **Don't** include more than one module per pull request.
3956

4057
#### Library Code
4158

4259
* **Do** write [RSpec](http://rspec.info/) tests - even the smallest change in library land can thoroughly screw things up.
4360
* **Do** follow [Better Specs](http://betterspecs.org/) - it's like the style guide for specs.
4461
* **Do** write [YARD](http://yardoc.org/) documentation - this makes it easier for people to use your code.
62+
* **Don't** fix a lot of things in one pull request. Small fixes are easier to validate.
4563

4664
#### Bug Fixes
4765

@@ -50,8 +68,8 @@ Pull requests [#2940](https://github.com/rapid7/metasploit-framework/pull/2940)
5068

5169
## Bug Reports
5270

53-
* **Do** report vulnerabilities in Rapid7 software to [email protected].
54-
* **Do** create a Redmine account and report your bug there.
71+
* **Do** report vulnerabilities in Rapid7 software directly to [email protected].
72+
* **Do** create a Redmine account and report your non-vulnerability bugs there.
5573
* **Do** write a detailed description of your bug and use a descriptive title.
5674
* **Do** include reproduction steps, stack traces, and anything else that might help us verify and fix your bug.
5775
* **Don't** file duplicate reports - search for your bug before filing a new report.

Gemfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
source 'https://rubygems.org'
22

33
# Need 3+ for ActiveSupport::Concern
4-
gem 'activesupport', '>= 3.0.0'
4+
gem 'activesupport', '>= 3.0.0', '< 4.0.0'
55
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
6-
gem 'bcrypt-ruby'
6+
gem 'bcrypt'
77
# Needed for some admin modules (scrutinizer_add_user.rb)
88
gem 'json'
9+
# Needed for Meterpreter on Windows, soon others.
10+
gem 'meterpreter_bins', '0.0.6'
911
# Needed by msfgui and other rpc components
1012
gem 'msgpack'
1113
# Needed by anemone crawler
1214
gem 'nokogiri'
13-
# Needed by anemone crawler
14-
gem 'robots'
1515
# Needed by db.rb and Msf::Exploit::Capture
1616
gem 'packetfu', '1.1.9'
17+
# Needed by JSObfu
18+
gem 'rkelly-remix', '0.0.6'
19+
# Needed by anemone crawler
20+
gem 'robots'
21+
# Needed for some post modules
22+
gem 'sqlite3'
1723

1824
group :db do
1925
# Needed for Msf::DbManager
20-
gem 'activerecord'
26+
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
2127
# Database models shared between framework and Pro.
22-
gem 'metasploit_data_models', '~> 0.17.0'
28+
gem 'metasploit_data_models', '0.17.0'
2329
# Needed for module caching in Mdm::ModuleDetails
2430
gem 'pg', '>= 0.11'
2531
end
@@ -31,6 +37,8 @@ group :pcap do
3137
end
3238

3339
group :development do
40+
# Style/sanity checking Ruby code
41+
gem 'rubocop'
3442
# Markdown formatting for yard
3543
gem 'redcarpet'
3644
# generating documentation

Gemfile.local.example

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
##
2+
# Example Gemfile.local file for Metasploit Framework
3+
#
4+
# The Gemfile.local file provides a way to use other gems that are not
5+
# included in the standard Gemfile provided with Metasploit.
6+
# This filename is included in Metasploit's .gitignore file, so local changes
7+
# to this file will not accidentally show up in future pull requests. This
8+
# example Gemfile.local includes all gems in Gemfile using instance_eval.
9+
# It also creates a new bundle group, 'local', to hold additional gems.
10+
#
11+
# This file will not be used by default within the framework. As such, one
12+
# must first install the custom Gemfile.local with bundle:
13+
# bundle install --gemfile Gemfile.local
14+
#
15+
# Note that msfupdate does not consider Gemfile.local when updating the
16+
# framework. If it is used, it may be necessary to run the above bundle
17+
# command after the update.
18+
#
19+
###
20+
21+
# Include the Gemfile included with the framework. This is very
22+
# important for picking up new gem dependencies.
23+
msf_gemfile = File.join(File.dirname(__FILE__), 'Gemfile')
24+
if File.readable?(msf_gemfile)
25+
instance_eval(File.read(msf_gemfile))
26+
end
27+
28+
# Create a custom group
29+
group :local do
30+
# Use pry to help view and interact with objects in the framework
31+
gem 'pry', '~> 0.9'
32+
# Use pry-debugger to step through code during development
33+
gem 'pry-debugger', '~> 0.2'
34+
# Add the lab gem so that the 'lab' plugin will work again
35+
gem 'lab', '~> 0.2.7'
36+
end

Gemfile.lock

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ GEM
1313
i18n (~> 0.6, >= 0.6.4)
1414
multi_json (~> 1.0)
1515
arel (3.0.2)
16-
bcrypt-ruby (3.1.2)
16+
ast (2.0.0)
17+
bcrypt (3.1.7)
1718
builder (3.0.4)
1819
database_cleaner (1.1.1)
1920
diff-lcs (1.2.4)
@@ -26,17 +27,24 @@ GEM
2627
activerecord (>= 3.2.13)
2728
activesupport
2829
pg
30+
meterpreter_bins (0.0.6)
2931
mini_portile (0.5.1)
3032
msgpack (0.5.5)
3133
multi_json (1.0.4)
3234
network_interface (0.0.1)
3335
nokogiri (1.6.0)
3436
mini_portile (~> 0.5.0)
3537
packetfu (1.1.9)
38+
parser (2.1.9)
39+
ast (>= 1.1, < 3.0)
40+
slop (~> 3.4, >= 3.4.5)
3641
pcaprub (0.11.3)
3742
pg (0.16.0)
43+
powerpack (0.0.9)
44+
rainbow (2.0.0)
3845
rake (10.1.0)
3946
redcarpet (3.0.0)
47+
rkelly-remix (0.0.6)
4048
robots (0.10.1)
4149
rspec (2.14.1)
4250
rspec-core (~> 2.14.0)
@@ -46,12 +54,21 @@ GEM
4654
rspec-expectations (2.14.2)
4755
diff-lcs (>= 1.1.3, < 2.0)
4856
rspec-mocks (2.14.3)
57+
rubocop (0.23.0)
58+
json (>= 1.7.7, < 2)
59+
parser (~> 2.1.9)
60+
powerpack (~> 0.0.6)
61+
rainbow (>= 1.99.1, < 3.0)
62+
ruby-progressbar (~> 1.4)
63+
ruby-progressbar (1.5.1)
4964
shoulda-matchers (2.3.0)
5065
activesupport (>= 3.0.0)
5166
simplecov (0.5.4)
5267
multi_json (~> 1.0.3)
5368
simplecov-html (~> 0.5.3)
5469
simplecov-html (0.5.3)
70+
slop (3.5.0)
71+
sqlite3 (1.3.9)
5572
timecop (0.6.3)
5673
tzinfo (0.3.37)
5774
yard (0.8.7)
@@ -60,14 +77,15 @@ PLATFORMS
6077
ruby
6178

6279
DEPENDENCIES
63-
activerecord
64-
activesupport (>= 3.0.0)
65-
bcrypt-ruby
80+
activerecord (>= 3.0.0, < 4.0.0)
81+
activesupport (>= 3.0.0, < 4.0.0)
82+
bcrypt
6683
database_cleaner
6784
factory_girl (>= 4.1.0)
6885
fivemat (= 1.2.1)
6986
json
70-
metasploit_data_models (~> 0.17.0)
87+
metasploit_data_models (= 0.17.0)
88+
meterpreter_bins (= 0.0.6)
7189
msgpack
7290
network_interface (~> 0.0.1)
7391
nokogiri
@@ -76,9 +94,12 @@ DEPENDENCIES
7694
pg (>= 0.11)
7795
rake (>= 10.0.0)
7896
redcarpet
97+
rkelly-remix (= 0.0.6)
7998
robots
8099
rspec (>= 2.12)
100+
rubocop
81101
shoulda-matchers
82102
simplecov (= 0.5.4)
103+
sqlite3
83104
timecop
84105
yard

0 commit comments

Comments
 (0)