MQTT Pentesting
Enumeration
nmap --script mqtt-subscribe -p 1883 <target-ip>Interaction
sudo apt install -y mosquitto mosquitto-clientsSubscribe to a Topic
# -h: Host
# -t: Topic ('#' means "all topics")
# -d: Debug mode
mosquitto_sub -h example.com -t '#' -d
mosquitto_sub -h example.com -t '$SYS/#' -d
mosquitto_sub -h example.com -t path/to/topic
# local (without '-h' flag)
mosquitto_sub -t '#' -d
# -p: Port
mosquitto_sub -p 1883 -t sensors/temperature
# specify username/password
mosquitto_sub -u username -P password -t sensors/temperature
# -V: Specify protocol version (5, 31, 311 or mqttv5, mqttv31, mqttv311)
mosquitto_usb -h example.com -t 'example/topic' -V 31Publish to a Topic
Analyze with Wireshark
Last updated