30
30
type : boolean
31
31
32
32
jobs :
33
- # Compile the Meterpreter payloads via docker if required, we can't always do this on the
33
+ # Compile metasploit- payloads via docker if required, we can't always do this on the
34
34
# host environment (i.e. for macos). So it instead gets compiled first on a linux
35
35
# host, then the artifacts are copied back to the host later
36
- meterpreter_compilation :
37
- name : Compile Meterpreter
36
+ metasploit_payloads_compilation :
37
+ name : Compile metasploit-payloads
38
38
runs-on : ubuntu-latest
39
39
if : ${{ inputs.build_metasploit_payloads }}
40
40
@@ -46,22 +46,22 @@ jobs:
46
46
path : metasploit-payloads
47
47
ref : mega-testing-branch-meterpreter-resolve-multiple-hosts
48
48
49
- - name : Build Meterpreter payloads
49
+ - name : Build metasploit- payloads
50
50
run : |
51
- mkdir $(pwd)/meterpreter -artifacts
51
+ mkdir $(pwd)/metasploit-payloads -artifacts
52
52
docker run --rm -w $(pwd) -v $(pwd):$(pwd) rapid7/msf-ubuntu-x64-meterpreter:latest /bin/bash -c "cd metasploit-payloads/gem && rake create_dir && rake win_copy && rake php_prep && rake java_prep && rake python_prep && rake create_manifest && rake build"
53
- cp $(pwd)/metasploit-payloads/gem/pkg/metasploit-payloads-* $(pwd)/meterpreter -artifacts
53
+ cp $(pwd)/metasploit-payloads/gem/pkg/metasploit-payloads-* $(pwd)/metasploit-payloads -artifacts
54
54
55
- - name : Store Meterpreter artifacts
55
+ - name : Store metasploit-payloads artifacts
56
56
uses : actions/upload-artifact@v4
57
57
with :
58
- name : meterpreter -artifacts
59
- path : meterpreter -artifacts
58
+ name : metasploit-payloads -artifacts
59
+ path : metasploit-payloads -artifacts
60
60
61
61
# Run all test individually, note there is a separate final job for aggregating the test results
62
62
test :
63
- needs : meterpreter_compilation
64
- if : always() && (needs.meterpreter_compilation .result == 'success' || needs.meterpreter_compilation .result == 'skipped')
63
+ needs : metasploit_payloads_compilation
64
+ if : always() && (needs.metasploit_payloads_compilation .result == 'success' || needs.metasploit_payloads_compilation .result == 'skipped')
65
65
66
66
strategy :
67
67
fail-fast : false
@@ -172,17 +172,29 @@ jobs:
172
172
- name : Compile mettle payloads
173
173
if : ${{ matrix.meterpreter.name == 'mettle' && runner.os != 'macos' && inputs.build_mettle }}
174
174
run : |
175
+ mkdir $(pwd)/mettle-artifacts
175
176
docker run --rm=true --tty --volume=$(pwd):/mettle --workdir=/mettle rapid7/build:mettle rake mettle:build mettle:check
176
177
rake build
178
+ cp $(pwd)/pkg/metasploit_payloads-mettle-* $(pwd)/mettle-artifacts
177
179
working-directory : mettle
178
180
179
181
- name : Compile mettle payloads - macOS
180
182
if : ${{ matrix.meterpreter.name == 'mettle' && runner.os == 'macos' && inputs.build_mettle }}
181
183
run : |
184
+ mkdir $(pwd)/mettle-artifacts
182
185
make TARGET=x86_64-apple-darwin
183
186
rake build
187
+ cp $(pwd)/pkg/metasploit_payloads-mettle-* $(pwd)/mettle-artifacts
188
+ pwd
189
+ ls -la
184
190
working-directory : mettle
185
191
192
+ - name : Store Mettle artifacts
193
+ uses : actions/upload-artifact@v4
194
+ with :
195
+ name : mettle-artifacts-{{ matrix.os }}
196
+ path : /Users/runner/work/metasploit-framework/metasploit-framework/mettle/mettle-artifacts
197
+
186
198
- name : Checkout metasploit-framework commit
187
199
uses : actions/checkout@v4
188
200
with :
@@ -222,15 +234,15 @@ jobs:
222
234
run : |
223
235
set -x
224
236
download_path=${{steps.download_meterpreter.outputs.download-path}}
225
- cp -r $download_path/meterpreter -artifacts/* ./metasploit-framework
237
+ cp -r $download_path/metasploit-payloads -artifacts/* ./metasploit-framework
226
238
227
239
- name : Extract Meterpreter (Windows)
228
240
if : ${{ matrix.meterpreter.name != 'mettle' && runner.os == 'Windows' && inputs.build_metasploit_payloads }}
229
241
shell : bash
230
242
run : |
231
243
set -x
232
244
download_path=$(cygpath -u '${{steps.download_meterpreter.outputs.download-path}}')
233
- cp -r $download_path/meterpreter -artifacts/* ./metasploit-framework
245
+ cp -r $download_path/metasploit-payloads -artifacts/* ./metasploit-framework
234
246
235
247
- name : Install mettle gem
236
248
if : ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }}
0 commit comments