Skip to content

Commit d196ed6

Browse files
author
Pedro Ribeiro
authored
Merge pull request #40 from rapid7/master
aaaa
2 parents 6a1bf4b + 2b96f8e commit d196ed6

File tree

1,174 files changed

+30897
-5541
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,174 files changed

+30897
-5541
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ config/database.yml
3434
# target config file for testing
3535
features/support/targets.yml
3636
# simplecov coverage data
37-
coverage
37+
coverage/
3838
doc/
3939
external/source/meterpreter/java/bin
4040
external/source/meterpreter/java/build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ data/meterpreter/ext_server_pivot.*.dll
8888

8989
# local docker compose overrides
9090
docker-compose.local*
91+
.env
9192

9293
# Ignore python bytecode
9394
*.pyc

.rubocop.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
# inherit_from: .rubocop_todo.yml
1010

11+
AllCops:
12+
TargetRubyVersion: 2.2
13+
1114
Metrics/ClassLength:
1215
Description: 'Most Metasploit modules are quite large. This is ok.'
1316
Enabled: true
@@ -30,12 +33,32 @@ Style/FrozenStringLiteralComment:
3033
Enabled: false
3134
Description: 'We cannot support this yet without a lot of things breaking'
3235

36+
Style/RedundantReturn:
37+
Description: 'This often looks weird when mixed with actual returns, and hurts nothing'
38+
Enabled: false
39+
3340
Style/Documentation:
3441
Enabled: true
3542
Description: 'Most Metasploit modules do not have class documentation.'
3643
Exclude:
3744
- 'modules/**/*'
3845

46+
Layout/IndentHeredoc:
47+
Enabled: false
48+
Description: 'We need to leave this disabled for Ruby 2.2 compat, remove in 2018'
49+
50+
Style/GuardClause:
51+
Enabled: false
52+
Description: 'This often introduces bugs in tested code'
53+
54+
Style/NegatedIf:
55+
Enabled: false
56+
Description: 'This often introduces bugs in tested code'
57+
58+
Style/ConditionalAssignment:
59+
Enabled: false
60+
Description: 'This is confusing for folks coming from other languages'
61+
3962
Style/Encoding:
4063
Enabled: true
4164
Description: 'We prefer binary to UTF-8.'
@@ -69,7 +92,7 @@ Style/NumericLiterals:
6992
Enabled: false
7093
Description: 'This often hurts readability for exploit-ish code.'
7194

72-
Style/SpaceInsideBrackets:
95+
Layout/SpaceInsideBrackets:
7396
Enabled: false
7497
Description: 'Until module template are final, most modules will fail this.'
7598

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.4.2

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@ addons:
1212
language: ruby
1313
rvm:
1414
- '2.2'
15-
- '2.3.4'
16-
- '2.4.1'
15+
- '2.3.5'
16+
- '2.4.2'
1717

1818
env:
1919
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"'
2020
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag ~content"'
2121

2222
matrix:
2323
fast_finish: true
24+
25+
jobs:
26+
# build docker image
2427
include:
25-
- rvm: ruby-head
26-
env: CMD="docker-compose -f $TRAVIS_BUILD_DIR/docker-compose.yml build"
28+
- env: CMD="docker-compose build" DOCKER="true"
29+
# we do not need any setup
30+
before_install: skip
31+
install: skip
32+
before_script: skip
2733
before_install:
2834
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
2935
- rake --version
@@ -42,7 +48,8 @@ before_script:
4248
- git diff --exit-code db/schema.rb
4349
script:
4450
- echo "${CMD}"
45-
- bash -c "${CMD}"
51+
# we need travis_wait because the Docker build job can take longer than 10 minutes
52+
- if [[ "${DOCKER}" == "true" ]]; then echo "Starting Docker build job"; travis_wait 40 "${CMD}"; else bash -c "${CMD}"; fi
4653

4754
notifications:
4855
irc: "irc.freenode.org#msfnotify"

.yardopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--exclude samples/
33
--exclude \.ut\.rb/
44
--exclude \.ts\.rb/
5-
--files CONTRIBUTING.md,COPYING,HACKING,LICENSE
5+
--files CONTRIBUTING.md,COPYING,LICENSE
66
app/**/*.rb
77
lib/msf/**/*.rb
88
lib/metasploit/**/*.rb

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ already way ahead of the curve, so keep it up!
119119
[YARD]:http://yardoc.org
120120
[Issues]:https://github.com/rapid7/metasploit-framework/issues
121121
[Freenode IRC channel]:http://webchat.freenode.net/?channels=%23metasploit&uio=d4
122-
[metasploit-hackers]:https://lists.sourceforge.net/lists/listinfo/metasploit-hackers
122+
[metasploit-hackers]:https://groups.google.com/forum/#!forum/metasploit-hackers

docker/Dockerfile renamed to Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
FROM ruby:2.4.1-alpine
2-
MAINTAINER Rapid7
1+
FROM ruby:2.4.2-alpine
2+
LABEL maintainer="Rapid7"
33

44
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
55
ENV APP_HOME /usr/src/metasploit-framework/
66
ENV MSF_USER msf
77
ENV NMAP_PRIVILEGED=""
8+
ENV BUNDLE_IGNORE_MESSAGES="true"
89
WORKDIR $APP_HOME
910

10-
COPY Gemfile* m* Rakefile $APP_HOME
11-
COPY lib $APP_HOME/lib
11+
COPY Gemfile* metasploit-framework.gemspec Rakefile $APP_HOME
12+
COPY lib/metasploit/framework/version.rb $APP_HOME/lib/metasploit/framework/version.rb
13+
COPY lib/metasploit/framework/rails_version_constraint.rb $APP_HOME/lib/metasploit/framework/rails_version_constraint.rb
14+
COPY lib/msf/util/helper.rb $APP_HOME/lib/msf/util/helper.rb
1215

1316
RUN apk update && \
1417
apk add \
@@ -36,18 +39,16 @@ RUN apk update && \
3639
ncurses-dev \
3740
git \
3841
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
42+
&& gem update --system \
43+
&& gem install bundler \
3944
&& bundle install --system $BUNDLER_ARGS \
4045
&& apk del .ruby-builddeps \
4146
&& rm -rf /var/cache/apk/*
4247

43-
# fix for robots gem not readable (known bug)
44-
# https://github.com/rapid7/metasploit-framework/issues/6068
45-
RUN chmod o+r /usr/local/bundle/gems/robots-*/lib/robots.rb
46-
4748
RUN adduser -g msfconsole -D $MSF_USER
4849

4950
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
50-
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip /usr/bin/nmap
51+
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
5152

5253
USER $MSF_USER
5354

Gemfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ source 'https://rubygems.org'
33
# spec.add_runtime_dependency '<name>', [<version requirements>]
44
gemspec name: 'metasploit-framework'
55

6-
# These pull in pre-release gems in order to fix specific issues.
7-
# XXX https://github.com/alexdalitz/dnsruby/pull/134
8-
gem 'dnsruby', git: 'https://github.com/alexdalitz/dnsruby'
9-
10-
# XXX https://github.com/ConnorAtherton/rb-readline/commit/fd882edcd145c26681f9971be5f6675c7f6d1970
11-
gem 'rb-readline', git: 'https://github.com/ConnorAtherton/rb-readline' if [
12-
'x86_64-linux', 'x86-linux', 'darwin'].include?(RUBY_PLATFORM.gsub(/.*darwin.*/, 'darwin'))
13-
146
# separate from test as simplecov is not run on travis-ci
157
group :coverage do
168
# code coverage for tests
@@ -26,9 +18,11 @@ group :development do
2618
gem 'pry'
2719
# module documentation
2820
gem 'octokit'
29-
# metasploit-aggregator as a framework only option for now
3021
# Metasploit::Aggregator external session proxy
31-
gem 'metasploit-aggregator'
22+
gem 'metasploit-aggregator' if [
23+
'x86-mingw32', 'x64-mingw32',
24+
'x86_64-linux', 'x86-linux',
25+
'darwin'].include?(RUBY_PLATFORM.gsub(/.*darwin.*/, 'darwin'))
3226
end
3327

3428
group :development, :test do

0 commit comments

Comments
 (0)