Service bank
SERVICE 4222/tcp 8222/tcp 6222/tcp

NATS

High-performance messaging system on 4222, with an HTTP monitoring port on 8222. Often deployed without authentication — subscribe to the '>' wildcard and every message on the bus streams to you.

Ports

PortProtoNotes
4222tcpNATS client protocol
8222tcpHTTP monitoring
6222tcpcluster routing

Fingerprint

  • Connecting returns an INFO JSON line with version + auth_required
  • 8222 serves /varz, /connz monitoring JSON

Exploitation primitives

  • INFO line reveals whether auth_required is false (open bus)
  • Subscribe to '>' (all subjects) and read every message — often app data and creds
  • Monitoring port (/connz, /subsz) leaks clients and subjects

Overview

NATS on 4222 is a fast message bus. If auth_required is false, you can read everything flowing across it.

Enumeration

Grab the INFO banner (check auth_required):

nc -nv <TARGET> 4222

Monitoring JSON (clients, subjects):

curl -s http://<TARGET>:8222/connz | jq

Subscribe to everything

nats -s nats://<TARGET>:4222 sub ">"

Hardening

Require token/user-password or NKEY/JWT auth, disable the open monitoring port externally, and use TLS.

References