Skip to content

Commit b3a596a

Browse files
committed
Adds mettle gem artifact
1 parent 39b7aa8 commit b3a596a

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/shared_meterpreter_acceptance.yml

+25-13
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ on:
3030
type: boolean
3131

3232
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
3434
# host environment (i.e. for macos). So it instead gets compiled first on a linux
3535
# 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
3838
runs-on: ubuntu-latest
3939
if: ${{ inputs.build_metasploit_payloads }}
4040

@@ -46,22 +46,22 @@ jobs:
4646
path: metasploit-payloads
4747
ref: mega-testing-branch-meterpreter-resolve-multiple-hosts
4848

49-
- name: Build Meterpreter payloads
49+
- name: Build metasploit-payloads
5050
run: |
51-
mkdir $(pwd)/meterpreter-artifacts
51+
mkdir $(pwd)/metasploit-payloads-artifacts
5252
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
5454
55-
- name: Store Meterpreter artifacts
55+
- name: Store metasploit-payloads artifacts
5656
uses: actions/upload-artifact@v4
5757
with:
58-
name: meterpreter-artifacts
59-
path: meterpreter-artifacts
58+
name: metasploit-payloads-artifacts
59+
path: metasploit-payloads-artifacts
6060

6161
# Run all test individually, note there is a separate final job for aggregating the test results
6262
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')
6565

6666
strategy:
6767
fail-fast: false
@@ -172,17 +172,29 @@ jobs:
172172
- name: Compile mettle payloads
173173
if: ${{ matrix.meterpreter.name == 'mettle' && runner.os != 'macos' && inputs.build_mettle }}
174174
run: |
175+
mkdir $(pwd)/mettle-artifacts
175176
docker run --rm=true --tty --volume=$(pwd):/mettle --workdir=/mettle rapid7/build:mettle rake mettle:build mettle:check
176177
rake build
178+
cp $(pwd)/pkg/metasploit_payloads-mettle-* $(pwd)/mettle-artifacts
177179
working-directory: mettle
178180

179181
- name: Compile mettle payloads - macOS
180182
if: ${{ matrix.meterpreter.name == 'mettle' && runner.os == 'macos' && inputs.build_mettle }}
181183
run: |
184+
mkdir $(pwd)/mettle-artifacts
182185
make TARGET=x86_64-apple-darwin
183186
rake build
187+
cp $(pwd)/pkg/metasploit_payloads-mettle-* $(pwd)/mettle-artifacts
188+
pwd
189+
ls -la
184190
working-directory: mettle
185191

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+
186198
- name: Checkout metasploit-framework commit
187199
uses: actions/checkout@v4
188200
with:
@@ -222,15 +234,15 @@ jobs:
222234
run: |
223235
set -x
224236
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
226238
227239
- name: Extract Meterpreter (Windows)
228240
if: ${{ matrix.meterpreter.name != 'mettle' && runner.os == 'Windows' && inputs.build_metasploit_payloads }}
229241
shell: bash
230242
run: |
231243
set -x
232244
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
234246
235247
- name: Install mettle gem
236248
if: ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }}

0 commit comments

Comments
 (0)