2.2 KiB
2.2 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||
|---|---|---|---|---|---|---|---|---|---|
| server/stealth-mode | Implement stealth mode — protocol multiplexing on port 443 (ADR-017) | pending |
|
narrow | medium | component | implementation |
Description
Implement stealth mode per ADR-017. When --stealth is enabled alongside TLS transport on port 443:
- After completing the TLS handshake, peek at the first bytes of the connection
- If the connection starts with
SSH-2.0-, proceed withrussh::server::run_stream() - If the connection starts with anything else (HTTP, random data), respond with
HTTP/1.1 404 Not Found\r\nServer: nginx\r\n\r\nand close
This makes the server appear as an nginx web server returning 404 errors to non-SSH connections, making it indistinguishable from a regular HTTPS site to port scanners and DPI systems.
Stealth mode requires TLS transport. The CLI should reject or warn if --stealth is used without --transport tls.
Acceptance Criteria
crates/wraith-core/src/server/stealth.rsexports stealth mode protocol detectiondetect_protocol(stream: TlsStream) -> ProtocolDetection— peeks at first bytes to determine SSH vs HTTPProtocolDetectionenum:Ssh,Http(orUnknown)- If SSH detected: pass stream to
russh::server::run_stream() - If HTTP/unknown detected: write
HTTP/1.1 404 Not Found\r\nServer: nginx\r\n\r\nthen close - Peek uses
tokio::io::BufReaderor similar buffered read to avoid consuming the SSH banner bytes - Integration with
TlsAcceptorflow: after accept + TLS handshake, optionally run protocol detection before passing to russh - Stealth mode flag validated: requires TLS transport, warn/reject otherwise
- Unit tests: SSH banner detection, HTTP request detection, random data → fake nginx 404
- Integration test: stealth server responds to HTTP scanner with 404, SSH client connects successfully
References
- docs/architecture/server.md — Stealth Mode section
- docs/architecture/decisions/017-stealth-mode-protocol-multiplexing.md — protocol multiplexing design
Notes
To be filled by implementation agent
Summary
To be filled on completion