Documentation
¶
Overview ¶
Package banner performs a lightweight read on an already-open TCP connection, returning up to a few hundred bytes of service banner.
This is intentionally passive — no HTTP GET, no TLS handshake, no protocol-specific probes. Many services (SSH, SMTP, FTP, Redis, MySQL, IRC, POP3, IMAP, VNC) advertise themselves on connect; HTTP does not. A richer, per-protocol probe belongs in the Phase 5 scripting engine.
Index ¶
Constants ¶
const DefaultMaxBytes = 256
DefaultMaxBytes caps the banner read. Keeps noisy services (Cassandra, MongoDB) from dumping huge binary blobs into output.
Variables ¶
This section is empty.
Functions ¶
func Grab ¶
func Grab(ctx context.Context, addr netip.Addr, port uint16, timeout time.Duration, maxBytes int) (string, error)
Grab opens addr:port, reads up to maxBytes bytes within timeout, and returns whatever arrived as a sanitized single-line string. Returns "" when nothing arrived inside the window (common for HTTP).
maxBytes<=0 uses DefaultMaxBytes; timeout<=0 uses 500ms.
Types ¶
This section is empty.