[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C30S0TZPDBSJ7DHZWBXA6H":3,"skill-same:01M6C30S0TZPDBSJ7DHZWBXA6H":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M6C30S0TZPDBSJ7DHZWBXA6H","forensics-investigate","多智能体取证调查","Full multi-agent investigation workflow","完整的多智能体调查工作流。","jmagly\u002Faiwg","jmagly","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1159087?v=4","01M6C10AK8N2WCSQN11FYGTJWN","Joseph Magly","01M6C10AQ8A2RMED1Y1BSVY7NF",229,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fforensics-investigate\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44],"forensics","investigate","forensics investigate","triage","workflow","cloud","investigation","ssh","multi-agent","container","full","stage","scope","multi","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: forensics-investigate\nplatforms: [all]\ndescription: Full multi-agent investigation workflow\ncommandHint:\n  argumentHint: \"\u003Ctarget> [--scope triage|full|targeted-ssh|container|cloud] [--skip-stage stage]\"\n  category: forensics-investigation\n---\n\n# \u002Fforensics-investigate\n\nOrchestrate a complete digital forensics investigation by coordinating all specialized agents through the full workflow: reconnaissance, triage, acquisition, multi-domain analysis, timeline building, IOC extraction, and report generation. Suitable for incident response and proactive threat hunting.\n\n## Usage\n\n`\u002Fforensics-investigate \u003Ctarget> [options]`\n\n## Arguments\n\n| Argument | Required | Description |\n|----------|----------|-------------|\n| target | Yes | SSH connection string, cloud target, or findings directory path |\n| --scope | No | Investigation scope: `triage`, `full`, `targeted-ssh`, `container`, `cloud` (default: `full`) |\n| --skip-stage | No | Skip a specific stage: `recon`, `triage`, `acquire`, `analysis`, `timeline`, `ioc`, `report` |\n| --resume | No | Resume a previously interrupted investigation from last checkpoint |\n| --output | No | Output directory (default: `.aiwg\u002Fforensics\u002F`) |\n| --parallel | No | Run analysis agents in parallel where possible (default: true) |\n| --notify | No | Webhook URL for stage completion notifications |\n\n## Behavior\n\nWhen invoked, this command:\n\n1. **Initialize Investigation**\n   - Create investigation workspace at `.aiwg\u002Fforensics\u002F`\n   - Assign investigation ID (`INV-\u003Cdate>-\u003Chost>`)\n   - Record start time, investigator, and scope\n   - Check for existing investigation to resume\n\n2. **Reconnaissance (recon-agent)**\n   - Profile target system and establish baseline\n   - Document services, users, and network configuration\n   - Save to `profiles\u002F\u003Chostname>\u002F`\n\n3. **Triage (triage-agent)**\n   - Capture volatile data per RFC 3227 order\n   - Score initial threat level\n   - Identify active indicators requiring immediate attention\n   - Save to `findings\u002F\u003Chostname>\u002Fvolatile\u002F`\n\n4. **Acquisition (forensic-acquisition-agent)**\n   - Collect logs, configurations, and artifacts per triage findings\n   - Establish chain of custody for all evidence\n   - Compute and verify SHA-256 hashes\n   - Save evidence manifest to `acquisition\u002F`\n\n5. **Analysis (parallel agent coordination)**\n   - **Log Analyst**: Auth logs, syslog, journal entries\n   - **Persistence Hunter**: Crons, systemd units, SSH keys, rootkits\n   - **Network Analyst**: Connections, DNS, beaconing, lateral movement\n   - **Container Analyst**: Docker\u002FKubernetes artifacts (if applicable)\n   - **Memory Analyst**: Volatility 3 analysis (if memory image available)\n   - **Cloud Analyst**: CloudTrail, IAM, flow logs (if cloud target)\n   - Save findings to `analysis\u002F\u003Cagent>\u002F`\n\n6. **Timeline Building (timeline-builder)**\n   - Correlate events across all analysis findings\n   - Normalize timestamps to UTC\n   - Reconstruct attack chain with MITRE ATT&CK mapping\n   - Save to `timeline\u002Fincident-timeline.md`\n\n7. **IOC Extraction (ioc-analyst)**\n   - Extract indicators from all findings\n   - Enrich with threat intelligence\n   - Map to STIX 2.1 observables\n   - Save to `ioc\u002Fioc-register.md`\n\n8. **Report Generation (reporting-agent)**\n   - Compile executive summary and technical findings\n   - Include severity-classified evidence table\n   - Generate remediation plan with prioritized actions\n   - Save to `reports\u002Fforensic-report.md`\n\n9. **Quality Gate**\n   - Verify all stages completed or explicitly skipped\n   - Confirm evidence chain of custody integrity\n   - Check report completeness before marking investigation closed\n\n## Profile-to-Plan Generation\n\nWhen a target profile exists at `.aiwg\u002Fforensics\u002Fprofiles\u002F\u003Chostname>-\u003Cdate>\u002Fsystem-profile.md`, `forensics-investigate` reads it before generating the investigation plan. This enables the plan to contain parameterized, host-specific commands instead of generic placeholders.\n\n### 1. Reading the Target Profile\n\nThe command resolves the profile path from the target argument:\n\n1. Derive hostname from the connection string (e.g., `ssh:\u002F\u002Fadmin@web01` → `web01`)\n2. Scan `.aiwg\u002Fforensics\u002Fprofiles\u002F` for directories matching `\u003Chostname>-*`\n3. Select the most recently dated match (e.g., `web01-2026-02-27\u002F`)\n4. Load `system-profile.md` (human-readable) and `system-profile.json` (machine-readable) from that directory\n5. If no profile is found, log a warning and proceed with an unparameterized plan; prompt the investigator to run `\u002Fforensics-profile` first\n\nThe investigation plan's **Target Profile Reference** section is populated from the resolved path:\n\n```yaml\ntarget_profile_path: .aiwg\u002Fforensics\u002Fprofiles\u002Fweb01-2026-02-27\u002Fsystem-profile.md\nprofile_date: 2026-02-27\n```\n\n### 2. Parameterizing Commands from Profile Data\n\nThe following profile fields are extracted and substituted into investigation plan commands:\n\n| Profile Field | Plan Variable | Example Usage |\n|---------------|---------------|---------------|\n| Hostname | `{{hostname}}` | `last -n 50 web01` |\n| Case ID | `{{case_id}}` | `ps auxf > \u002Ftmp\u002FINV-2026-02-27-web01_ps_snapshot.txt` |\n| Users with shell access | `{{expected_users}}` | Auth log grep patterns scoped to known accounts |\n| Running services list | `{{expected_service_pattern}}` | `lsof -i | grep -v '\u003Cpattern>'` |\n| Listening ports | `{{expected_ports}}` | Connection count alert comparison |\n| Investigation date | `{{investigation_date}}` | `journalctl --since \"2026-02-27 00:00:00\"` |\n| Log lookback window | `{{log_lookback_days}}` | `--since` timestamps for auth and syslog queries |\n| Timeline window | `{{timeline_window_days}}` | `find \u002F -newer` reference marker |\n| Large file threshold | `{{large_file_threshold_mb}}` | `find \u002F -size +100M` |\n| Connection alert threshold | `{{connection_count_alert_threshold}}` | `awk '$1 >= 20'` in network phase |\n| Failed login threshold | `{{failed_login_threshold}}` | Alert threshold in auth analysis |\n| Package manager | `{{package_manager_history_command}}` | Distro-appropriate package history command |\n| Log file paths | `{{web_access_log}}` | Service-specific log path substitution |\n| Evidence storage path | `{{evidence_storage_path}}` | Evidence collection target directory |\n| Escalation contact | `{{escalation_contact}}` | Red flag notification target |\n\nUser and authentication commands in Phase 2 are scoped to the known account list from the profile's **Users with Shell Access** table. For example, if the profile documents `admin`, `deploy`, and `root`, the SSH key sweep is limited to those home directories rather than iterating all of `\u002Fhome`.\n\n### 3. Service-Specific Check Inclusion\n\nPhase 3 (Process and Service Audit) and Phase 7 (Log Analysis) include service-specific checks only for services listed in the profile's **Services and Ports** table with `Expected: Yes`.\n\nThe command applies these rules:\n\n| Service Present in Profile | Checks Included |\n|----------------------------|-----------------|\n| `nginx` or `apache2` | Web access log parsing, HTTP error pattern grep |\n| `mysqld` or `postgresql` | Database error log check, unusual connection sources |\n| `sshd` | SSH auth failure threshold, authorized_keys sweep |\n| `docker` \u002F `containerd` | Phase 8 (Container \u002F Docker Audit) is included; otherwise skipped |\n| No container runtime listed | Phase 8 is excluded from the generated plan with a note |\n| Cloud metadata service detected | Cloud Analyst agent is added to the Phase 5 parallel pool |\n\nThe Phase 8 section header in the generated plan reflects the include\u002Fexclude decision explicitly:\n\n```\n### Phase 8: Container \u002F Docker Audit\n> INCLUDED — docker detected in target profile (3 running containers at baseline)\n```\n\nor:\n\n```\n### Phase 8: Container \u002F Docker Audit\n> SKIPPED — no container runtime in target profile\n```\n\nServices not present in the profile that are found running during triage are flagged as anomalies in the triage summary and receive targeted investigation commands appended to Phase 3.\n\n### 4. Deriving Expected vs. Suspicious Baselines\n\nThe profile's **Services and Ports** and **Network Baseline** sections establish what is normal. The generated plan encodes these baselines directly into triage commands:\n\n**Port baseline** — The expected listening ports from the profile (e.g., `22`, `80`, `443`, `3306`) are embedded in the Phase 6 network check. Any port reported by `ss -tlnpu` that is not in this list is flagged inline:\n\n```bash\n# Ports not in baseline (web01 profile: 22, 80, 443, 3306)\nss -tlnpu | awk 'NR>1 {print $5}' | grep -oP ':\\K[0-9]+' | sort -un \\\n  | grep -vE '^(22|80|443|3306)$' | while read p; do echo \"UNEXPECTED PORT: $p\"; done\n```\n\n**Outbound connection baseline** — The expected outbound destinations from the profile's **Expected Outbound Connections** table are embedded in the network phase as an allowlist. Connections to destinations outside this list are flagged for review.\n\n**User baseline** — The known shell-access accounts from the profile are compared against `getent passwd` output at investigation time. New accounts not in the profile are flagged in Phase 2 as potential persistence artifacts.\n\n**Container baseline** — If the profile includes a **Running Containers (Baseline)** table, the generated plan compares current `docker ps` output against that baseline. Containers not present at profile time are flagged as anomalous in Phase 8.\n\n**Failed login threshold** — The `failed_login_threshold` from the profile's **Investigation Scope Configuration** block (default: `10`) is substituted into the auth log grep commands. Accounts exceeding this threshold in Phase 2 are surfaced as priority findings.\n\n## Scope Profiles\n\n| Scope | Stages | Use Case |\n|-------|--------|----------|\n| `triage` | recon, triage | Initial rapid assessment |\n| `targeted-ssh` | recon, triage, acquire, logs, persistence, network | SSH-compromised host |\n| `container` | recon, triage, acquire, container, network | Container escape or image compromise |\n| `cloud` | recon, acquire, cloud, ioc, report | Cloud account breach |\n| `full` | All stages | Comprehensive incident response |\n\n## Examples\n\n### Example 1: Full investigation\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --scope full\n```\n\n### Example 2: Quick triage only\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --scope triage\n```\n\n### Example 3: Container sweep\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Froot@docker-host --scope container\n```\n\n### Example 4: Cloud audit\n```bash\n\u002Fforensics-investigate aws:\u002F\u002F123456789012\u002Fus-east-1 --scope cloud\n```\n\n### Example 5: Resume interrupted investigation\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --resume\n```\n\n### Example 6: Skip memory analysis\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@host --scope full --skip-stage memory\n```\n\n## Output\n\nAll artifacts are saved under `.aiwg\u002Fforensics\u002F`:\n\n```\n.aiwg\u002Fforensics\u002F\n├── investigation.yaml             # Investigation metadata and state\n├── profiles\u002F\n│   └── web01-2026-02-27\u002F\n│       └── system-profile.md\n├── findings\u002F\n│   └── web01-2026-02-27\u002F\n│       ├── triage-summary.md\n│       └── volatile\u002F\n├── acquisition\u002F\n│   ├── evidence-manifest.yaml\n│   └── custody-log.yaml\n├── analysis\u002F\n│   ├── logs\u002F\n│   ├── persistence\u002F\n│   ├── network\u002F\n│   └── ioc\u002F\n├── timeline\u002F\n│   └── incident-timeline.md\n├── ioc\u002F\n│   └── ioc-register.md\n└── reports\u002F\n    └── forensic-report.md\n```\n\n### Sample Progress Output\n\n```\nInvestigation: INV-2026-02-27-web01\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n[14:30:00] Stage 1\u002F8: Reconnaissance     RUNNING\n[14:31:42] Stage 1\u002F8: Reconnaissance     COMPLETE  (102s)\n[14:31:42] Stage 2\u002F8: Triage             RUNNING\n[14:34:15] Stage 2\u002F8: Triage             COMPLETE  (153s) [CRITICAL - active compromise]\n[14:34:15] Stage 3\u002F8: Acquisition        RUNNING\n[14:39:02] Stage 3\u002F8: Acquisition        COMPLETE  (287s) [14 artifacts collected]\n[14:39:02] Stage 4\u002F8: Analysis           RUNNING   (parallel: 5 agents)\n[14:39:02]   Log Analyst                 RUNNING\n[14:39:02]   Persistence Hunter          RUNNING\n[14:39:02]   Network Analyst             RUNNING\n[14:52:18]   Log Analyst                 COMPLETE  [8 findings]\n[14:53:41]   Persistence Hunter          COMPLETE  [3 findings]\n[14:55:09]   Network Analyst             COMPLETE  [5 findings]\n[14:55:09] Stage 4\u002F8: Analysis           COMPLETE  (976s) [16 total findings]\n[14:55:09] Stage 5\u002F8: Timeline           RUNNING\n[14:57:33] Stage 5\u002F8: Timeline           COMPLETE  (144s)\n[14:57:33] Stage 6\u002F8: IOC Extraction     RUNNING\n[14:59:01] Stage 6\u002F8: IOC Extraction     COMPLETE  (88s)  [12 IOCs extracted]\n[14:59:01] Stage 7\u002F8: Report Generation  RUNNING\n[15:01:44] Stage 7\u002F8: Report Generation  COMPLETE  (163s)\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nInvestigation Complete: INV-2026-02-27-web01\nDuration: 31m 44s\n\nFindings: 16 total (2 CRITICAL, 5 HIGH, 6 MEDIUM, 3 LOW)\nIOCs: 12 extracted (4 enriched with threat intel)\nReport: .aiwg\u002Fforensics\u002Freports\u002Fforensic-report.md\n```\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fagents\u002Fforensics-orchestrator.md - Orchestrator\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fagents\u002Fmanifest.json - All agent definitions\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fcommands\u002Fforensics-report.md - Report generation\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fcommands\u002Fforensics-status.md - Status monitoring\n","# \u002Fforensics-investigate\n\nOrchestrate a complete digital forensics investigation by coordinating all specialized agents through the full workflow: reconnaissance, triage, acquisition, multi-domain analysis, timeline building, IOC extraction, and report generation. Suitable for incident response and proactive threat hunting.\n\n## Usage\n\n`\u002Fforensics-investigate \u003Ctarget> [options]`\n\n## Arguments\n\n| Argument | Required | Description |\n|----------|----------|-------------|\n| target | Yes | SSH connection string, cloud target, or findings directory path |\n| --scope | No | Investigation scope: `triage`, `full`, `targeted-ssh`, `container`, `cloud` (default: `full`) |\n| --skip-stage | No | Skip a specific stage: `recon`, `triage`, `acquire`, `analysis`, `timeline`, `ioc`, `report` |\n| --resume | No | Resume a previously interrupted investigation from last checkpoint |\n| --output | No | Output directory (default: `.aiwg\u002Fforensics\u002F`) |\n| --parallel | No | Run analysis agents in parallel where possible (default: true) |\n| --notify | No | Webhook URL for stage completion notifications |\n\n## Behavior\n\nWhen invoked, this command:\n\n1. **Initialize Investigation**\n   - Create investigation workspace at `.aiwg\u002Fforensics\u002F`\n   - Assign investigation ID (`INV-\u003Cdate>-\u003Chost>`)\n   - Record start time, investigator, and scope\n   - Check for existing investigation to resume\n\n2. **Reconnaissance (recon-agent)**\n   - Profile target system and establish baseline\n   - Document services, users, and network configuration\n   - Save to `profiles\u002F\u003Chostname>\u002F`\n\n3. **Triage (triage-agent)**\n   - Capture volatile data per RFC 3227 order\n   - Score initial threat level\n   - Identify active indicators requiring immediate attention\n   - Save to `findings\u002F\u003Chostname>\u002Fvolatile\u002F`\n\n4. **Acquisition (forensic-acquisition-agent)**\n   - Collect logs, configurations, and artifacts per triage findings\n   - Establish chain of custody for all evidence\n   - Compute and verify SHA-256 hashes\n   - Save evidence manifest to `acquisition\u002F`\n\n5. **Analysis (parallel agent coordination)**\n   - **Log Analyst**: Auth logs, syslog, journal entries\n   - **Persistence Hunter**: Crons, systemd units, SSH keys, rootkits\n   - **Network Analyst**: Connections, DNS, beaconing, lateral movement\n   - **Container Analyst**: Docker\u002FKubernetes artifacts (if applicable)\n   - **Memory Analyst**: Volatility 3 analysis (if memory image available)\n   - **Cloud Analyst**: CloudTrail, IAM, flow logs (if cloud target)\n   - Save findings to `analysis\u002F\u003Cagent>\u002F`\n\n6. **Timeline Building (timeline-builder)**\n   - Correlate events across all analysis findings\n   - Normalize timestamps to UTC\n   - Reconstruct attack chain with MITRE ATT&CK mapping\n   - Save to `timeline\u002Fincident-timeline.md`\n\n7. **IOC Extraction (ioc-analyst)**\n   - Extract indicators from all findings\n   - Enrich with threat intelligence\n   - Map to STIX 2.1 observables\n   - Save to `ioc\u002Fioc-register.md`\n\n8. **Report Generation (reporting-agent)**\n   - Compile executive summary and technical findings\n   - Include severity-classified evidence table\n   - Generate remediation plan with prioritized actions\n   - Save to `reports\u002Fforensic-report.md`\n\n9. **Quality Gate**\n   - Verify all stages completed or explicitly skipped\n   - Confirm evidence chain of custody integrity\n   - Check report completeness before marking investigation closed\n\n## Profile-to-Plan Generation\n\nWhen a target profile exists at `.aiwg\u002Fforensics\u002Fprofiles\u002F\u003Chostname>-\u003Cdate>\u002Fsystem-profile.md`, `forensics-investigate` reads it before generating the investigation plan. This enables the plan to contain parameterized, host-specific commands instead of generic placeholders.\n\n### 1. Reading the Target Profile\n\nThe command resolves the profile path from the target argument:\n\n1. Derive hostname from the connection string (e.g., `ssh:\u002F\u002Fadmin@web01` → `web01`)\n2. Scan `.aiwg\u002Fforensics\u002Fprofiles\u002F` for directories matching `\u003Chostname>-*`\n3. Select the most recently dated match (e.g., `web01-2026-02-27\u002F`)\n4. Load `system-profile.md` (human-readable) and `system-profile.json` (machine-readable) from that directory\n5. If no profile is found, log a warning and proceed with an unparameterized plan; prompt the investigator to run `\u002Fforensics-profile` first\n\nThe investigation plan's **Target Profile Reference** section is populated from the resolved path:\n\n```yaml\ntarget_profile_path: .aiwg\u002Fforensics\u002Fprofiles\u002Fweb01-2026-02-27\u002Fsystem-profile.md\nprofile_date: 2026-02-27\n```\n\n### 2. Parameterizing Commands from Profile Data\n\nThe following profile fields are extracted and substituted into investigation plan commands:\n\n| Profile Field | Plan Variable | Example Usage |\n|---------------|---------------|---------------|\n| Hostname | `{{hostname}}` | `last -n 50 web01` |\n| Case ID | `{{case_id}}` | `ps auxf > \u002Ftmp\u002FINV-2026-02-27-web01_ps_snapshot.txt` |\n| Users with shell access | `{{expected_users}}` | Auth log grep patterns scoped to known accounts |\n| Running services list | `{{expected_service_pattern}}` | `lsof -i | grep -v '\u003Cpattern>'` |\n| Listening ports | `{{expected_ports}}` | Connection count alert comparison |\n| Investigation date | `{{investigation_date}}` | `journalctl --since \"2026-02-27 00:00:00\"` |\n| Log lookback window | `{{log_lookback_days}}` | `--since` timestamps for auth and syslog queries |\n| Timeline window | `{{timeline_window_days}}` | `find \u002F -newer` reference marker |\n| Large file threshold | `{{large_file_threshold_mb}}` | `find \u002F -size +100M` |\n| Connection alert threshold | `{{connection_count_alert_threshold}}` | `awk '$1 >= 20'` in network phase |\n| Failed login threshold | `{{failed_login_threshold}}` | Alert threshold in auth analysis |\n| Package manager | `{{package_manager_history_command}}` | Distro-appropriate package history command |\n| Log file paths | `{{web_access_log}}` | Service-specific log path substitution |\n| Evidence storage path | `{{evidence_storage_path}}` | Evidence collection target directory |\n| Escalation contact | `{{escalation_contact}}` | Red flag notification target |\n\nUser and authentication commands in Phase 2 are scoped to the known account list from the profile's **Users with Shell Access** table. For example, if the profile documents `admin`, `deploy`, and `root`, the SSH key sweep is limited to those home directories rather than iterating all of `\u002Fhome`.\n\n### 3. Service-Specific Check Inclusion\n\nPhase 3 (Process and Service Audit) and Phase 7 (Log Analysis) include service-specific checks only for services listed in the profile's **Services and Ports** table with `Expected: Yes`.\n\nThe command applies these rules:\n\n| Service Present in Profile | Checks Included |\n|----------------------------|-----------------|\n| `nginx` or `apache2` | Web access log parsing, HTTP error pattern grep |\n| `mysqld` or `postgresql` | Database error log check, unusual connection sources |\n| `sshd` | SSH auth failure threshold, authorized_keys sweep |\n| `docker` \u002F `containerd` | Phase 8 (Container \u002F Docker Audit) is included; otherwise skipped |\n| No container runtime listed | Phase 8 is excluded from the generated plan with a note |\n| Cloud metadata service detected | Cloud Analyst agent is added to the Phase 5 parallel pool |\n\nThe Phase 8 section header in the generated plan reflects the include\u002Fexclude decision explicitly:\n\n```\n### Phase 8: Container \u002F Docker Audit\n> INCLUDED — docker detected in target profile (3 running containers at baseline)\n```\n\nor:\n\n```\n### Phase 8: Container \u002F Docker Audit\n> SKIPPED — no container runtime in target profile\n```\n\nServices not present in the profile that are found running during triage are flagged as anomalies in the triage summary and receive targeted investigation commands appended to Phase 3.\n\n### 4. Deriving Expected vs. Suspicious Baselines\n\nThe profile's **Services and Ports** and **Network Baseline** sections establish what is normal. The generated plan encodes these baselines directly into triage commands:\n\n**Port baseline** — The expected listening ports from the profile (e.g., `22`, `80`, `443`, `3306`) are embedded in the Phase 6 network check. Any port reported by `ss -tlnpu` that is not in this list is flagged inline:\n\n```bash\n# Ports not in baseline (web01 profile: 22, 80, 443, 3306)\nss -tlnpu | awk 'NR>1 {print $5}' | grep -oP ':\\K[0-9]+' | sort -un \\\n  | grep -vE '^(22|80|443|3306)$' | while read p; do echo \"UNEXPECTED PORT: $p\"; done\n```\n\n**Outbound connection baseline** — The expected outbound destinations from the profile's **Expected Outbound Connections** table are embedded in the network phase as an allowlist. Connections to destinations outside this list are flagged for review.\n\n**User baseline** — The known shell-access accounts from the profile are compared against `getent passwd` output at investigation time. New accounts not in the profile are flagged in Phase 2 as potential persistence artifacts.\n\n**Container baseline** — If the profile includes a **Running Containers (Baseline)** table, the generated plan compares current `docker ps` output against that baseline. Containers not present at profile time are flagged as anomalous in Phase 8.\n\n**Failed login threshold** — The `failed_login_threshold` from the profile's **Investigation Scope Configuration** block (default: `10`) is substituted into the auth log grep commands. Accounts exceeding this threshold in Phase 2 are surfaced as priority findings.\n\n## Scope Profiles\n\n| Scope | Stages | Use Case |\n|-------|--------|----------|\n| `triage` | recon, triage | Initial rapid assessment |\n| `targeted-ssh` | recon, triage, acquire, logs, persistence, network | SSH-compromised host |\n| `container` | recon, triage, acquire, container, network | Container escape or image compromise |\n| `cloud` | recon, acquire, cloud, ioc, report | Cloud account breach |\n| `full` | All stages | Comprehensive incident response |\n\n## Examples\n\n### Example 1: Full investigation\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --scope full\n```\n\n### Example 2: Quick triage only\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --scope triage\n```\n\n### Example 3: Container sweep\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Froot@docker-host --scope container\n```\n\n### Example 4: Cloud audit\n```bash\n\u002Fforensics-investigate aws:\u002F\u002F123456789012\u002Fus-east-1 --scope cloud\n```\n\n### Example 5: Resume interrupted investigation\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@192.168.1.50 --resume\n```\n\n### Example 6: Skip memory analysis\n```bash\n\u002Fforensics-investigate ssh:\u002F\u002Fadmin@host --scope full --skip-stage memory\n```\n\n## Output\n\nAll artifacts are saved under `.aiwg\u002Fforensics\u002F`:\n\n```\n.aiwg\u002Fforensics\u002F\n├── investigation.yaml             # Investigation metadata and state\n├── profiles\u002F\n│   └── web01-2026-02-27\u002F\n│       └── system-profile.md\n├── findings\u002F\n│   └── web01-2026-02-27\u002F\n│       ├── triage-summary.md\n│       └── volatile\u002F\n├── acquisition\u002F\n│   ├── evidence-manifest.yaml\n│   └── custody-log.yaml\n├── analysis\u002F\n│   ├── logs\u002F\n│   ├── persistence\u002F\n│   ├── network\u002F\n│   └── ioc\u002F\n├── timeline\u002F\n│   └── incident-timeline.md\n├── ioc\u002F\n│   └── ioc-register.md\n└── reports\u002F\n    └── forensic-report.md\n```\n\n### Sample Progress Output\n\n```\nInvestigation: INV-2026-02-27-web01\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n[14:30:00] Stage 1\u002F8: Reconnaissance     RUNNING\n[14:31:42] Stage 1\u002F8: Reconnaissance     COMPLETE  (102s)\n[14:31:42] Stage 2\u002F8: Triage             RUNNING\n[14:34:15] Stage 2\u002F8: Triage             COMPLETE  (153s) [CRITICAL - active compromise]\n[14:34:15] Stage 3\u002F8: Acquisition        RUNNING\n[14:39:02] Stage 3\u002F8: Acquisition        COMPLETE  (287s) [14 artifacts collected]\n[14:39:02] Stage 4\u002F8: Analysis           RUNNING   (parallel: 5 agents)\n[14:39:02]   Log Analyst                 RUNNING\n[14:39:02]   Persistence Hunter          RUNNING\n[14:39:02]   Network Analyst             RUNNING\n[14:52:18]   Log Analyst                 COMPLETE  [8 findings]\n[14:53:41]   Persistence Hunter          COMPLETE  [3 findings]\n[14:55:09]   Network Analyst             COMPLETE  [5 findings]\n[14:55:09] Stage 4\u002F8: Analysis           COMPLETE  (976s) [16 total findings]\n[14:55:09] Stage 5\u002F8: Timeline           RUNNING\n[14:57:33] Stage 5\u002F8: Timeline           COMPLETE  (144s)\n[14:57:33] Stage 6\u002F8: IOC Extraction     RUNNING\n[14:59:01] Stage 6\u002F8: IOC Extraction     COMPLETE  (88s)  [12 IOCs extracted]\n[14:59:01] Stage 7\u002F8: Report Generation  RUNNING\n[15:01:44] Stage 7\u002F8: Report Generation  COMPLETE  (163s)\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nInvestigation Complete: INV-2026-02-27-web01\nDuration: 31m 44s\n\nFindings: 16 total (2 CRITICAL, 5 HIGH, 6 MEDIUM, 3 LOW)\nIOCs: 12 extracted (4 enriched with threat intel)\nReport: .aiwg\u002Fforensics\u002Freports\u002Fforensic-report.md\n```\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fagents\u002Fforensics-orchestrator.md - Orchestrator\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fagents\u002Fmanifest.json - All agent definitions\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fcommands\u002Fforensics-report.md - Report generation\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fcommands\u002Fforensics-status.md - Status monitoring\n",{"name":5,"namespace":50,"platforms":51,"commandHint":53,"description":7},"aiwg",[52],"all",{"category":54,"argumentHint":55},"forensics-investigation","\u003Ctarget> [--scope triage|full|targeted-ssh|container|cloud] [--skip-stage stage]","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fforensics-investigate",36,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg","https:\u002F\u002Faiwg.io","https:\u002F\u002Fgithub.com\u002Fjmagly","https:\u002F\u002Fintegrolabs.io","ml\u002Fai, industrial automation, safety\u002Fsecurity, ssi\r\n\r\nmagly.net\r\nintegrolabs.io\r\naiwg.io\r\nfortemi.com\r\npagenary.com\r\nbytecask.com","2026-11-14 10:46:34",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add jmagly\u002Faiwg --skill forensics-investigate",{"tool":72,"command":73},"bunx","bunx skills add jmagly\u002Faiwg --skill forensics-investigate",{"tool":75,"command":76},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill forensics-investigate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fforensics-investigate\u002FSKILL.md",true,[],[81,89,94,121,140,145],{"skillNo":82,"name":83,"nameZh":17,"description":84,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":88},"01M78KW7PZJ9YQZQMW84SN2YD4","plugin-search","Search marketplaces for plugins using configured local manifests and directory caches; rank matching plugins by observed installs, review tier and cache dates without installing or fetching anything","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Futils\u002Fskills\u002Fplugin-search\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":90,"name":83,"nameZh":17,"description":84,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":88},"01M78KSEZS9ZNNFESY9ANW22S0","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fplugin-search\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":17,"description":97,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":45},"01M70QA0BSYJ49EES9V4RE8QH1","host-hardening","Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[],[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"hardening","host","host hardening","verification","secrets","read","request","remediation","recommendations","audit","plan","port","bind","Bash","access","only","retention","re","never","firewall",{"skillNo":122,"name":123,"nameZh":17,"description":124,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":45},"01M70PNT2Z4HMZPRBTAF6073NN","exposure-analysis","Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[],[128,129,130,131,132,133,106,134,112,119,114,135,102,136,116,137,43,120,138,139],"analysis","exposure analysis","collection","reconstruction","operator","write","credentials","unknown","internet","local","ports","ufw",{"skillNo":141,"name":96,"nameZh":17,"description":97,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":45},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[],[101,102,103,118,119,120,113,117,109,105,106,107,108,110,111,112,104,114,115,116],{"skillNo":146,"name":123,"nameZh":17,"description":124,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":45},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[],[128,129,139,138,132,43,137,116,131,133,106,134,112,130,114,135,102,120,119,136]]