Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Mqtt Iov?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/blackfoxxx-mqtt-iov)
---
name: mqtt-iov
description: "MQTT/IoV: anonymous access, topic ACL, retained data, VIN scope"
---
# MQTT & Internet-of-Vehicles (IoV) backend testing
MQTT is the most common message bus in IoT and IoV (TSP/telemetry) backends. Under a **granted authorization**, this skill systematically assesses the security of an MQTT broker and the business topics it carries.
---
## Boundaries and prohibitions (the agent must read these; violating them is out of scope)
| Area | Allowed | Forbidden |
|---|---|---|
| **Access** | Test anonymous connection, weak passwords, client-id conflicts | Large-scale brute force against real credentials, knocking the broker over |
| **Topics** | Subscribe to enumerate, read visible messages, `$SYS` stats | Publishing to **control/command** topics in ways that could affect physical devices |
| **Privilege escalation** | Verify whether one device identity can read/write another device's topics (cross-VIN horizontal escalation) | Actually triggering the other vehicle/device's action (unlock, start, OTA, steering, ...) |
| **Availability** | Read, passive observation | DoS, message storms, clearing retained messages, kicking production devices offline |
> ⚠️ **Physical-safety red line**: command topics on IoV/industrial MQTT (e.g. `.../command`, `.../rpc/request`) can drive real vehicles or devices. **By default only decide "could we send" (harmless probe payloads, or verify on an isolated test device) — never send a physically-acting command to a production target**; actually sending one requires written authorization and a controlled environment. Discovering an unauthorized write permission is itself a critical finding — no real-world consequence is needed to "prove" it.
---
## Tools
- `mosquitto_sub` / `mosquitto_pub` (the `mosquitto-clients` package) — most universal.
- `mqttx` (MQTTX CLI), `mqtt` (HiveMQ mqtt-cli) — MQTT 5.0, WebSocket.
- `mqttsa`, `mqtt-pwn` — dedicated MQTT security assessment/enumeration.
- `nmap` NSE: `mqtt-subscribe`.
- Ports: `1883` plaintext / `8883` TLS / `9001` (common WebSocket, path usually `/mqtt`).
---
## Execution roadmap
```
Phase 0 identify ports and shape → Phase 1 anonymous access → Phase 2 topic enumeration + $SYS fingerprint
→ Phase 3 auth / ACL escalation → Phase 4 retained messages / sensitive data → Phase 5 TLS + version vulns
→ summarize + insert_assets + report_finding
```
### Phase 0 — Ports and shape
```bash
nmap -p 1883,8883,9001,61613,15675 -sV <HOST>
```
Distinguish: native MQTT (1883/8883), MQTT over WebSocket (9001 `/mqtt`, or `wss://host/mqtt` behind nginx), and broker management ports (EMQX Dashboard 18083, RabbitMQ-MQTT plugin 15672).
### Phase 1 — Anonymous access
```bash
# Can connect and receive anything = anonymous read (a high-severity starting point)
mosquitto_sub -h <HOST> -p 1883 -t '$SYS/#' -v -W 5
mosquitto_sub -h <HOST> -p 1883 -t '#' -v -W 10 # wildcard-subscribe to all topics
```
- Connection refused / credentials required → go to Phase 3.
- `$SYS/#` readable usually means anonymous is open (`allow_anonymous true`) — record it as a finding.
### Phase 2 — Topic enumeration + broker fingerprint
```bash
mosquitto_sub -h <HOST> -t '$SYS/broker/version' -v -C 1 # broker and version
mosquitto_sub -h <HOST> -t '$SYS/broker/clients/#' -v -W 5 # online client count
```
- Subscribe with `#` for tens of seconds and induce the topic naming pattern: IoV commonly has `vehicle/{vin}/telemetry`, `device/{id}/up`, `tsp/{tenant}/...`, `$share/...` (shared subscriptions).
- Infer the **tenant/device identifier fields** (VIN, deviceId, IMEI) from the topic structure — these are the anchors for Phase 3 escalation.
- Don't flood raw messages; summarize "which topic families exist + which segment holds the identifier".
### Phase 3 — Authentication and ACL escalation (the core)
```bash
# Weak/default passwords (small dictionary, low speed; no large-scale brute force)
mosquitto_sub -h <HOST> -u admin -P public -t '#' -v -W 5
# Common defaults: admin/public, admin/admin, emqx/public, guest/guest, mqtt/mqtt
```
**Horizontal escalation (the key IoV check)**: with device A's identity, try to subscribe to / write device B's topics.
```bash
# With A's credentials, subscribe to B's VIN topic — receiving data means cross-device unauthorized read
mosquitto_sub -h <HOST> -u <A_user> -P <A_pass> -t 'vehicle/<OTHER_VIN>/#' -v -W 10
# With A's credentials, "try to publish" to B's command topic — use a harmless placeholder payload to decide "does the ACL let it through"
# This only verifies write permission, no real command is sent; accepted by the broker (no disconnect / no ACL reject) means unauthorized write
mosquitto_pub -h <HOST> -u <A_user> -P <A_pass> -t 'vehicle/<OTHER_VIN>/noop-probe' -m 'authz-test' -q 1
```
Decision points: does the ACL confine each device to its own topic subtree by client-id/username; are the `#`/`+` wildcards restricted; does `$share` shared subscription bypass the ACL. **Cross-VIN telemetry read or a writable foreign command topic = severe unauthorized access** — `report_finding` on it; no physical action needed.
### Phase 4 — Retained messages and sensitive data
- Retained messages are pushed on subscribe and often carry credentials, tokens, locations, firmware URLs, configuration.
- The first messages received by `mosquitto_sub -t '#' -v` are the retained ones; summarize their sensitive fields.
- LWT (last-will) messages and IPs/hostnames in `$SYS` can also leak internal topology.
### Phase 5 — TLS and version vulnerabilities
```bash
# Is TLS enforced, is the cert self-signed/expired, is a client certificate (mTLS) required
openssl s_client -connect <HOST>:8883 -servername <HOST> </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
```
- Business traffic on plaintext 1883 = no transport encryption (a man-in-the-middle can read/write).
- Check CVEs by broker version: Mosquitto, EMQX, HiveMQ, VerneMQ, NanoMQ all have historical auth-bypass/DoS issues.
- Also test the management plane (EMQX Dashboard, RabbitMQ console) default passwords and unauthenticated APIs (that part goes back to web methodology; pair with api-recon).
---
## IoV / TSP specific points
- **Identifier-based escalation** is the number-one IoV issue: VIN/IMEI/deviceId are often predictable or extractable from the app/firmware; if the ACL only checks "connected" instead of "is this your own device", the whole fleet can be controlled horizontally.
- MQTT is usually one link: combine with the TSP cloud's HTTP API (use api-recon), head-unit app reversing (extract broker address/cert/topic patterns) and firmware analysis (binwalk to extract embedded credentials).
- On the command chain (app → cloud → MQTT → head unit), the key check is **whether every hop validates device ownership**, not just the app layer.
---
## Deliverables
- `report_finding` for every confirmed issue: anonymous access, weak/default passwords, cross-device unauthorized read/write, plaintext transport, retained-message data leaks, unauthenticated management plane, known CVEs.
- `insert_assets` for the broker service (host:port, service_name=mqtt, version) and the management-plane endpoints.
- Keep evidence: subscribe/publish commands and broker responses, the `$SYS` fingerprint, the escalation request/response; **do not keep raw private telemetry bodies** — record field names and the escalation fact only.