Skip to content

Commit 4f61710

Browse files
committed
Merge remote-tracking branch 'upstream/master' into psexec_refactor_round2
2 parents 936c708 + 71a6ec8 commit 4f61710

File tree

3,653 files changed

+82748
-40876
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,653 files changed

+82748
-40876
lines changed

.gitignore

Lines changed: 28 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)
@@ -11,10 +13,10 @@
1113
.DS_Store
1214
# database config for testing
1315
config/database.yml
16+
# target config file for testing
17+
features/support/targets.yml
1418
# simplecov coverage data
1519
coverage
16-
data/meterpreter/ext_server_pivot.x86.dll
17-
data/meterpreter/ext_server_pivot.x64.dll
1820
doc/
1921
external/source/meterpreter/java/bin
2022
external/source/meterpreter/java/build
@@ -48,6 +50,30 @@ tags
4850
*.opensdf
4951
*.user
5052

53+
# Rails log directory
54+
/log
55+
# Rails tmp directory
56+
/tmp
57+
5158
# ignore release/debug folders for exploits
5259
external/source/exploits/**/Debug
5360
external/source/exploits/**/Release
61+
62+
# Avoid checking in Meterpreter binaries. These are supplied upstream by
63+
# the meterpreter_bins gem.
64+
data/meterpreter/elevator.*.dll
65+
data/meterpreter/ext_server_espia.*.dll
66+
data/meterpreter/ext_server_extapi.*.dll
67+
data/meterpreter/ext_server_incognito.*.dll
68+
data/meterpreter/ext_server_kiwi.*.dll
69+
data/meterpreter/ext_server_lanattacks.*.dll
70+
data/meterpreter/ext_server_mimikatz.*.dll
71+
data/meterpreter/ext_server_priv.*.dll
72+
data/meterpreter/ext_server_stdapi.*.dll
73+
data/meterpreter/metsrv.*.dll
74+
data/meterpreter/screenshot.*.dll
75+
76+
# Avoid checking in Meterpreter libs that are built from
77+
# private source. If you're interested in this functionality,
78+
# check out Metasploit Pro: http://metasploit.com/download
79+
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: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
Style/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+
Style/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+
Style/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+
Style/NumericLiterals:
48+
Enabled: false
49+
Description: 'This often hurts readability for exploit-ish code.'
50+
51+
Style/SpaceInsideBrackets:
52+
Enabled: false
53+
Description: 'Until module template are final, most modules will fail this.'
54+
55+
Style/StringLiterals:
56+
Enabled: false
57+
Description: 'Single vs double quote fights are largely unproductive.'
58+
59+
Style/WordArray:
60+
Enabled: false
61+
Description: 'Metasploit prefers consistent use of []'
62+
63+
Style/RedundantBegin:
64+
Exclude:
65+
# this pattern is very common and somewhat unavoidable
66+
# def run_host(ip)
67+
# begin
68+
# ...
69+
# rescue ...
70+
# ...
71+
# ensure
72+
# disconnect
73+
# end
74+
# end
75+
- 'modules/**/*'
76+
77+
Documentation:
78+
Exclude:
79+
- 'modules/**/*'

.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: 7 additions & 0 deletions
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,6 +20,7 @@ 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:
1926
#- '1.8.7'

.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: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,58 @@
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
215

226
group :db do
237
# Needed for Msf::DbManager
248
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
9+
10+
# Metasploit::Credential database models
11+
gem 'metasploit-credential', '~> 0.12.0'
2512
# Database models shared between framework and Pro.
26-
gem 'metasploit_data_models', '~> 0.17.0'
13+
gem 'metasploit_data_models', '~> 0.21.1'
2714
# Needed for module caching in Mdm::ModuleDetails
2815
gem 'pg', '>= 0.11'
2916
end
3017

31-
group :pcap do
32-
gem 'network_interface', '~> 0.0.1'
33-
# For sniffer and raw socket modules
34-
gem 'pcaprub'
35-
end
36-
3718
group :development do
3819
# Markdown formatting for yard
3920
gem 'redcarpet'
4021
# generating documentation
4122
gem 'yard'
23+
# for development and testing purposes
24+
gem 'pry'
4225
end
4326

4427
group :development, :test do
4528
# supplies factories for producing model instance for specs
4629
# Version 4.1.0 or newer is needed to support generate calls without the
4730
# 'FactoryGirl.' in factory definitions syntax.
4831
gem 'factory_girl', '>= 4.1.0'
32+
# automatically include factories from spec/factories
33+
gem 'factory_girl_rails'
4934
# Make rspec output shorter and more useful
5035
gem 'fivemat', '1.2.1'
5136
# running documentation generation tasks and rspec tasks
5237
gem 'rake', '>= 10.0.0'
38+
# testing framework
39+
gem 'rspec', '>= 2.12', '< 3.0.0'
40+
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
41+
# environment is development
42+
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
43+
end
44+
45+
group :pcap do
46+
gem 'network_interface', '~> 0.0.1'
47+
# For sniffer and raw socket modules
48+
gem 'pcaprub'
5349
end
5450

5551
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'
52+
# cucumber extension for testing command line applications, like msfconsole
53+
gem 'aruba'
54+
# cucumber + automatic database cleaning with database_cleaner
55+
gem 'cucumber-rails', :require => false
6256
gem 'shoulda-matchers'
6357
# code coverage for tests
6458
# any version newer than 0.5.4 gives an Encoding error when trying to read the source files.

Gemfile.local.example

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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-debugger to step through code during development
31+
gem 'pry-debugger', '~> 0.2'
32+
# Add the lab gem so that the 'lab' plugin will work again
33+
gem 'lab', '~> 0.2.7'
34+
end

0 commit comments

Comments
 (0)