Skip to content

Commit 38e6576

Browse files
committed
Update
2 parents fd40a68 + da0950d commit 38e6576

File tree

486 files changed

+27674
-21586
lines changed

Some content is hidden

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

486 files changed

+27674
-21586
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ tags
4848
*.opensdf
4949
*.user
5050

51+
# Rails log directory
52+
/log
53+
5154
# ignore release/debug folders for exploits
5255
external/source/exploits/**/Debug
5356
external/source/exploits/**/Release

.rubocop.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,56 @@
1-
LineLength:
2-
Enabled: true
3-
Max: 180
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.
48

5-
MethodLength:
6-
Enabled: true
7-
Max: 100
9+
# inherit_from: .rubocop_todo.yml
810

911
Style/ClassLength:
12+
Description: 'Most Metasploit modules are quite large. This is ok.'
13+
Enabled: true
1014
Exclude:
11-
# Most modules are quite large and all contained in one class. This is OK.
1215
- 'modules/**/*'
1316

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+
1442
Style/NumericLiterals:
1543
Enabled: false
44+
Description: 'This often hurts readability for exploit-ish code.'
1645

17-
Documentation:
18-
Exclude:
19-
- 'modules/**/*'
46+
Style/SpaceInsideBrackets:
47+
Enabled: false
48+
Description: 'Until module template are final, most modules will fail this.'
49+
50+
Style/StringLiterals:
51+
Enabled: false
52+
Description: 'Single vs double quote fights are largely unproductive.'
53+
54+
Style/WordArray:
55+
Enabled: false
56+
Description: 'Metasploit prefers consistent use of []'

.yardopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +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
810
plugins/**/*.rb

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ and Metasploit's [Common Coding Mistakes](https://github.com/rapid7/metasploit-f
3333
## Code Contributions
3434

3535
* **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
36+
* *Do* get [Rubocop](https://rubygems.org/search?query=rubocop) relatively quiet against the code you are adding or modifying.
3737
* **Do** follow the [50/72 rule](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for Git commit messages.
3838
* **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`.
3939

Gemfile

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,53 @@
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 for Meterpreter on Windows, soon others.
10-
gem 'meterpreter_bins', '0.0.6'
11-
# Needed by msfgui and other rpc components
12-
gem 'msgpack'
13-
# Needed by anemone crawler
14-
gem 'nokogiri'
15-
# Needed by db.rb and Msf::Exploit::Capture
16-
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'
2+
# Add default group gems to `metasploit-framework.gemspec`:
3+
# spec.add_runtime_dependency '<name>', [<version requirements>]
4+
gemspec
235

246
group :db do
257
# Needed for Msf::DbManager
268
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
9+
# Metasploit::Credential database models
10+
gem 'metasploit-credential', '>= 0.9.0'
2711
# Database models shared between framework and Pro.
28-
gem 'metasploit_data_models', '0.17.0'
12+
gem 'metasploit_data_models', '~> 0.19'
2913
# Needed for module caching in Mdm::ModuleDetails
3014
gem 'pg', '>= 0.11'
3115
end
3216

33-
group :pcap do
34-
gem 'network_interface', '~> 0.0.1'
35-
# For sniffer and raw socket modules
36-
gem 'pcaprub'
37-
end
38-
3917
group :development do
40-
# Style/sanity checking Ruby code
41-
gem 'rubocop'
4218
# Markdown formatting for yard
4319
gem 'redcarpet'
4420
# generating documentation
4521
gem 'yard'
22+
# for development and testing purposes
23+
gem 'pry'
4624
end
4725

4826
group :development, :test do
4927
# supplies factories for producing model instance for specs
5028
# Version 4.1.0 or newer is needed to support generate calls without the
5129
# 'FactoryGirl.' in factory definitions syntax.
5230
gem 'factory_girl', '>= 4.1.0'
31+
# automatically include factories from spec/factories
32+
gem 'factory_girl_rails'
5333
# Make rspec output shorter and more useful
5434
gem 'fivemat', '1.2.1'
5535
# running documentation generation tasks and rspec tasks
5636
gem 'rake', '>= 10.0.0'
37+
# testing framework
38+
gem 'rspec', '>= 2.12', '< 3.0.0'
39+
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
40+
# environment is development
41+
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
42+
end
43+
44+
group :pcap do
45+
gem 'network_interface', '~> 0.0.1'
46+
# For sniffer and raw socket modules
47+
gem 'pcaprub'
5748
end
5849

5950
group :test do
60-
# Removes records from database created during tests. Can't use rspec-rails'
61-
# transactional fixtures because multiple connections are in use so
62-
# transactions won't work.
63-
gem 'database_cleaner'
64-
# testing framework
65-
gem 'rspec', '>= 2.12'
6651
gem 'shoulda-matchers'
6752
# code coverage for tests
6853
# any version newer than 0.5.4 gives an Encoding error when trying to read the source files.

Gemfile.local.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ end
2727

2828
# Create a custom group
2929
group :local do
30-
# Use pry to help view and interact with objects in the framework
31-
gem 'pry', '~> 0.9'
3230
# Use pry-debugger to step through code during development
3331
gem 'pry-debugger', '~> 0.2'
3432
# Add the lab gem so that the 'lab' plugin will work again

0 commit comments

Comments
 (0)