Skip to content

Commit 77e469b

Browse files
author
Corey
committed
merge r7 master
2 parents da86706 + 1b6ac0d commit 77e469b

File tree

98 files changed

+6197
-1763
lines changed

Some content is hidden

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

98 files changed

+6197
-1763
lines changed

.github/workflows/acceptance.yml renamed to .github/workflows/meterpreter_acceptance.yml

Lines changed: 122 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ permissions:
2222
statuses: none
2323

2424
on:
25+
workflow_dispatch:
26+
inputs:
27+
metasploitPayloadsCommit:
28+
description: 'metasploit-payloads branch would like to test'
29+
required: true
30+
default: 'master'
31+
mettleCommit:
32+
description: 'mettle branch you would like to test'
33+
required: true
34+
default: 'master'
2535
push:
2636
branches-ignore:
2737
- gh-pages
@@ -81,10 +91,12 @@ jobs:
8191

8292
runs-on: ${{ matrix.os }}
8393

84-
timeout-minutes: 25
94+
timeout-minutes: 50
8595

8696
env:
8797
RAILS_ENV: test
98+
metasploitPayloadsCommit: ${{ github.event.inputs.metasploitPayloadsCommit || 'master' }}
99+
mettleCommit: ${{ github.event.inputs.mettleCommit|| 'master' }}
88100
HOST_RUNNER_IMAGE: ${{ matrix.os }}
89101
METERPRETER: ${{ matrix.meterpreter.name }}
90102
METERPRETER_RUNTIME_VERSION: ${{ matrix.meterpreter.runtime_version }}
@@ -129,8 +141,58 @@ jobs:
129141
dir %WINDIR%
130142
type %WINDIR%\\system32\\drivers\\etc\\hosts
131143
132-
- name: Checkout code
144+
# The job checkout structure is:
145+
# .
146+
# ├── metasploit-framework
147+
# └── metasploit-payloads (Only if the "payload-testing-branch" GitHub label is applied)
148+
# └── mettle (Only if the "payload-testing-mettle-branch" GitHub label is applied)
149+
150+
- name: Install Docker - macOS
151+
if: ${{ ( matrix.meterpreter.name == 'java') && (runner.os == 'macos' ) && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
152+
run: |
153+
brew install docker
154+
colima delete
155+
colima start --arch x86_64
156+
157+
- name: Checkout mettle
158+
if: ${{ matrix.meterpreter.name == 'mettle' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
159+
uses: actions/checkout@v4
160+
with:
161+
repository: rapid7/mettle
162+
path: mettle
163+
ref: ${{ env.mettleCommit }}
164+
165+
- name: Get mettle version
166+
if: ${{ matrix.meterpreter.name == 'mettle' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
167+
run: |
168+
echo "METTLE_VERSION=$(grep -oh '[0-9].[0-9].[0-9]*' lib/metasploit_payloads/mettle/version.rb)" | tee -a $GITHUB_ENV
169+
working-directory: mettle
170+
171+
- name: Prerequisite mettle gem setup
172+
if: ${{ matrix.meterpreter.name == 'mettle' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
173+
run: |
174+
set -x
175+
ruby -pi.bak -e "gsub(/${{ env.METTLE_VERSION }}/, '${{ env.METTLE_VERSION }}-dev')" lib/metasploit_payloads/mettle/version.rb
176+
working-directory: mettle
177+
178+
- name: Compile mettle payloads
179+
if: ${{ matrix.meterpreter.name == 'mettle' && runner.os != 'macos' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
180+
run: |
181+
docker run --rm=true --tty --volume=$(pwd):/mettle --workdir=/mettle rapid7/build:mettle rake mettle:build mettle:check
182+
rake build
183+
working-directory: mettle
184+
185+
- name: Compile mettle payloads - macOS
186+
if: ${{ matrix.meterpreter.name == 'mettle' && runner.os == 'macos' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
187+
run: |
188+
make TARGET=x86_64-apple-darwin
189+
rake build
190+
working-directory: mettle
191+
192+
- name: Checkout metasploit-framework code
133193
uses: actions/checkout@v4
194+
with:
195+
path: metasploit-framework
134196

135197
- name: Setup Ruby
136198
env:
@@ -140,11 +202,66 @@ jobs:
140202
ruby-version: ${{ matrix.ruby }}
141203
bundler-cache: true
142204
cache-version: 4
205+
working-directory: metasploit-framework
143206
# Github actions with Ruby requires Bundler 2.2.18+
144207
# https://github.com/ruby/setup-ruby/tree/d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c#windows
145208
bundler: 2.2.33
146209

147-
- name: acceptance
210+
- name: Move mettle gem into framework
211+
if: ${{ matrix.meterpreter.name == 'mettle' && (contains(github.event.issue.labels.*.name, 'mettle-testing-branch')) }}
212+
run: |
213+
cp ./mettle/pkg/metasploit_payloads-mettle-${{ env.METTLE_VERSION }}.pre.dev.gem ./metasploit-framework
214+
working-directory: metasploit-framework
215+
216+
- name: Install mettle gem
217+
if: ${{ matrix.meterpreter.name == 'mettle' && (contains(github.event.issue.labels.*.name, 'payload-testing-mettle-branch')) }}
218+
run: |
219+
set -x
220+
bundle exec gem install metasploit_payloads-mettle-${{ env.METTLE_VERSION }}.pre.dev.gem
221+
ruby -pi.bak -e "gsub(/'metasploit_payloads-mettle', '${{ env.METTLE_VERSION }}'/, '\'metasploit_payloads-mettle\', \'${{ env.METTLE_VERSION }}.pre.dev\'')" metasploit-framework.gemspec
222+
bundle config unset deployment
223+
bundle update metasploit_payloads-mettle
224+
bundle install
225+
working-directory: metasploit-framework
226+
227+
- name: Checkout metasploit-payloads
228+
if: contains(github.event.issue.labels.*.name, 'payload-testing-branch')
229+
uses: actions/checkout@v4
230+
with:
231+
repository: rapid7/metasploit-payloads
232+
path: metasploit-payloads
233+
ref: ${{ env.metasploitPayloadsCommit }}
234+
235+
- name: Build Java and Android payloads
236+
if: ${{ (matrix.meterpreter.name == 'java') && (runner.os != 'Windows') && (contains(github.event.issue.labels.*.name, 'payload-testing-branch')) }}
237+
run: |
238+
docker run --rm -w "$(pwd)" -v "$(pwd):$(pwd)" rapid7/msf-ubuntu-x64-meterpreter:latest /bin/bash -c "cd metasploit-payloads/java && make clean && make android && mvn -P deploy package"
239+
240+
- name: Build Windows payloads via Visual Studio 2019 Build (Windows)
241+
shell: cmd
242+
if: ${{ (runner.os == 'Windows') && (matrix.os == 'windows-2019') && (contains(github.event.issue.labels.*.name, 'payload-testing-branch')) }}
243+
run: |
244+
cd c/meterpreter
245+
git submodule init && git submodule update
246+
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat
247+
working-directory: metasploit-payloads
248+
249+
- name: Build Windows payloads via Visual Studio 2022 Build (Windows)
250+
shell: cmd
251+
if: ${{ (runner.os == 'Windows') && (matrix.os == 'windows-2022') && (contains(github.event.issue.labels.*.name, 'payload-testing-branch'))}}
252+
run: |
253+
cd c/meterpreter
254+
git submodule init && git submodule update
255+
make.bat
256+
working-directory: metasploit-payloads
257+
258+
- name: Build PHP, Python and Windows payloads
259+
if: ${{ ((matrix.meterpreter.name == 'php') || (matrix.meterpreter.name == 'python') || (runner.os == 'Windows')) && (contains(github.event.issue.labels.*.name, 'payload-testing-branch'))}}
260+
run: |
261+
make install-php install-python install-windows
262+
working-directory: metasploit-payloads
263+
264+
- name: Acceptance
148265
env:
149266
SPEC_HELPER_LOAD_METASPLOIT: false
150267
SPEC_OPTS: "--tag acceptance --require acceptance_spec_helper.rb --color --format documentation --format AllureRspec::RSpecFormatter"
@@ -157,14 +274,15 @@ jobs:
157274
# Additionally - flakey tests should be fixed or marked as flakey instead of silently retried
158275
run: |
159276
bundle exec rspec spec/acceptance/meterpreter_spec.rb
277+
working-directory: metasploit-framework
160278

161279
- name: Archive results
162280
if: always()
163281
uses: actions/upload-artifact@v4
164282
with:
165283
# Provide a unique artifact for each matrix os, otherwise race conditions can lead to corrupt zips
166284
name: raw-data-${{ matrix.meterpreter.name }}-${{ matrix.meterpreter.runtime_version }}-${{ matrix.os }}
167-
path: tmp/allure-raw-data
285+
path: metasploit-framework/tmp/allure-raw-data
168286

169287
# Generate a final report from the previous test results
170288
report:

.github/workflows/mssql_acceptance.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666
- '3.2'
6767
os:
6868
- ubuntu-latest
69-
docker_image:
70-
- mcr.microsoft.com/mssql/server:2022-latest
71-
- mcr.microsoft.com/mssql/server:2019-latest
69+
docker_image: []
70+
# - mcr.microsoft.com/mssql/server:2022-latest
71+
# - mcr.microsoft.com/mssql/server:2019-latest
7272

7373
env:
7474
RAILS_ENV: test

Gemfile.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
metasploit-framework (6.4.23)
4+
metasploit-framework (6.4.26)
55
aarch64
66
abbrev
77
actionpack (~> 7.0.0)
@@ -190,11 +190,11 @@ GEM
190190
bootsnap (1.18.3)
191191
msgpack (~> 1.2)
192192
bson (5.0.0)
193-
builder (3.2.4)
193+
builder (3.3.0)
194194
byebug (11.1.3)
195195
chunky_png (1.4.0)
196196
coderay (1.1.3)
197-
concurrent-ruby (1.3.1)
197+
concurrent-ruby (1.3.4)
198198
cookiejar (0.3.4)
199199
crass (1.0.6)
200200
csv (3.3.0)
@@ -218,7 +218,7 @@ GEM
218218
http_parser.rb (>= 0.6.0)
219219
em-socksify (0.3.2)
220220
eventmachine (>= 1.0.0.beta.4)
221-
erubi (1.12.0)
221+
erubi (1.13.0)
222222
eventmachine (1.2.7)
223223
factory_bot (6.4.6)
224224
activesupport (>= 5.0.0)
@@ -312,7 +312,7 @@ GEM
312312
mime-types-data (~> 3.2015)
313313
mime-types-data (3.2024.0604)
314314
mini_portile2 (2.8.7)
315-
minitest (5.23.1)
315+
minitest (5.25.1)
316316
mqtt (0.6.0)
317317
msgpack (1.6.1)
318318
multi_json (1.15.0)
@@ -334,7 +334,7 @@ GEM
334334
network_interface (0.0.4)
335335
nexpose (7.3.0)
336336
nio4r (2.7.3)
337-
nokogiri (1.16.5)
337+
nokogiri (1.16.7)
338338
mini_portile2 (~> 2.8.2)
339339
racc (~> 1.4)
340340
nori (2.7.0)
@@ -369,7 +369,7 @@ GEM
369369
public_suffix (5.0.5)
370370
puma (6.4.2)
371371
nio4r (~> 2.0)
372-
racc (1.8.0)
372+
racc (1.8.1)
373373
rack (2.2.9)
374374
rack-protection (3.2.0)
375375
base64 (>= 0.1.0)
@@ -450,22 +450,22 @@ GEM
450450
rex-text (0.2.58)
451451
rex-zip (0.1.5)
452452
rex-text
453-
rexml (3.2.8)
454-
strscan (>= 3.0.9)
453+
rexml (3.3.6)
454+
strscan
455455
rkelly-remix (0.0.7)
456456
rspec (3.13.0)
457457
rspec-core (~> 3.13.0)
458458
rspec-expectations (~> 3.13.0)
459459
rspec-mocks (~> 3.13.0)
460460
rspec-core (3.13.0)
461461
rspec-support (~> 3.13.0)
462-
rspec-expectations (3.13.0)
462+
rspec-expectations (3.13.2)
463463
diff-lcs (>= 1.2.0, < 2.0)
464464
rspec-support (~> 3.13.0)
465465
rspec-mocks (3.13.1)
466466
diff-lcs (>= 1.2.0, < 2.0)
467467
rspec-support (~> 3.13.0)
468-
rspec-rails (6.1.2)
468+
rspec-rails (6.1.4)
469469
actionpack (>= 6.1)
470470
activesupport (>= 6.1)
471471
railties (>= 6.1)
@@ -566,7 +566,7 @@ GEM
566566
xmlrpc (0.3.3)
567567
webrick
568568
yard (0.9.36)
569-
zeitwerk (2.6.15)
569+
zeitwerk (2.6.17)
570570

571571
PLATFORMS
572572
ruby

LICENSE_GEMS

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ bigdecimal, 3.1.8, "ruby, Simplified BSD"
3030
bindata, 2.4.15, "Simplified BSD"
3131
bootsnap, 1.18.3, MIT
3232
bson, 5.0.0, "Apache 2.0"
33-
builder, 3.2.4, MIT
34-
bundler, 2.1.4, MIT
33+
builder, 3.3.0, MIT
34+
bundler, 2.2.3, MIT
3535
byebug, 11.1.3, "Simplified BSD"
3636
chunky_png, 1.4.0, MIT
3737
coderay, 1.1.3, MIT
38-
concurrent-ruby, 1.3.1, MIT
38+
concurrent-ruby, 1.3.4, MIT
3939
cookiejar, 0.3.4, "Simplified BSD"
4040
crass, 1.0.6, MIT
4141
csv, 3.3.0, "ruby, Simplified BSD"
@@ -50,7 +50,7 @@ drb, 2.2.1, "ruby, Simplified BSD"
5050
ed25519, 1.3.0, MIT
5151
em-http-request, 1.1.7, MIT
5252
em-socksify, 0.3.2, MIT
53-
erubi, 1.12.0, MIT
53+
erubi, 1.13.0, MIT
5454
eventmachine, 1.2.7, "ruby, GPL-2.0"
5555
factory_bot, 6.4.6, MIT
5656
factory_bot_rails, 6.4.3, MIT
@@ -86,7 +86,7 @@ memory_profiler, 1.0.1, MIT
8686
metasm, 1.0.5, LGPL-2.1
8787
metasploit-concern, 5.0.2, "New BSD"
8888
metasploit-credential, 6.0.9, "New BSD"
89-
metasploit-framework, 6.4.23, "New BSD"
89+
metasploit-framework, 6.4.26, "New BSD"
9090
metasploit-model, 5.0.2, "New BSD"
9191
metasploit-payloads, 2.0.166, "3-clause (or ""modified"") BSD"
9292
metasploit_data_models, 6.0.3, "New BSD"
@@ -95,7 +95,7 @@ method_source, 1.1.0, MIT
9595
mime-types, 3.5.2, MIT
9696
mime-types-data, 3.2024.0604, MIT
9797
mini_portile2, 2.8.7, MIT
98-
minitest, 5.23.1, MIT
98+
minitest, 5.25.1, MIT
9999
mqtt, 0.6.0, MIT
100100
msgpack, 1.6.1, "Apache 2.0"
101101
multi_json, 1.15.0, MIT
@@ -111,7 +111,7 @@ net-ssh, 7.2.3, MIT
111111
network_interface, 0.0.4, MIT
112112
nexpose, 7.3.0, "New BSD"
113113
nio4r, 2.7.3, "MIT, Simplified BSD"
114-
nokogiri, 1.16.5, MIT
114+
nokogiri, 1.16.7, MIT
115115
nori, 2.7.0, MIT
116116
octokit, 4.25.1, MIT
117117
openssl-ccm, 1.2.3, MIT
@@ -128,7 +128,7 @@ pry, 0.14.2, MIT
128128
pry-byebug, 3.10.1, MIT
129129
public_suffix, 5.0.5, MIT
130130
puma, 6.4.2, "New BSD"
131-
racc, 1.8.0, "ruby, Simplified BSD"
131+
racc, 1.8.1, "ruby, Simplified BSD"
132132
rack, 2.2.9, MIT
133133
rack-protection, 3.2.0, MIT
134134
rack-test, 2.1.0, MIT
@@ -162,13 +162,13 @@ rex-sslscan, 0.1.10, "New BSD"
162162
rex-struct2, 0.1.4, "New BSD"
163163
rex-text, 0.2.58, "New BSD"
164164
rex-zip, 0.1.5, "New BSD"
165-
rexml, 3.2.8, "Simplified BSD"
165+
rexml, 3.3.6, "Simplified BSD"
166166
rkelly-remix, 0.0.7, MIT
167167
rspec, 3.13.0, MIT
168168
rspec-core, 3.13.0, MIT
169-
rspec-expectations, 3.13.0, MIT
169+
rspec-expectations, 3.13.2, MIT
170170
rspec-mocks, 3.13.1, MIT
171-
rspec-rails, 6.1.2, MIT
171+
rspec-rails, 6.1.4, MIT
172172
rspec-rerun, 1.1.0, MIT
173173
rspec-support, 3.13.1, MIT
174174
rubocop, 1.64.1, MIT
@@ -215,4 +215,4 @@ winrm, 2.3.6, "Apache 2.0"
215215
xdr, 3.0.3, "Apache 2.0"
216216
xmlrpc, 0.3.3, "ruby, Simplified BSD"
217217
yard, 0.9.36, MIT
218-
zeitwerk, 2.6.15, MIT
218+
zeitwerk, 2.6.17, MIT

0 commit comments

Comments
 (0)