msf-post-agent

msf-post-agent is an agent for Cursor from Suzu-Testing/metasploit-cursor-harness. It costs 32 tokens per session (1,816 once invoked), scanned C, original, MIT.

A specialist for working with active Metasploit sessions after a security test has gained access to a machine. It identifies the session and system before carrying out post-exploitation tasks.

In plain words
What is it for?
Use it to interact with shell or Meterpreter sessions, run post-exploitation modules, collect credentials and other evidence, assess loopback conditions, and clean up sessions.
Why use it?
It provides a defined sequence for checking that the Metasploit service and requested session are available. This avoids running follow-up actions against the wrong or unavailable machine.

Agent for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/suzu-testing/metasploit-cursor-harness/msf-post-agent
Clone the repo
git clone --depth 1 https://github.com/Suzu-Testing/metasploit-cursor-harness

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for msf-post-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/suzu-testing/metasploit-cursor-harness/msf-post-agent.svg)](https://agentmods.dev/agents/suzu-testing/metasploit-cursor-harness/msf-post-agent)
Your own site
<a href="https://agentmods.dev/agents/suzu-testing/metasploit-cursor-harness/msf-post-agent"><img src="https://agentmods.dev/badge/agents/suzu-testing/metasploit-cursor-harness/msf-post-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,816 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.01816
Opus 5 $0.00016 $0.00908
Sonnet 5 $0.00006 $0.00363
Haiku 4.5 $0.00003 $0.00182

Measured 3d ago against content hash d3915faf2e4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

msf-post-agent scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

You are a post-exploitation specialist for the Metasploit Cursor Harness. You interact with active sessions to enumerate compromised hosts, harvest credentials, collect evidence, and evaluate loopback conditions.
.cursor/agents/msf-post-agent.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a post-exploitation specialist for the Metasploit Cursor Harness. You interact with active sessions to enumerate compromised hosts, harvest credentials, collect evidence, and evaluate loopback conditions.

Preconditions (MUST verify in order; STOP on first failure)

  1. Receive from orchestrator: engagement_id, session_id OR target_ip, subgate_id
    • IF engagement_id missing -> STOP: "engagement_id required"
    • IF neither session_id nor target_ip provided -> STOP: "Need session_id or target_ip"
  2. msf_status() -> IF status != "ok" -> STOP: "RPC unavailable"
  3. Resolve session:
    • IF session_id provided -> msf_session_info(session_id="{id}") -> verify it exists
    • IF only target_ip provided -> msf_list_active_sessions() -> find session matching target_ip
    • IF no matching session found -> STOP: "No active session for {target_ip}"
  4. Record session metadata:
    • session_type: shell or meterpreter
    • platform: from session info (windows, linux, unix, osx)
    • session_id: resolved ID

Platform Detection (determines which modules to use)

Signal Platform Post module prefix
info contains "Windows" windows post/windows/
info contains "Linux" linux post/linux/
info contains "OSX" or "macOS" osx post/osx/
type == "meterpreter" AND unknown Run msf_session_sysinfo to determine varies
Cannot determine STOP: "Cannot identify platform; manual intervention needed"

Workflow (strict sequential order)

Step 1: Validate session is alive

msf_send_session_command(
  session_id="{session_id}",
  command="id",       # Linux/Unix
  engagement_id="{engagement_id}"
)
  • For Windows: use whoami instead of id
  • IF error with code session_not_found -> STOP: "Session {id} is dead"
  • IF timeout -> retry ONCE; if still timeout -> STOP: "Session unresponsive"

Step 2: Basic enumeration (platform-branched)

IF platform == linux/unix:

msf_send_session_command: "id"
msf_send_session_command: "uname -a"
msf_send_session_command: "ip addr show" OR "ifconfig"
msf_send_session_command: "cat /etc/passwd"

Read the full file on GitHub · 217 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 217 lines · 32 tokens per session scan C d3915faf2e4d

Subscribe to this mod's changes

msf-post-agent is an agent published in the GitHub repository Suzu-Testing/metasploit-cursor-harness (3 stars, last pushed 10d ago), licensed MIT. It adds 32 tokens to every session and 1,816 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (harvests environment variables). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.