# nidusvespae/chihou-scout architecture

> Architecture diagram of the GitHub repository nidusvespae/chihou-scout, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nidusvespae/chihou-scout
- Repository: https://github.com/nidusvespae/chihou-scout

## Overview

斥候 is a single-file, standard-library HTTP posture auditor for authorized infrastructure. Its user-to-result flow is: choose targets via the menu or CLI, enforce the owned-zone scope, probe each in-scope host, assess HTTP posture and exposed paths, then rank findings and emit Markdown or JSON. The graph preserves the documented check categories and soft-404 safeguard. Source excerpts show several audit and reporting details; other links rely on the README’s workflow description, since the file is only partially excerpted.

Main entry points: [`chihou.py`](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py) (Finding ranker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_menu_cli["Menu and CLI<br/>[chihou.py]"]
  node_target_selection["Target selection<br/>[chihou.py]"]
end

subgraph group_scanning["Scoped scanning"]
  node_scope_gate{{"Owned-zone gate<br/>[chihou.py]"}}
  node_host_probe["HTTP host probe<br/>[chihou.py]"]
  node_root_response["Root response<br/>[chihou.py]"]
end

subgraph group_assessment["Assessment and reporting"]
  node_header_audit["Security header audit<br/>[chihou.py]"]
  node_leak_audit["Header leakage audit<br/>[chihou.py]"]
  node_cookie_audit["Cookie audit<br/>[chihou.py]"]
  node_method_audit["HTTP method audit<br/>[chihou.py]"]
  node_https_audit["HTTPS redirect audit<br/>[chihou.py]"]
  node_path_audit["Sensitive path audit<br/>[chihou.py]"]
  node_soft404["Soft-404 baseline<br/>[chihou.py]"]
  node_finding_ranker["Finding ranker<br/>[chihou.py]"]
  node_report["Host report<br/>[chihou.py]"]
  node_formatter["Markdown / JSON output<br/>[chihou.py]"]
end

node_operator(("Operator"))
node_owned_host["Owned host"]
node_user_output(("User or pipeline"))

node_operator -->|"starts scan"| node_menu_cli
node_menu_cli -->|"chooses targets"| node_target_selection
node_target_selection -->|"checks scope"| node_scope_gate
node_scope_gate -->|"permits probe"| node_host_probe
node_host_probe -->|"sends GET / HEAD / OPTIONS"| node_owned_host
node_host_probe -->|"returns response"| node_root_response
node_root_response -->|"checks headers"| node_header_audit
node_root_response -->|"checks leakage"| node_leak_audit
node_root_response -->|"checks cookies"| node_cookie_audit
node_target_selection -->|"scans selected host"| node_method_audit
node_target_selection -->|"scans selected host"| node_https_audit
node_target_selection -->|"scans selected host"| node_path_audit
node_path_audit -->|"learns baseline"| node_soft404
node_soft404 -->|"filters catch-all"| node_path_audit
node_header_audit -->|"adds findings"| node_finding_ranker
node_leak_audit -->|"adds findings"| node_finding_ranker
node_cookie_audit -->|"adds findings"| node_finding_ranker
node_method_audit -->|"adds findings"| node_finding_ranker
node_https_audit -->|"adds findings"| node_finding_ranker
node_path_audit -->|"adds findings"| node_finding_ranker
node_finding_ranker -->|"sorts and counts"| node_report
node_report -->|"renders report"| node_formatter
node_formatter -->|"prints output"| node_user_output

click node_menu_cli "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_target_selection "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_scope_gate "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_host_probe "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_root_response "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_header_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_leak_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_cookie_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_method_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_https_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_path_audit "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_soft404 "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_finding_ranker "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_report "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"
click node_formatter "https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu_cli,node_target_selection,node_user_output toneBlue
class node_scope_gate,node_host_probe,node_root_response toneAmber
class node_header_audit,node_leak_audit,node_cookie_audit,node_method_audit,node_https_audit,node_path_audit,node_soft404,node_finding_ranker,node_report,node_formatter toneMint
class node_operator,node_owned_host toneIndigo
```

## Components

### User interaction

- [Menu and CLI](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Target selection](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`

### Scoped scanning

- [Owned-zone gate](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [HTTP host probe](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Root response](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`

### Assessment and reporting

- [Security header audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Header leakage audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Cookie audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [HTTP method audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [HTTPS redirect audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Sensitive path audit](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Soft-404 baseline](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Finding ranker](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Host report](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`
- [Markdown / JSON output](https://github.com/nidusvespae/chihou-scout/blob/main/chihou.py): `chihou.py`

### Other components

- **Operator**
- **Owned host**
- **User or pipeline**

## Connections

- Operator → Menu and CLI: starts scan (evidence: `README.md`)
- Menu and CLI → Target selection: chooses targets (evidence: `README.md`)
- Target selection → Owned-zone gate: checks scope (evidence: `README.md`)
- Owned-zone gate → HTTP host probe: permits probe (evidence: `README.md`)
- HTTP host probe → Owned host: sends GET / HEAD / OPTIONS (evidence: `README.md`)
- HTTP host probe → Root response: returns response (evidence: `chihou.py`)
- Root response → Security header audit: checks headers (evidence: `chihou.py`)
- Root response → Header leakage audit: checks leakage (evidence: `chihou.py`)
- Root response → Cookie audit: checks cookies (evidence: `chihou.py`)
- Target selection → HTTP method audit: scans selected host (evidence: `README.md`)
- Target selection → HTTPS redirect audit: scans selected host (evidence: `README.md`)
- Target selection → Sensitive path audit: scans selected host (evidence: `README.md`)
- Sensitive path audit → Soft-404 baseline: learns baseline (evidence: `README.md`)
- Soft-404 baseline → Sensitive path audit: filters catch-all (evidence: `chihou.py`)
- Security header audit → Finding ranker: adds findings (evidence: `chihou.py`)
- Header leakage audit → Finding ranker: adds findings (evidence: `chihou.py`)
- Cookie audit → Finding ranker: adds findings (evidence: `chihou.py`)
- HTTP method audit → Finding ranker: adds findings (evidence: `chihou.py`)
- HTTPS redirect audit → Finding ranker: adds findings (evidence: `chihou.py`)
- Sensitive path audit → Finding ranker: adds findings (evidence: `chihou.py`)
- Finding ranker → Host report: sorts and counts (evidence: `chihou.py`)
- Host report → Markdown / JSON output: renders report (evidence: `README.md`)
- Markdown / JSON output → User or pipeline: prints output (evidence: `README.md`)
