|
| 1 | +--- |
| 2 | +name: iom-pentest |
| 3 | +description: > |
| 4 | + Autonomous penetration testing via IoM C2 MCP tools. Adaptively executes based on user intent: |
| 5 | + situational awareness, reconnaissance, privilege escalation, credential harvesting, lateral movement, |
| 6 | + persistence, and more. Presents an execution plan and waits for user confirmation before sensitive operations. |
| 7 | + Trigger conditions: user mentions penetration testing, red team, post-exploitation, privilege escalation, |
| 8 | + lateral movement, credentials, persistence, situational awareness, or any scenario involving security |
| 9 | + assessment of a target through IoM. |
| 10 | +--- |
| 11 | + |
| 12 | +# IoM Automated Penetration Testing |
| 13 | + |
| 14 | +Autonomous penetration testing via IoM MCP tools. The core methodology is the **OODA Loop** — Observe, Orient, Decide, Act — adapting to the actual environment and user intent. |
| 15 | + |
| 16 | +## Intent Recognition and Interaction |
| 17 | + |
| 18 | +This skill does not rely on fixed keywords or rigid phase workflows. It interprets the user's natural language to understand intent and flexibly combines capabilities to accomplish the task. |
| 19 | + |
| 20 | +**When intent is clear**: Formulate an execution plan directly, present it to the user for confirmation, then execute. |
| 21 | + |
| 22 | +**When intent is ambiguous**: Proactively ask the user to clarify the objective. For example: |
| 23 | +- User says "work on this machine" — Ask: Do you need privilege escalation, credential harvesting, or a full reconnaissance sweep? |
| 24 | +- User says "check things out" — Could be a situational overview or targeted reconnaissance on a specific session; confirm the scope. |
| 25 | +- User provides a session ID with no further instructions — Ask what the objective is. |
| 26 | + |
| 27 | +**Plan presentation**: For any non-read-only operation, output an execution plan (including the commands to run, targets, and risk assessment) and wait for user confirmation before proceeding. |
| 28 | + |
| 29 | +## HITL (Human-in-the-Loop) Rules |
| 30 | + |
| 31 | +The need for user confirmation depends on the sensitivity of the operation: |
| 32 | + |
| 33 | +### No Confirmation Required (Read-Only / Information Gathering) |
| 34 | +- Viewing session, listener, and pipeline status |
| 35 | +- System information gathering: `sysinfo`, `whoami`, `privs`, `ps`, `ipconfig`, `netstat` |
| 36 | +- Environment enumeration: `enum av`, `enum software`, `systeminfo` |
| 37 | +- Network discovery: `pingscan`, `portscan` |
| 38 | +- Domain information queries: `ldapsearch`, `klist`, `enum dc` |
| 39 | + |
| 40 | +### Confirmation Required (Alters Target State or Carries Detection Risk) |
| 41 | +- Privilege escalation (UAC bypass, Potato, kernel exploits) |
| 42 | +- Credential extraction (hashdump, logonpasswords, mimikatz, nanodump) |
| 43 | +- Lateral movement (psexec, wmi, dcom, ptt) |
| 44 | +- Persistence installation (registry, service, scheduled task) |
| 45 | +- Any operation that writes files, creates processes, or modifies configuration |
| 46 | + |
| 47 | +### OPSEC Score Alerts |
| 48 | +Each technique carries an OPSEC safety score (1-10; higher is safer): |
| 49 | +- **>= 8**: Listed normally in the plan |
| 50 | +- **6-8**: **Risk level annotated** in the plan |
| 51 | +- **< 6**: **Mandatory separate alert** explaining the risk and recommending a safer alternative |
| 52 | + |
| 53 | +## MCP Tools and Progressive Discovery |
| 54 | + |
| 55 | +IoM has hundreds of commands — do not guess command usage. Use **progressive discovery** to retrieve information on demand: |
| 56 | + |
| 57 | +1. **Search for commands** — `search_commands` performs a fuzzy keyword search and returns command summaries (name, group, description, OPSEC score) |
| 58 | +2. **View usage** — `execute_command("<cmd> --help")` retrieves the specific command's parameters and examples |
| 59 | +3. **Execute the command** — Only run the command via `execute_command` after confirming usage |
| 60 | + |
| 61 | +### Available MCP Tools |
| 62 | + |
| 63 | +| Tool | Purpose | |
| 64 | +|------|---------| |
| 65 | +| `search_commands` | Fuzzy search commands by name/description; returns lightweight summaries | |
| 66 | +| `execute_command` | Execute any client/implant command; automatically waits for results | |
| 67 | +| `get_history` | Retrieve historical task output | |
| 68 | + |
| 69 | +### Basic Operations |
| 70 | + |
| 71 | +- **Switch session**: `execute_command("use <session_id_prefix>")` — enters the implant context |
| 72 | +- **Implant commands**: After switching, execute `sysinfo`, `whoami`, `ps`, etc. directly |
| 73 | +- **Client commands**: `session`, `listener`, `pipeline list`, etc. do not require a session context |
| 74 | +- **Task results**: `execute_command` automatically waits and returns results |
| 75 | + |
| 76 | +### Example: Progressive Discovery Workflow |
| 77 | + |
| 78 | +``` |
| 79 | +# 1. Unsure which privilege escalation commands exist — search |
| 80 | +search_commands("uac") |
| 81 | +search_commands("elevate") |
| 82 | +
|
| 83 | +# 2. Found uac-bypass command — view detailed usage |
| 84 | +execute_command("uac-bypass --help") |
| 85 | +
|
| 86 | +# 3. Understood the parameters — execute |
| 87 | +execute_command("uac-bypass elevatedcom \"C:\\path\\to\\implant.exe\"") |
| 88 | +``` |
| 89 | + |
| 90 | +## Core Principles |
| 91 | + |
| 92 | +1. **Observe before acting** — Never execute blindly; adjust strategy based on environmental data |
| 93 | +2. **OPSEC first** — Identify defenses before selecting evasion techniques. See [reference/opsec-guide.md](reference/opsec-guide.md) |
| 94 | +3. **Pivot on failure** — If a technique is blocked, mark it and switch paths; never retry the same technique |
| 95 | +4. **Minimum footprint** — Prefer BOF over execute_assembly; avoid writing to disk when possible |
| 96 | +5. **Respect user decisions** — Present a plan and wait for confirmation on sensitive operations; offer alternatives if the user declines |
| 97 | + |
| 98 | +## Capability Reference |
| 99 | + |
| 100 | +Consult the appropriate reference document based on user intent: |
| 101 | + |
| 102 | +| Scenario | Reference File | Key Sections | |
| 103 | +|----------|---------------|--------------| |
| 104 | +| Global situational awareness | [reference/phase-summary.md](reference/phase-summary.md) | | |
| 105 | +| Target reconnaissance and environment enumeration | [reference/phase-recon.md](reference/phase-recon.md) | | |
| 106 | +| Privilege escalation | [reference/phase-privesc.md](reference/phase-privesc.md) | UAC: [technique-reference.md#uac-bypass](reference/technique-reference.md#uac-bypass), Potato: [technique-reference.md#potato-privilege-escalation](reference/technique-reference.md#potato-privilege-escalation), Kernel: [technique-reference.md#kernel-exploits](reference/technique-reference.md#kernel-exploits) | |
| 107 | +| Credential harvesting | [reference/phase-creds.md](reference/phase-creds.md) | [technique-reference.md#credential-harvesting](reference/technique-reference.md#credential-harvesting) | |
| 108 | +| Lateral movement | [reference/phase-lateral.md](reference/phase-lateral.md) | [technique-reference.md#lateral-movement](reference/technique-reference.md#lateral-movement) | |
| 109 | +| Persistence | [reference/phase-persist.md](reference/phase-persist.md) | [technique-reference.md#persistence](reference/technique-reference.md#persistence) | |
| 110 | +| OPSEC strategy and AV evasion | [reference/opsec-guide.md](reference/opsec-guide.md) | [opsec-guide.md#execution-method-selection](reference/opsec-guide.md#execution-method-selection), [opsec-guide.md#strategy-matrix](reference/opsec-guide.md#strategy-matrix) | |
| 111 | +| Technique quick reference | [reference/technique-reference.md](reference/technique-reference.md) | | |
| 112 | + |
| 113 | +## Output Report |
| 114 | + |
| 115 | +Upon task completion, generate a structured report: |
| 116 | + |
| 117 | +```markdown |
| 118 | +## Penetration Test Report |
| 119 | +**Date**: YYYY-MM-DD HH:MM |
| 120 | +**Target**: [session / host operated on] |
| 121 | +**Summary**: [what was actually performed] |
| 122 | + |
| 123 | +### Attack Path |
| 124 | +[The actual execution path taken] |
| 125 | + |
| 126 | +### Session Inventory |
| 127 | +| Session | Host | User | Privilege | Obtained Via | |
| 128 | +|---------|------|------|-----------|-------------| |
| 129 | + |
| 130 | +### Harvested Credentials |
| 131 | +| Type | User | Domain | Source | |
| 132 | +|------|------|--------|--------| |
| 133 | + |
| 134 | +### Techniques Used |
| 135 | +| MITRE ID | Technique | OPSEC | Result | Notes | |
| 136 | +|----------|-----------|-------|--------|-------| |
| 137 | + |
| 138 | +### Defensive Gaps |
| 139 | +[Which weaknesses enabled the attack to succeed] |
| 140 | +``` |
0 commit comments