Skip to content
Misconfiguration Write-up Beginner

Mqtt Mosquitto

An MQTT broker on port 1883 allowed anonymous client access, so anyone on the network could subscribe to all topics and read the messages flowing through them. The author used that access to read a base64-encoded message, publish a crafted reply to a topic, and receive a further encoded response that revealed a flag file.

Ryan Yager Follow

Published on systemweakness.com

Today we are going to take look at port 1883 mosquitto. We started off on a box and from outside the network, so I ran an NMAP scan on the service and also looked up on hacktricks of WTF is port 1883?

Ryan Yager, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the MQTT broker was configured to permit anonymous connections and did not restrict which topics a client could subscribe to or publish on.

Impact

Anyone able to reach the broker could read all messages on every topic and publish their own, which in this case exposed a flag file.

What the attacker needed

Network access to port 1883; mosquitto client installed

How it was found

  1. Scan the host and identify the MQTT service on port 1883.
  2. Install the mosquitto client tools.
  3. Subscribe to all topics using the wildcard to observe traffic.
  4. Read the base64-encoded message that arrives on a topic.
  5. Publish a message to the relevant topic from a second terminal.
  6. Observe the new encoded response, decode it, and read the flag file.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

MQTT is a lightweight messaging system often used by smart home devices; devices publish messages to named channels called topics and others subscribe to them. If the broker lets anyone connect without a username or password, anyone who can reach it can listen in on every topic. Here the author listened to all topics, saw encoded text, sent a message back, and got more encoded text that contained a flag.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Ryan Yager

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.