From 647d113f5abfc1e425443fcc793f09f958ffd0ea Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Thu, 5 Dec 2024 12:32:50 -0500 Subject: [PATCH] Experimentation hax CI tests go burrrrr --- .../shared_meterpreter_acceptance.yml | 12 +-- spec/support/acceptance/session/java.rb | 74 ++++++++++++++++--- test/modules/post/test/file.rb | 4 + 3 files changed, 74 insertions(+), 16 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index ff1713f0798d6..53462c876be28 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -36,15 +36,15 @@ jobs: java_meterpreter_compilation: name: Compile Java Meterpreter runs-on: ubuntu-latest - if: ${{ inputs.build_metasploit_payloads }} + #if: ${{ inputs.build_metasploit_payloads }} steps: - name: Checkout metasploit-payloads uses: actions/checkout@v4 with: - repository: rapid7/metasploit-payloads + repository: zeroSteiner/metasploit-payloads path: metasploit-payloads - ref: ${{ inputs.metasploit_payloads_commit }} + ref: fix/met/java/symlinks - name: Build Java and Android payloads run: | @@ -187,7 +187,7 @@ jobs: with: repository: zeroSteiner/metasploit-framework path: metasploit-framework - ref: ${{ inputs.metasploit_framework_commit }} + ref: fix/met/java-win-symlink-tests - name: Setup Ruby env: @@ -246,9 +246,9 @@ jobs: if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }} uses: actions/checkout@v4 with: - repository: rapid7/metasploit-payloads + repository: zeroSteiner/metasploit-payloads path: metasploit-payloads - ref: ${{ inputs.metasploit_payloads_commit }} + ref: fix/met/java/symlinks - name: Get metasploit-payloads version if: ${{ inputs.build_metasploit_payloads && matrix.meterpreter.name != 'mettle' }} diff --git a/spec/support/acceptance/session/java.rb b/spec/support/acceptance/session/java.rb index 029ce6e672f06..a2daef35f1b14 100644 --- a/spec/support/acceptance/session/java.rb +++ b/spec/support/acceptance/session/java.rb @@ -35,7 +35,13 @@ module Acceptance::Session reason: "Windows only test" } ], - :windows + [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ] ], skipped: false, lines: { @@ -75,7 +81,13 @@ module Acceptance::Session }, { name: "post/test/cmd_exec", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -91,7 +103,13 @@ module Acceptance::Session }, { name: "post/test/extapi", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -123,7 +141,13 @@ module Acceptance::Session }, { name: "post/test/get_env", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -139,7 +163,13 @@ module Acceptance::Session }, { name: "post/test/meterpreter", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -155,7 +185,13 @@ module Acceptance::Session }, { name: "post/test/railgun", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -171,7 +207,13 @@ module Acceptance::Session }, { name: "post/test/railgun_reverse_lookups", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -202,7 +244,13 @@ module Acceptance::Session reason: "Windows only test" } ], - :windows + [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ] ], skipped: false, lines: { @@ -222,7 +270,13 @@ module Acceptance::Session }, { name: "post/test/search", - platforms: [:linux, :osx, :windows], + platforms: [:linux, :osx, [ + :windows, + { + skip: true, + reason: "Skip while experimenting" + } + ]], skipped: false, lines: { linux: { @@ -245,7 +299,7 @@ module Acceptance::Session :windows, { skip: true, - reason: "Unix only test" + reason: "Skip while experimenting" } ] ], diff --git a/test/modules/post/test/file.rb b/test/modules/post/test/file.rb index db6cf38b96590..a1e116db27e21 100644 --- a/test/modules/post/test/file.rb +++ b/test/modules/post/test/file.rb @@ -80,6 +80,10 @@ def test_dir unless (session.platform == 'windows') || (session.platform != 'windows' && command_exists?('ln')) print_warning('skipping link related checks because the target is incompatible') else + print_status('*' * 50) + print_status("CWD (cmd): #{cmd_exec("cmd.exe /c echo %cd%")}") + print_status("CWD (met): #{session.fs.dir.getwd}") + print_status('*' * 50) it 'should delete a symbolic link target' do # TODO: Fix this functionality if session.platform.eql?('windows') && session.type.eql?('shell')