Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Latest commit

 

History

History
94 lines (82 loc) · 2.31 KB

mqtt.md

File metadata and controls

94 lines (82 loc) · 2.31 KB

MQTT

Grab MQTT information, including messages and topics.

This module connects to MQTT brokers and grabs data it. The module listens for 30 seconds for the first 100 messages until a maximum of 9 MB of data if received.

More information about MQTT at http://mqtt.org/documentation .

MQTT Request Example

curl -v -L https://api.binaryedge.io/v1/tasks -d '{"type":"scan", "options":[{"targets":["X.X.X.X"], "ports":[{"port":1883, "protocol":"tcp", "modules":["mqtt"]}]}]}' -H "X-Token:<Token>"

Schema

MQTT Event Schema

{
  ...
  "result": {
    "data": {
      "connected": "boolean",
      "auth": "boolean",
      "messages": ["string"],
      "topics": ["string"],
      "num_events": "int",
      "num_topics": "int",
      "bytes_captured": "int",
      "connack": {...}
    }
}

Contents of the fields:

MQTT Event Example

{
    "origin": {
        "type": "mqtt",
        "job_id": "client-3cee033d-981b-456d-a859-83d54f2ezb21",
        "client_id": "tiago",
        "module": "grabber",
        "country": "uk",
        "ts": 1472051982661
    },
    "target": {
        "ip": "XXX.XXX.XXX.XXX",
        "port": 1883
    },
    "result": {
        "data": {
            "connected": true,
            "auth": false,
            "messages": [{
                "topic": "/",
                "msg": "Hello world!"
            }, {
                "topic": "/kk",
                "msg": "test"
            },
            ...
            ],
            "connack": {
                "cmd": "connack",
                "retain": false,
                "qos": 0,
                "dup": false,
                "length": 2,
                "topic": null,
                "payload": null,
                "sessionPresent": false,
                "returnCode": 0
            },
            "num_events": 100,
            "num_topics": 100,
            "bytes_captured": 35208,
            "topics": ["/", "/kk",...]
        }
    }
}