MQTT Broker Information via $SYS Topics
Most MQTT brokers publish internal statistics and configuration information under the $SYS topic hierarchy. These are read-only system topics that expose broker version, uptime, connected client list, message rates, and sometimes configuration details. Subscribing to $SYS/# pulls everything the broker publishes about itself without touching any application topics.
Not all brokers publish $SYS topics by default — Mosquitto does, HiveMQ has a different stats path, and some brokers disable it. If $SYS returns nothing, proceed to topic discovery without this step.
Subscribe to All $SYS Topics
$SYS/broker/version mosquitto version 1.6.9 $SYS/broker/uptime 382741 seconds $SYS/broker/clients/connected 14 $SYS/broker/clients/total 47 $SYS/broker/messages/received 1284930 $SYS/broker/messages/sent 983421 $SYS/broker/subscriptions/count 38 $SYS/broker/load/messages/received/1min 42.35 $SYS/broker/retained messages/count 23
Each topic reveals a different aspect of the broker state. Record all of them.
Key $SYS Topics to Note
Topic | What it reveals |
|---|---|
| Exact broker version — check against CVEs |
| Number of live clients |
| Total clients ever connected |
| How many retained messages exist — high count means more to harvest |
| Active subscriptions — indicates how many consumers are listening |
| Message rate — useful for timing passive collection |
A high retained messages/count value is particularly interesting — each retained message is a stored payload waiting to be read. Harvest them with MQTT Retained Message Harvest.
Connected Client Information
Some brokers publish per-client information:
Mosquitto does not publish individual client IDs by default, but HiveMQ and EMQX expose more detail:
Client IDs often contain device names, serial numbers, or hostnames that reveal the environment topology.
HiveMQ and EMQX Alternatives
HiveMQ publishes statistics under a different path:
EMQX uses:
If the broker is identified from version strings in Nmap or CONNACK packets, target the appropriate path.
Confirm Version Against Known CVEs
The version string from $SYS/broker/version goes straight to a CVE search. Mosquitto has had several notable vulnerabilities:
Search the returned version against the NVD:
References
-
Mosquitto — broker man pagemosquitto.org/man/mosquitto-8.html (opens in new tab)
Full $SYS topic hierarchy documentation for Mosquitto
-
HiveMQ — broker statisticswww.hivemq.com/blog/mqtt-broker-statistics-monitoring-hivemq-mqtt-broker (opens in new tab)
HiveMQ-specific system topic paths for monitoring data
Was this helpful?
Your feedback helps improve this page.