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.
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?
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
- Scan the host and identify the MQTT service on port 1883.
- Install the mosquitto client tools.
- Subscribe to all topics using the wildcard to observe traffic.
- Read the base64-encoded message that arrives on a topic.
- Publish a message to the relevant topic from a second terminal.
- 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.