Repository navigation
fix session-id lookup when sessions.list uses int keys - #11
Merged
Merged
Conversation
pymetasploit3 returns sessions.list with integer keys, which caused string-based session lookups to fail and falsely report live sessions as missing. Normalize session keys once and add regression coverage for send/terminate flows. Made-with: Cursor
Handle a pymetasploit3 regression where SessionManager.session() raises KeyError for live sessions by falling back to _create_session using normalized string-key maps. Add regression coverage so session command and termination flows remain stable. Made-with: Cursor
Rename tool arguments to canonical msfconsole-style names across module, payload, search, format, and listener bind options so schemas and runtime behavior stay consistent for agents. This removes naming drift and keeps payload compatibility guidance keyed to the current API surface. Made-with: Cursor
Replace run_with_output-based meterpreter execution with a prompt-aware read loop and add a caller-controlled inactivity timeout alongside the existing hard timeout cap. This reduces spurious timeouts for short interactive commands while preserving partial output and clearer completion reasons for callers. Made-with: Cursor
Add GitHub Actions for pull request test validation and automated semantic version bumps on main so releases stay consistent without manual edits. Include a tested bump utility to keep version updates deterministic and auditable. Made-with: Cursor
Scope the required GitHub Action check to the maintained timeout and locking suites plus the new version bump tests so PR gating stays reliable while broader legacy tests are still being reconciled. Made-with: Cursor
Preserve shell-mode state after `shell` so subsequent commands use shell prompt/inactivity handling instead of meterpreter command parsing. Also include regression fixes for payload staging metadata, exploit job error surfacing, and hidden internal timeout params in inspect signatures. Made-with: Cursor
Apply inactivity-timeout signature filtering against the underlying callable when tools are wrapped, preventing import-time TypeError on newer FastMCP/pytest stacks. Made-with: Cursor
setuidloot
pushed a commit
that referenced
this pull request
Apr 29, 2026
fix session-id lookup when sessions.list uses int keys
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.
Summary
client.sessions.listkeys to strings before session existence checksTest plan
python3 -m pytest tests/test_session_locking.py -qsend_session_commandin container to confirm behavior in live RPCMade with Cursor