[DRAFT] Add malleablec2 tests - #21660
Merged
adfoster-r7 merged 2 commits intoJul 18, 2026
Merged
Conversation
cgranleese-r7
force-pushed
the
add-malleable-profile-tests
branch
5 times, most recently
from
July 9, 2026 15:09
ecd4413 to
933937c
Compare
cgranleese-r7
commented
Jul 9, 2026
cgranleese-r7
force-pushed
the
add-malleable-profile-tests
branch
from
July 10, 2026 13:00
933937c to
604ca99
Compare
adfoster-r7
force-pushed
the
add-malleable-profile-tests
branch
from
July 17, 2026 18:12
604ca99 to
51ce275
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds MalleableC2 fixture profiles and expands the meterpreter acceptance and unit test suites to exercise the new MALLEABLEC2 option across multiple runtimes, while also adjusting meterpreter file reading behavior and CI timeouts to reduce flakiness.
Changes:
- Add MalleableC2 parser specs plus two profile fixtures used by both unit and acceptance testing.
- Expand acceptance payload matrices (Windows/PHP/Python/Java/Mettle) to include reverse_http(s) payloads configured with
MALLEABLEC2, and improve acceptance output labeling/skip controls. - Update meterpreter file reading to avoid premature EOF behavior (notably in PHP meterpreter over TCP) and increase the meterpreter acceptance workflow timeout.
Impact Analysis:
- Blast radius: medium — affects all modules using
Msf::Post::File#read_fileon meterpreter sessions, plus CI behavior for meterpreter acceptance workflows. - Data and contract effects: no schema/serialization changes identified; read semantics may change for edge cases where
fd.readcan return empty/nil, but intent is to improve correctness (avoid partial reads). - Rollback and test focus: rollback is straightforward (revert the read loop / workflow timeout); focus testing on meterpreter file read/write post modules (especially PHP meterpreter) and acceptance handler startup for reverse_http(s) payloads.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/support/acceptance/session/windows_meterpreter.rb | Adds reverse_http(s) Windows meterpreter acceptance payloads using MalleableC2 fixtures. |
| spec/support/acceptance/session/python.rb | Adds reverse_http(s) Python meterpreter acceptance payloads using MalleableC2 fixtures. |
| spec/support/acceptance/session/php.rb | Adds reverse_http(s) PHP meterpreter acceptance payloads using MalleableC2 fixtures and updates known-failures expectations. |
| spec/support/acceptance/session/mettle.rb | Adds reverse_http(s) mettle acceptance payloads using MalleableC2 fixtures. |
| spec/support/acceptance/session/java.rb | Adds reverse_http(s) Java meterpreter acceptance payloads using MalleableC2 fixtures. |
| spec/lib/msf/core/payload/malleable_c2_spec.rb | Introduces unit tests for the MalleableC2 parser and URIs extraction using fixtures. |
| spec/file_fixtures/malleable_c2/minimal_uris_headers.profile | Adds a minimal profile fixture exercising custom URIs and headers. |
| spec/file_fixtures/malleable_c2/base64_transforms.profile | Adds a profile fixture exercising base64 + prepend/append transforms. |
| spec/acceptance/meterpreter_spec.rb | Updates handler-start regex for reverse_http(s), improves test naming, and adds per-payload module-test skip support. |
| lib/msf/core/post/file.rb | Changes meterpreter file reads to chunk-loop until nil/empty to avoid premature EOF issues. |
| .github/workflows/shared_meterpreter_acceptance.yml | Increases meterpreter acceptance job timeout to accommodate expanded acceptance coverage. |
adfoster-r7
force-pushed
the
add-malleable-profile-tests
branch
from
July 17, 2026 21:24
51ce275 to
5e68cf0
Compare
adfoster-r7
marked this pull request as ready for review
July 17, 2026 21:26
adfoster-r7
force-pushed
the
add-malleable-profile-tests
branch
2 times, most recently
from
July 17, 2026 23:34
be2baf3 to
fe12bb2
Compare
adfoster-r7
force-pushed
the
add-malleable-profile-tests
branch
from
July 17, 2026 23:35
fe12bb2 to
e981246
Compare
Contributor
|
Old Release Notes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
In draft until 6.5 is green
Description
PR to add tests for the new MalleableC2 work. I wanted to add some tests to cover future regressions and update the existing tests suite to now have some additional payloads that use the new option.
Breaking Changes
None
Reviewer Notes
This likely wont pass until other PRs and merged into 6.5. #21656 for sure needs to be in the 6.5 tree before this will pass.
Verification Steps
Test Evidence
N/A
Environment
AI Usage Disclosure
Kiro
Pre-Submission Checklist
documentation/modules(new modules only)lib/changes)