Very simple command and control
agent for Windows devices based on MQTT
with a simple web frontend
. Meant to be a framework rather than a complete product
MQtrol can be used for automating sysadmin stuff.
You can manage all (Windows) clients running the agent via web interface or directly over MQTT
- Install NodeJS from https://nodejs.org/en/
- Set a system wide environment variable with the key
mqtrol_broker_url
and the value of your mqtt broker URL. Eg:mqtt://192.168.1.51
- Go to the
agent
folder from a command prompt and runnpm install mqtt
- Open the file
/agent/install-service.bat
so the NSSM dialogue will appear - Use the following settings
- Application tab
- Path: Path to your node.exe
- Startup Directory: Full path to your agent folder (doesn't need the rest of the project folders, just
/agent
) - Arguments: Full path to your agent.js file
- Details tab (just fill in some name and desciption)
- Log on
- Ideally you'd use the Administrator account here
For this project to work your broker must support Websockets.
An example working Mosquitto config (for testing only) looks like this:
/etc/mosquitto/mosquitto.conf
allow_anonymous true
listener 1883
listener 9001
protocol websockets
- Create a new file
/web/broker.txt
and enter your websocket MQTT server URL. eg:ws://192.168.1.51:9001