Feat/ci/pyenv python tests - #21747
Merged
adfoster-r7 merged 7 commits intoAug 5, 2026
Merged
Conversation
…lers Started reverse/bind TCP/SSL/UDP handler messages were only partially matched, blocking acceptance test support for bind and UDP payloads.
Pure rename, no behavior change. Consolidates all Python command shell acceptance fixtures (SSL and, in a following commit, non-SSL) into a single file rather than splitting them by SSL-support across two.
…cp, cmd/unix/reverse_python)
Depends on rapid7/metasploit-framework/pyenv-image PR: this references ghcr.io/rapid7/metasploit-framework/pyenv@sha256:bc3398ad..., which does not exist until that PR is merged and its publish workflow is run against upstream for real. Validated against the identical digest published to the zeroSteiner/metasploit-framework fork (build, GHCR push, anonymous pull, and all eight python_ssl_* examples passing locally) before pointing the reference at rapid7. Also bumps the PYTHON_SSL_3_13 pyenv version pin from 3.13.7 to 3.13.13 to match what's actually installed by the Containerfile; the old pin only worked against the previous ECR image built from an older revision of the source.
zeroSteiner
force-pushed
the
feat/ci/pyenv-python-tests
branch
from
August 4, 2026 14:18
217661c to
4f3da91
Compare
adfoster-r7
reviewed
Aug 5, 2026
Contributor
There was a problem hiding this comment.
Replaced this workflow with internal jenkins and dockerhub
adfoster-r7
marked this pull request as ready for review
August 5, 2026 16:11
adfoster-r7
approved these changes
Aug 5, 2026
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.
Description
Draft -- depends on #21746 (adds
test/pyenv/Containerfileand thepyenv_image_publish.ymlGHCR publish workflow). This branch is stacked on that one, so the diff below includes its commits until it merges -- the new work here starts at "Extend command shell handler-started regex...".Expands
command_shell_spec.rbacceptance coverage to non-SSL Python shell payloads that weren't previously tested:python/shell_reverse_tcp,python/shell_bind_tcp, andcmd/unix/reverse_python.python/shell_bind_tcprequired extending the handler-started regex to recognize bind/UDP handler messages (it previously only matched reverse TCP/SSL).Also merges
spec/support/acceptance/command_shell/python_ssl.rbintopython.rbso all Python command shell fixtures (SSL and non-SSL) live in one file instead of being split by SSL-support across two, and points the existingpython_ssl_*tests at the GHCR image published by the sibling PR instead of the personal ECR image.python/shell_reverse_sctpandpython/shell_reverse_udpare intentionally not covered here. UDP in particular was attempted and dropped:post/test/unixconsistently failed against it locally, traced to the payload's lock-step send/recv protocol having no retry on packet loss, which doesn't play well with the shell session's read-timeout budget. That looks like a pre-existing reliability gap in the payload/handler, not something introduced by this PR, but it's out of scope to fix here.Related Issue:
Breaking Changes
None.
python_ssl.rbis removed but every constant it exported (PYTHON_SSL_IMAGE,PYTHON_SSL_2_6,PYTHON_SSL_2_7,PYTHON_SSL_3_4,PYTHON_SSL_3_13) still exists, now inpython.rb-- nothing external references the file path directly, only the auto-loaded constants.Reviewer Notes
masterfor real. ThePYTHON_SSL_IMAGEconstant currently points atghcr.io/rapid7/metasploit-framework/pyenv@sha256:bc3398ad96f06ac4c9f2a371488b7b75c60eaaa37531da1dcf98ce47b5191fb7, which does not exist yet. I'll update that digest myself once the real image is published, and re-run the verification command below to confirm before marking this ready for review.ghcr.io/zerosteiner/metasploit-framework/pyenv@...) as part of proving the sibling PR's publish workflow end-to-end, and all eightpython_ssl_*examples pass locally against that fork-hosted copy. Only the finalrapid7-owned digest is unverified, and only because it doesn't exist yet.PYTHON_SSL_3_13was pinned toPYENV_VERSION=3.13.7, but the Containerfile (sibling PR, copied from a private source unchanged) only installs3.13.13. The old ECR image apparently predates that patch bump. Updated the pin to match -- otherwise everypython_ssl_3_13job would fail against the new image.python_ssl.rb->python.rbmerge is its own commit with zero behavior change (puregit mv+ constant consolidation) -- worth reviewing separately from the commit that adds the new non-SSL payloads, if that's easier to follow.Verification Steps
Requires
dockerorpodman. Therapid7-hosted image isn't published yet, so temporarily pointPYTHON_SSL_IMAGEinspec/support/acceptance/command_shell/python.rbatghcr.io/zerosteiner/metasploit-framework/pyenv@sha256:bc3398ad96f06ac4c9f2a371488b7b75c60eaaa37531da1dcf98ce47b5191fb7(the fork-hosted copy I validated this against) before running:Expected: all
linux,python, andpython_ssl_*examples pass. (Once the sibling PR's image is published for real, that temporary edit won't be needed -- the committedrapid7reference will just work.)Test Evidence
Environment
ubuntu-latest(GitHub Actions runner)test/pyenv/Containerfile(from the sibling image-publish PR)AI Usage Disclosure
Claude Code was used throughout this branch: the file consolidation, the new acceptance test fixtures, the regex/datastore changes, and running/iterating on local acceptance test validation before each commit.
Pre-Submission Checklist
documentation/modules(new modules only)lib/changes)Hardware and Complex Software Module Guidance
If your module targets specialized hardware (routers, IoT, PLCs, etc.) or complex software (licensed, multi-service, or multi-version), provide a pcap, screen recording, or video showing successful execution.
Email sanitized pcaps/recordings to msfdev@metasploit.com — remove real IPs, credentials, and hostnames before sending. If hardware/software is unavailable, explain in the PR description.
Responsiveness and PR Takeover Policy
We want every contribution to make it into the project. If approximately 2 weeks pass after a review request without a comment or code update from you, the team may take over the PR and complete the work on your behalf.
If this happens, you will remain credited as a co-author on the final commit — your contribution is always recognized.
This policy exists to keep the project moving forward. It is not a reflection on the quality of your work or your involvement. Life happens, and we would rather finish the work together than let a good contribution go stale.