Skip to content

Commit 88ccffa

Browse files
committed
Update from upstream master
2 parents 37f159d + 84e6db7 commit 88ccffa

File tree

3,782 files changed

+83763
-51884
lines changed

Some content is hidden

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

3,782 files changed

+83763
-51884
lines changed

.gitignore

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ Gemfile.local.lock
77
.sublime-project
88
# RVM control file, keep this to avoid backdooring Metasploit
99
.rvmrc
10+
# Allow for a local choice of (unsupported / semi-supported) ruby versions
11+
# See PR #4136 for usage, but example usage for rvm:
12+
# rvm --create --versions-conf use 2.1.4@metasploit-framework
13+
# Because rbenv doesn't use .versions.conf, to achieve this same functionality, run:
14+
# rbenv shell 2.1.4
15+
.versions.conf
1016
# YARD cache directory
1117
.yardoc
1218
# Mac OS X files
1319
.DS_Store
1420
# database config for testing
1521
config/database.yml
22+
# target config file for testing
23+
features/support/targets.yml
1624
# simplecov coverage data
1725
coverage
18-
data/meterpreter/ext_server_pivot.x86.dll
19-
data/meterpreter/ext_server_pivot.x64.dll
2026
doc/
2127
external/source/meterpreter/java/bin
2228
external/source/meterpreter/java/build
@@ -50,6 +56,30 @@ tags
5056
*.opensdf
5157
*.user
5258

59+
# Rails log directory
60+
/log
61+
# Rails tmp directory
62+
/tmp
63+
5364
# ignore release/debug folders for exploits
5465
external/source/exploits/**/Debug
5566
external/source/exploits/**/Release
67+
68+
# Avoid checking in Meterpreter binaries. These are supplied upstream by
69+
# the meterpreter_bins gem.
70+
data/meterpreter/elevator.*.dll
71+
data/meterpreter/ext_server_espia.*.dll
72+
data/meterpreter/ext_server_extapi.*.dll
73+
data/meterpreter/ext_server_incognito.*.dll
74+
data/meterpreter/ext_server_kiwi.*.dll
75+
data/meterpreter/ext_server_lanattacks.*.dll
76+
data/meterpreter/ext_server_mimikatz.*.dll
77+
data/meterpreter/ext_server_priv.*.dll
78+
data/meterpreter/ext_server_stdapi.*.dll
79+
data/meterpreter/metsrv.*.dll
80+
data/meterpreter/screenshot.*.dll
81+
82+
# Avoid checking in Meterpreter libs that are built from
83+
# private source. If you're interested in this functionality,
84+
# check out Metasploit Pro: http://metasploit.com/download
85+
data/meterpreter/ext_server_pivot.*.dll

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
--color
22
--format Fivemat
3+
--require spec_helper

.rubocop.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This list was intially created by analyzing the last three months (51
2+
# modules) committed to Metasploit Framework. Many, many older modules
3+
# will have offenses, but this should at least provide a baseline for
4+
# new modules.
5+
#
6+
# Updates to this file should include a 'Description' parameter for any
7+
# explaination needed.
8+
9+
# inherit_from: .rubocop_todo.yml
10+
11+
Metrics/ClassLength:
12+
Description: 'Most Metasploit modules are quite large. This is ok.'
13+
Enabled: true
14+
Exclude:
15+
- 'modules/**/*'
16+
17+
Style/Documentation:
18+
Enabled: true
19+
Description: 'Most Metasploit modules do not have class documentation.'
20+
Exclude:
21+
- 'modules/**/*'
22+
23+
Style/Encoding:
24+
Enabled: true
25+
Description: 'We prefer binary to UTF-8.'
26+
EnforcedStyle: 'when_needed'
27+
28+
Metrics/LineLength:
29+
Description: >-
30+
Metasploit modules often pattern match against very
31+
long strings when identifying targets.
32+
Enabled: true
33+
Max: 180
34+
35+
Metrics/MethodLength:
36+
Enabled: true
37+
Description: >-
38+
While the style guide suggests 10 lines, exploit definitions
39+
often exceed 200 lines.
40+
Max: 300
41+
42+
# Basically everything in metasploit needs binary encoding, not UTF-8.
43+
# Disable this here and enforce it through msftidy
44+
Style/Encoding:
45+
Enabled: false
46+
47+
# %q() is super useful for long strings split over multiple lines and
48+
# is very common in module constructors for things like descriptions
49+
Style/UnneededPercentQ:
50+
Enabled: false
51+
52+
Style/NumericLiterals:
53+
Enabled: false
54+
Description: 'This often hurts readability for exploit-ish code.'
55+
56+
Style/SpaceInsideBrackets:
57+
Enabled: false
58+
Description: 'Until module template are final, most modules will fail this.'
59+
60+
Style/StringLiterals:
61+
Enabled: false
62+
Description: 'Single vs double quote fights are largely unproductive.'
63+
64+
Style/WordArray:
65+
Enabled: false
66+
Description: 'Metasploit prefers consistent use of []'
67+
68+
Style/RedundantBegin:
69+
Exclude:
70+
# this pattern is very common and somewhat unavoidable
71+
# def run_host(ip)
72+
# begin
73+
# ...
74+
# rescue ...
75+
# ...
76+
# ensure
77+
# disconnect
78+
# end
79+
# end
80+
- 'modules/**/*'
81+
82+
Documentation:
83+
Exclude:
84+
- 'modules/**/*'

.ruby-version

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

.simplecov

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ SimpleCov.configure do
3939
# Other library groups
4040
#
4141

42-
add_group 'Fastlib', 'lib/fastlib'
4342
add_group 'Metasm', 'lib/metasm'
4443
add_group 'PacketFu', 'lib/packetfu'
4544
add_group 'Rex', 'lib/rex'

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
env:
2+
- RAKE_TASK=cucumber
3+
- RAKE_TASK=cucumber:boot
4+
- RAKE_TASK=spec SPEC_OPTS="--tag content"
5+
- RAKE_TASK=spec SPEC_OPTS="--tag ~content"
6+
17
language: ruby
28
before_install:
39
- rake --version
@@ -14,10 +20,11 @@ before_script:
1420
- bundle exec rake --version
1521
- bundle exec rake db:create
1622
- bundle exec rake db:migrate
23+
script: "bundle exec rake $RAKE_TASK"
1724

1825
rvm:
19-
#- '1.8.7'
2026
- '1.9.3'
27+
- '2.1'
2128

2229
notifications:
2330
irc: "irc.freenode.org#msfnotify"

.yardopts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
--exclude \.ut\.rb/
44
--exclude \.ts\.rb/
55
--files CONTRIBUTING.md,COPYING,HACKING,LICENSE
6+
app/**/*.rb
67
lib/msf/**/*.rb
8+
lib/metasploit/**/*.rb
79
lib/rex/**/*.rb
10+
plugins/**/*.rb

CONTRIBUTING.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
Thanks for your interest in making Metasploit -- and therefore, the
44
world -- a better place!
55

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.
6+
Are you about to report a bug? Sorry to hear it.
97

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.
8+
Here's our [Issue tracker](https://github.com/rapid7/metasploit-framework/issues).
9+
Please try to be as specific as you can about your problem, include steps
10+
to reproduce (cut and paste from your console output if it's helpful), and
11+
what you were expecting to happen.
12+
13+
Are you about to report a security vulnerability in Metasploit itself?
14+
How ironic! Please take a look at Rapid7's [Vulnerability
15+
Disclosure Policy](https://www.rapid7.com/disclosure.jsp), and send
16+
your report to [email protected] using [our PGP key](http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x2380F85B8AD4DB8D).
1317

1418
Are you about to contribute some new functionality, a bug fix, or a new
1519
Metasploit module? If so, read on...
@@ -33,6 +37,7 @@ and Metasploit's [Common Coding Mistakes](https://github.com/rapid7/metasploit-f
3337
## Code Contributions
3438

3539
* **Do** stick to the [Ruby style guide](https://github.com/bbatsov/ruby-style-guide).
40+
* *Do* get [Rubocop](https://rubygems.org/search?query=rubocop) relatively quiet against the code you are adding or modifying.
3641
* **Do** follow the [50/72 rule](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for Git commit messages.
3742
* **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`.
3843

@@ -63,18 +68,14 @@ Pull requests [#2940](https://github.com/rapid7/metasploit-framework/pull/2940)
6368
#### Bug Fixes
6469

6570
* **Do** include reproduction steps in the form of verification steps.
66-
* **Do** include a link to the corresponding [Redmine](https://dev.metasploit.com/redmine/projects/framework) issue in the format of `SeeRM #1234` in your commit description.
71+
* **Do** include a link to any corresponding [Issue](https://github.com/rapid7/metasploit-framework/issues) in the format of `See #1234` in your commit description.
6772

6873
## Bug Reports
6974

7075
* **Do** report vulnerabilities in Rapid7 software directly to [email protected].
71-
* **Do** create a Redmine account and report your non-vulnerability bugs there.
7276
* **Do** write a detailed description of your bug and use a descriptive title.
7377
* **Do** include reproduction steps, stack traces, and anything else that might help us verify and fix your bug.
7478
* **Don't** file duplicate reports - search for your bug before filing a new report.
75-
* **Don't** report a bug on GitHub. Use [Redmine](https://dev.metasploit.com/redmine/projects/framework) instead.
76-
77-
Redmine issues [#8762](https://dev.metasploit.com/redmine/issues/8762) and [#8764](https://dev.metasploit.com/redmine/issues/8764) are a couple good examples to follow.
7879

7980
If you need some more guidance, talk to the main body of open
8081
source contributors over on the [Freenode IRC channel](http://webchat.freenode.net/?channels=%23metasploit&uio=d4)

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2006-2013, Rapid7, Inc.
1+
Copyright (C) 2006-2014, Rapid7, Inc.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

Gemfile

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,48 @@
11
source 'https://rubygems.org'
2-
3-
# Need 3+ for ActiveSupport::Concern
4-
gem 'activesupport', '>= 3.0.0', '< 4.0.0'
5-
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
6-
gem 'bcrypt'
7-
# Needed for some admin modules (scrutinizer_add_user.rb)
8-
gem 'json'
9-
# Needed by msfgui and other rpc components
10-
gem 'msgpack'
11-
# Needed by anemone crawler
12-
gem 'nokogiri'
13-
# Needed by db.rb and Msf::Exploit::Capture
14-
gem 'packetfu', '1.1.9'
15-
# Needed by JSObfu
16-
gem 'rkelly-remix', '0.0.6'
17-
# Needed by anemone crawler
18-
gem 'robots'
19-
# Needed for some post modules
20-
gem 'sqlite3'
2+
# Add default group gems to `metasploit-framework.gemspec`:
3+
# spec.add_runtime_dependency '<name>', [<version requirements>]
4+
gemspec name: 'metasploit-framework'
215

226
group :db do
23-
# Needed for Msf::DbManager
24-
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
25-
# Database models shared between framework and Pro.
26-
gem 'metasploit_data_models', '0.17.0'
27-
# Needed for module caching in Mdm::ModuleDetails
28-
gem 'pg', '>= 0.11'
29-
end
30-
31-
group :pcap do
32-
gem 'network_interface', '~> 0.0.1'
33-
# For sniffer and raw socket modules
34-
gem 'pcaprub'
7+
gemspec name: 'metasploit-framework-db'
358
end
369

3710
group :development do
3811
# Markdown formatting for yard
3912
gem 'redcarpet'
4013
# generating documentation
4114
gem 'yard'
15+
# for development and testing purposes
16+
gem 'pry'
4217
end
4318

4419
group :development, :test do
4520
# supplies factories for producing model instance for specs
4621
# Version 4.1.0 or newer is needed to support generate calls without the
4722
# 'FactoryGirl.' in factory definitions syntax.
4823
gem 'factory_girl', '>= 4.1.0'
24+
# automatically include factories from spec/factories
25+
gem 'factory_girl_rails'
4926
# Make rspec output shorter and more useful
5027
gem 'fivemat', '1.2.1'
5128
# running documentation generation tasks and rspec tasks
5229
gem 'rake', '>= 10.0.0'
30+
# testing framework
31+
gem 'rspec', '>= 2.12', '< 3.0.0'
32+
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
33+
# environment is development
34+
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
35+
end
36+
37+
group :pcap do
38+
gemspec name: 'metasploit-framework-pcap'
5339
end
5440

5541
group :test do
56-
# Removes records from database created during tests. Can't use rspec-rails'
57-
# transactional fixtures because multiple connections are in use so
58-
# transactions won't work.
59-
gem 'database_cleaner'
60-
# testing framework
61-
gem 'rspec', '>= 2.12'
42+
# cucumber extension for testing command line applications, like msfconsole
43+
gem 'aruba'
44+
# cucumber + automatic database cleaning with database_cleaner
45+
gem 'cucumber-rails', :require => false
6246
gem 'shoulda-matchers'
6347
# code coverage for tests
6448
# any version newer than 0.5.4 gives an Encoding error when trying to read the source files.

0 commit comments

Comments
 (0)