Looks like the Mosquito MQTT service is not running. You could have network-related issues such as firewall (see this post) settings blocking the port on localhost, but Kali doesn’t ship with a firewall installed or enabled so unless you installed one, it’s more likely that Mosquitto MQTT service/process is being killed by the OOM Killer.
Unfortunately sudo gvm-check-setup
command does not check for the MQTT broker service. You can check it manually like so:
Check the service is running and start it if its not running:
sudo systemctl status mosquito
sudo systemctl start mosquitto
Check it is listening on correct port using netstat
(or ss
):
$ netstat -tuln | grep 1883
tcp LISTEN 0 100 127.0.0.1:1883 0.0.0.0:*
tcp LISTEN 0 100 [::1]:1883 [::]:*
Check for open connections:
sudo lsof -i :1883
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mosquitto 2210 mosquitto 5u IPv4 19261 0t0 TCP localhost:1883 (LISTEN)
mosquitto 2210 mosquitto 6u IPv6 19262 0t0 TCP localhost:1883 (LISTEN)
mosquitto 2210 mosquitto 8u IPv6 19278 0t0 TCP localhost:1883->localhost:55493 (ESTABLISHED)
mosquitto 2210 mosquitto 9u IPv6 32599 0t0 TCP localhost:1883->localhost:53661 (ESTABLISHED)
notus-sca 2226 _gvm 4u IPv6 27009 0t0 TCP localhost:55493->localhost:1883 (ESTABLISHED)
ospd-open 2232 _gvm 6u IPv6 24542 0t0 TCP localhost:53661->localhost:1883 (ESTABLISHED)
ospd-open 2236 _gvm 6u IPv6 24542 0t0 TCP localhost:53661->localhost:1883 (ESTABLISHED)
Check the logs to look for any errors
sudo tail -100 /var/log/mosquitto/mosquitto.log
To check if the Out-Of-Memory (OOM) Killer has terminated the Mosquitto process on a Linux system, you can inspect the system logs.
sudo grep -i 'oom' /var/log/syslog | grep -i 'mosquitto'