exploiting-vulnerabilities-with-metasploit-framework

Drives Metasploit via msfrpcd to search modules, exploit fingerprinted services, operate sessions, and pivot across hosts.

Updated May 27, 2026
One-click install
npx skills add https://github.com/baljinnyamday/autonomous-red-team-agent --skill exploiting-vulnerabilities-with-metasploit-framework-baljinnyamday
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploiting-vulnerabilities-with-metasploit-framework
Source: https://github.com/baljinnyamday/autonomous-red-team-agent/tree/main/harness/src/agent_redteam/skill_library/exploiting-vulnerabilities-with-metasploit-framework
Command: npx skills add https://github.com/baljinnyamday/autonomous-red-team-agent --skill exploiting-vulnerabilities-with-metasploit-framework-baljinnyamday

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? During an authorized red team engagement, guessing Metasploit module paths, choosing the wrong payload direction, or retrying blocked reverse shells wastes turns and fails to establish access. This Skill provides a disciplined workflow for operating Metasploit through the msfrpcd RPC interface so exploitation attempts are grounded in real module paths and adapted to segmented networks. ## Core Features & Use Cases - Module discovery and inspection: Use msf_search to find real module paths by keyword and msf_info to check rank, targets, and required options before running anything. - Exploitation with payload strategy: Run modules via msf_run with bind versus reverse payload guidance, target_host topology resolution, and automatic session recording with autoroute for pivoting. - Segmented-network fallback: Convert RCE into durable SSH access by planting an operator key with a cmd/unix/generic payload or establish_ssh_foothold instead of retrying blocked shells. - Session operation and pivoting: List, exec, and kill sessions with msf_session, then exploit deeper hosts hop by hop through autoroutes with bind payloads. - Use Case: A scan fingerprints Apache Struts on 10.0.0.12:8080. Search for the struts2 module, inspect its options, run it with a bind payload, then pivot through the resulting session to exploit a host only the foothold can reach. ## Quick Start Use the Metasploit skill to search for a module matching the fingerprinted service on the target host, inspect its required options, and exploit it with an appropriate payload.

Frequently Asked Questions about exploiting-vulnerabilities-with-metasploit-framework

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the right Metasploit module for a service?

Use msf_search with a keyword from the fingerprinted service to get ranked real module paths, then msf_info to inspect rank, targets, and required options. Never guess a module path, since an invented path fails and wastes a turn.

Should I use a bind or reverse payload in Metasploit?

Prefer bind payloads when exploiting through a pivot, since the attacker connects inward along the route table and reverse callbacks from deep hosts cannot route back. For directly reachable hosts, reverse_tcp with LHOST set to the foothold also works; flip direction if the first attempt gets no session.

What do I do when Metasploit reports no session opened?

First confirm the exploit fired by re-checking TARGETURI and the service version against the module's targets. In segmented networks where arbitrary ports are blocked, switch to a cmd/unix/generic payload that plants an SSH key, then connect over port 22 instead of retrying the same shell.

Can I use Metasploit for credential reuse or file operations?

No. Credential reuse stays with try_credentials, and reading files, running single SSH commands, or copying data belongs in bash. Metasploit is reserved for exploiting fingerprinted services, local privilege escalation inside a session, and pivoting.

How does pivoting through Metasploit sessions work?

Each landed session gets an automatic autoroute, so you exploit the next host by setting its address as RHOSTS with a bind payload and msfrpcd tunnels through the existing route. Chains are hop-by-hop, and each session is SSH key-backed so a dead session degrades to re-SSH and re-pivot.

What happens if msf tools return an unavailable message?

An unavailable response means Metasploit is not provisioned on the attacker host. Fall back to bash and SSH for the task, or run scripts/provision_operator_tooling.sh to set up the tooling before retrying.