banner

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 9 Imported by: 0

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL