Skip to content

Commit

Permalink
Merge branch 'master' into fix_bugs_in_credentials_collection_enumera…
Browse files Browse the repository at this point in the history
…tor_and_refacto
  • Loading branch information
cgranleese-r7 authored Feb 10, 2025
2 parents 7612b31 + 300e99d commit ab0aef7
Show file tree
Hide file tree
Showing 416 changed files with 44,849 additions and 5,354 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/command_shell_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- windows-2019
- ubuntu-20.04
ruby:
- 3.1.5
- '3.2'
include:
# Powershell
- { command_shell: { name: powershell }, os: windows-2019 }
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Ensures that the docs site builds successfully. Note that this workflow does not deploy the docs site.
build:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 60

strategy:
fail-fast: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ldap_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
jobs:
ldap:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

strategy:
fail-fast: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
jobs:
msftidy:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 60

env:
BUNDLE_WITHOUT: "coverage development pcap"
Expand All @@ -38,7 +38,7 @@ jobs:
fail-fast: true
matrix:
ruby:
- '3.1'
- '3.2'

name: Lint msftidy
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mssql_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
jobs:
mssql:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

services:
mssql:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mysql_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
jobs:
mysql:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

services:
mysql:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/postgres_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
jobs:
postgres:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

services:
postgres:
Expand All @@ -54,7 +54,7 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-cmd "pg_isready --username postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
Expand Down
108 changes: 55 additions & 53 deletions .github/workflows/shared_meterpreter_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ on:
type: boolean

jobs:
# Compile Java Meterpreter via docker if required, we can't always do this on the
# Compile the Meterpreter payloads via docker if required, we can't always do this on the
# host environment (i.e. for macos). So it instead gets compiled first on a linux
# host, then the artifacts are copied back to the host later
java_meterpreter_compilation:
name: Compile Java Meterpreter
meterpreter_compilation:
name: Compile Meterpreter
runs-on: ubuntu-latest
if: ${{ inputs.build_metasploit_payloads }}

Expand All @@ -46,21 +46,22 @@ jobs:
path: metasploit-payloads
ref: ${{ inputs.metasploit_payloads_commit }}

- name: Build Java and Android payloads
- name: Build Meterpreter payloads
run: |
mkdir $(pwd)/java-artifacts
docker run --rm -w "$(pwd)" -v "$(pwd):$(pwd)" rapid7/msf-ubuntu-x64-meterpreter:latest /bin/bash -c "set -x && cd metasploit-payloads/java && mvn package -Dandroid.sdk.path=/usr/local/android-sdk -Dandroid.release=true -Ddeploy.path=../../java-artifacts -Dmaven.test.skip=true -P deploy && mvn -Dmaven.test.skip=true -Ddeploy.path=../../java-artifacts -P deploy package"
mkdir $(pwd)/meterpreter-artifacts
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"
cp $(pwd)/metasploit-payloads/gem/pkg/metasploit-payloads-* $(pwd)/meterpreter-artifacts
- name: Store Java artifacts
- name: Store Meterpreter artifacts
uses: actions/upload-artifact@v4
with:
name: java-artifacts
path: java-artifacts
name: meterpreter-artifacts
path: meterpreter-artifacts

# Run all test individually, note there is a separate final job for aggregating the test results
test:
needs: java_meterpreter_compilation
if: always() && (needs.java_meterpreter_compilation.result == 'success' || needs.java_meterpreter_compilation.result == 'skipped')
needs: meterpreter_compilation
if: always() && (needs.meterpreter_compilation.result == 'success' || needs.meterpreter_compilation.result == 'skipped')

strategy:
fail-fast: false
Expand All @@ -70,7 +71,7 @@ jobs:
- windows-2019
- ubuntu-20.04
ruby:
- 3.1.5
- '3.2'
meterpreter:
# Python
- { name: python, runtime_version: 3.6 }
Expand Down Expand Up @@ -208,28 +209,28 @@ jobs:
working-directory: metasploit-framework

