Skip to content

Resolve additional test failures for c2 branch#21656

Draft
adfoster-r7 wants to merge 1 commit into
rapid7:6.5from
adfoster-r7:patch-additional-c2-errors
Draft

Resolve additional test failures for c2 branch#21656
adfoster-r7 wants to merge 1 commit into
rapid7:6.5from
adfoster-r7:patch-additional-c2-errors

Conversation

@adfoster-r7

Copy link
Copy Markdown
Contributor

Patching additional c2 errors

@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 3 times, most recently from 8955f11 to 5a185c0 Compare July 7, 2026 22:33
@adfoster-r7 adfoster-r7 requested a review from Copilot July 7, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses additional test failures on the C2 branch by adjusting acceptance expectations, expanding payload cache-size consistency coverage, and applying a few payload/CI fixes aimed at stabilizing Meterpreter-related tests across platforms.

Changes:

  • Expanded spec/modules/payloads_spec.rb to cover cached-size consistency for additional Java and PHP Meterpreter payloads.
  • Updated PHP Meterpreter single payloads to include Msf::Sessions::MeterpreterOptions::Php (language-specific options module).
  • Adjusted CI workflows to support building against a configurable metasploit-payloads repository/commit (but currently introduces hardcoded fork/branch usage in meterpreter_acceptance.yml).

Impact Analysis:

  • Blast radius: medium — affects CI signal for Meterpreter acceptance, and alters behavior in shared payload code paths (MachO#sign) used by macOS payload generation.
  • Data and contract effects: low — no schema changes; however, CI contract/inputs behavior is impacted by the hardcoded repo/commit in meterpreter_acceptance.yml.
  • Rollback and test focus: rollback is straightforward (workflow + small library/module changes); prioritize validating Meterpreter acceptance workflows (repo/commit selection + build gating) and macOS Mach-O signing correctness on Linux runners.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/support/acceptance/session/php.rb Removes an OSX known-failure entry for a PHP session acceptance case.
spec/modules/payloads_spec.rb Adds cached-size consistency specs for additional Java and PHP Meterpreter payloads.
modules/payloads/singles/php/meterpreter_reverse_http.rb Switches to PHP-specific Meterpreter options mixin.
modules/payloads/singles/php/meterpreter_reverse_https.rb Switches to PHP-specific Meterpreter options mixin.
lib/rex/proto/http/server.rb Comment-only ASCII punctuation change.
lib/rex/proto/http/request.rb Comment-only change (removes non-ASCII shrug).
lib/msf/core/payload/malleable_c2.rb Comment-only ASCII punctuation changes.
lib/msf/core/payload/macho.rb Preserves original Mach-O bytes and uses them for signing to avoid ruby-macho serialize issues on Linux.
lib/msf/core/payload/java/meterpreter_loader.rb Comment-only ASCII punctuation changes.
lib/msf/core/handler/reverse_http.rb Comment-only ASCII punctuation changes.
lib/msf/base/sessions/mettle_config.rb Comment-only ASCII punctuation change.
.github/workflows/shared_meterpreter_acceptance.yml Adds an input to select the metasploit-payloads repository and tweaks job naming/comments.
.github/workflows/meterpreter_acceptance.yml Changes defaults and (currently) hardcodes a fork/branch + forces builds (needs correction).
.github/workflows/command_shell_acceptance.yml Updates default metasploit-payloads commit to 6.5.
Comments suppressed due to low confidence (1)

.github/workflows/meterpreter_acceptance.yml:69

  • Critical: Problem: The meterpreter_acceptance workflow hardcodes a fork/branch for metasploit-payloads and forces payload/mettle builds on every run, ignoring workflow_dispatch inputs and PR labels. Impact: CI will run against non-upstream payload sources and do extra compilation work, making results unreliable and increasing runtime/cost. Fix: Pass through the workflow inputs and restore label-gated build flags (and rely on shared workflow defaults for the repo).
  build:
    uses: ./.github/workflows/shared_meterpreter_acceptance.yml
    with:
      metasploit_payloads_repo: adfoster-r7/metasploit-payloads
      metasploit_payloads_commit: update-php-meterpreter-errors
      mettle_commit: ${{ github.event.inputs.mettle_commit || '6.5' }}
      build_metasploit_payloads: true
      build_mettle: true

@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 4 times, most recently from 78333fd to e70625c Compare July 7, 2026 23:48
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch 2 times, most recently from 4433916 to dbb3097 Compare July 8, 2026 09:00
@adfoster-r7 adfoster-r7 force-pushed the patch-additional-c2-errors branch from dbb3097 to 04ae89e Compare July 8, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants