Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikitastupin/mitmproxy-mqtt-script
Inspect MQTT over TLS traffic with ease!
https://github.com/nikitastupin/mitmproxy-mqtt-script
man-in-the-middle mitm mitmproxy mqtt ssl tls
Last synced: 22 days ago
JSON representation
Inspect MQTT over TLS traffic with ease!
- Host: GitHub
- URL: https://github.com/nikitastupin/mitmproxy-mqtt-script
- Owner: nikitastupin
- License: mit
- Created: 2020-04-22T19:36:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-19T09:10:12.000Z (about 2 years ago)
- Last Synced: 2023-03-05T19:47:45.859Z (over 1 year ago)
- Topics: man-in-the-middle, mitm, mitmproxy, mqtt, ssl, tls
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 17
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This script is ad-hoc solution for inspecting **MQTT over TLS** traffic. As far as I know Wireshark solves this problem but obtaining TLS master keys from IoT device might be a pain. Also you can log MQTT topics, just uncomment lines at the bottom of the `mqtt_message.py`.
## Usage
Run mitmproxy as `mitmproxy --mode transparent --tcp-hosts '.*' -s mqtt_message.py`. Messages will be displayed at the event log (press `shift + e`).
Of course before that you have to prepare a target device and your host running mitmproxy:
* Install mitmproxy's root certificate on a target device.
* Route device's traffic to mitmproxy. See https://docs.mitmproxy.org/stable/ for the details.
* https://docs.mitmproxy.org/stable/howto-transparent/.If server requires x509 client authentication `--set client_certs=cert.pem` mitmproxy's option might be useful.
## Roadmap
- [x] [Add support for non-HTTP flows to the UI](https://github.com/mitmproxy/mitmproxy/issues/1020).
- [ ] Implement parsing of MQTT packet types other than `CONNECT`, `PUBLISH` and `SUBSCRIBE`.
- [ ] Add support for MQTT to mitmproxy including interception, modification and replay.## Credits
* https://github.com/mitmproxy/mitmproxy/blob/master/examples/complex/tcp_message_buffer.py
* https://github.com/eclipse/paho.mqtt.python/blob/master/src/paho/mqtt/client.py