- uses: actions/download-artifact@v4
name: Download Java meterpreter
id: download_java_meterpreter
if: ${{ matrix.meterpreter.name == 'java' && inputs.build_metasploit_payloads }}
name: Download Meterpreter
id: download_meterpreter
if: ${{ matrix.meterpreter.name != 'mettle' && inputs.build_metasploit_payloads }}
with:
# Note: Not specifying a name will download all artifacts from the previous workflow jobs
path: raw-data

- name: Extract Java Meterpreter (Unix)
if: ${{ matrix.meterpreter.name == 'java' && runner.os != 'Windows' && inputs.build_metasploit_payloads }}
- name: Extract Meterpreter (Unix)
if: ${{ matrix.meterpreter.name != 'mettle' && runner.os != 'Windows' && inputs.build_metasploit_payloads }}
shell: bash
run: |
set -x
download_path=${{steps.download_java_meterpreter.outputs.download-path}}
cp -r $download_path/java-artifacts/data/* ./metasploit-framework/data
download_path=${{steps.download_meterpreter.outputs.download-path}}
cp -r $download_path/meterpreter-artifacts/* ./metasploit-framework
- name: Extract Java Meterpreter (Windows)
if: ${{ matrix.meterpreter.name == 'java' && runner.os == 'Windows' && inputs.build_metasploit_payloads }}
- name: Extract Meterpreter (Windows)
if: ${{ matrix.meterpreter.name != 'mettle' && runner.os == 'Windows' && inputs.build_metasploit_payloads }}
shell: bash
run: |
set -x
download_path=$(cygpath -u '${{steps.download_java_meterpreter.outputs.download-path}}')
cp -r $download_path/java-artifacts/data/* ./metasploit-framework/data
download_path=$(cygpath -u '${{steps.download_meterpreter.outputs.download-path}}')
cp -r $download_path/meterpreter-artifacts/* ./metasploit-framework
- name: Install mettle gem
if: ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }}
Expand All @@ -250,32 +251,6 @@ jobs:
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 All @@ -294,12 +269,39 @@ jobs:
make.bat
working-directory: metasploit-payloads

- name: Build PHP, Python and Windows payloads
if: ${{ (matrix.meterpreter.name == 'php' || matrix.meterpreter.name == 'python' || runner.os == 'Windows') && inputs.build_metasploit_payloads }}
run: |
make install-php install-python install-windows
- 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: 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
working-directory: metasploit-framework

- name: Remove metasploit-payloads version from metasploit-framework.gemspec
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' && runner.os != 'Windows' }}
run: |
ruby -pi -e "gsub(/metasploit-payloads', '\d+.\d+.\d+/, 'metasploit-payloads')" metasploit-framework.gemspec
working-directory: metasploit-framework

- name: Remove metasploit-payloads version from metasploit-framework.gemspec (Windows)
if: ${{ inputs.build_metasploit_payloads && (runner.os == 'Windows' && matrix.meterpreter.name != 'windows_meterpreter') && matrix.meterpreter.name != 'mettle' }}
shell: cmd
run: |
ruby -pi.bak -e "gsub(/metasploit-payloads', '\d+.\d+.\d+/, 'metasploit-payloads')" metasploit-framework.gemspec
working-directory: metasploit-framework

- name: Bundle update/install metasploit-payloads gem
if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }}
run: |
bundle config unset deployment
bundle update metasploit-payloads
bundle install
working-directory: metasploit-framework

- name: Acceptance
env:
SPEC_HELPER_LOAD_METASPLOIT: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shared_smb_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
smb:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

strategy:
fail-fast: true
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 60
name: Docker Build
steps:
- name: Checkout code
Expand All @@ -41,7 +41,7 @@ jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 40
timeout-minutes: 60

services:
postgres:
Expand All @@ -51,7 +51,7 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-cmd "pg_isready --username postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
Expand All @@ -60,16 +60,15 @@ jobs:
fail-fast: true
matrix:
ruby:
- '3.1'
- '3.2'
- '3.3'
- '3.4.0-preview2'
- '3.4'
os:
- ubuntu-20.04
- ubuntu-latest
include:
- os: ubuntu-latest
ruby: '3.1'
ruby: '3.2'
test_cmd: 'bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content" MSF_FEATURE_DEFER_MODULE_LOADS=1'
test_cmd:
- bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"
Expand Down
Loading

0 comments on commit ab0aef7

Please sign in to comment.