Skip to content

Commit

Permalink
Builds metasploit-payload gem as part of acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranleese-r7 committed Oct 21, 2024
1 parent 27fa707 commit 1b81111
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/shared_meterpreter_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
- name: Get mettle version
if: ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }}
run: |
echo "METTLE_VERSION=$(grep -oh '[0-9].[0-9].[0-9]*' lib/metasploit_payloads/mettle/version.rb)" | tee -a $GITHUB_ENV
echo "METTLE_VERSION=$(ruby -ne 'puts $& if /[0-9].[0-9].[0-9]*/' lib/metasploit_payloads/mettle/version.rb)" | tee -a $GITHUB_ENV
working-directory: mettle

- name: Prerequisite mettle gem setup
Expand Down Expand Up @@ -251,6 +251,43 @@ jobs:
path: metasploit-payloads
ref: ${{ inputs.metasploit_payloads_commit }}

- name: Get metasploit-payloads version
run: |
echo "METASPLOIT_PAYLOADS_VERSION=$(ruby -ne 'puts $& if /[0-9].[0-9].[0-9]*/' gem/lib/metasploit-payloads/version.rb)" | tee -a $GITHUB_ENV
working-directory: metasploit-payloads

- name: Get metasploit-payloads version - Windows
if: runner.os == 'Windows'
shell: cmd
run: |
echo "METASPLOIT_PAYLOADS_VERSION=$(ruby -ne 'puts $& if /[0-9].[0-9].[0-9]*/' gem/lib/metasploit-payloads/version.rb)" | tee -a $GITHUB_ENV
working-directory: metasploit-payloads

- name: Build metasploit-payloads gem
run: |
gem build ./gem/metasploit-payloads.gemspec
working-directory: metasploit-payloads

- name: Copy metasploit-payloads gem into metasploit-framework - Windows
if: runner.os == 'Windows'
shell: cmd
run: |
copy ..\metasploit-payloads\metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem .
working-directory: metasploit-framework

- name: Copy metasploit-payloads gem into metasploit-framework
run: |
cp ../metasploit-payloads/metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem .
working-directory: metasploit-framework

- name: Install metasploit-payloads gem
run: |
bundle exec gem install metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem
bundle config unset deployment
bundle update metasploit-payloads
bundle install
working-directory: metasploit-framework

- name: Build Windows payloads via Visual Studio 2019 Build (Windows)
shell: cmd
if: ${{ matrix.meterpreter.name == 'windows_meterpreter' && matrix.os == 'windows-2019' && inputs.build_metasploit_payloads }}
Expand Down

0 comments on commit 1b81111

Please sign in to comment.