Skip to content
Merged
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ee6541c
WIP
cecinestpasunepipe Feb 14, 2024
b0b1c8a
Add tests.
cecinestpasunepipe Feb 19, 2024
5406e86
Add types.
cecinestpasunepipe Feb 20, 2024
25a9bca
Add types.
cecinestpasunepipe Feb 20, 2024
cf7254d
Update lru_cache.
cecinestpasunepipe Feb 20, 2024
dc5ca1b
Add dependency MQTT-PAHO.
cecinestpasunepipe Feb 21, 2024
8a3b128
Use posix_path for virtual path to child target.
cecinestpasunepipe Feb 21, 2024
816459b
Keep remoteloader, add separate mqttloader.
cecinestpasunepipe Feb 21, 2024
a759a53
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 26, 2024
505e82c
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 26, 2024
d1d6ae1
Improvements
cecinestpasunepipe Feb 26, 2024
38823a8
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 26, 2024
ea08c00
Improvements
cecinestpasunepipe Feb 26, 2024
5c76732
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 26, 2024
a6da357
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 26, 2024
4faa1f4
Update tests/loaders/test_mqtt.py
cecinestpasunepipe Feb 26, 2024
8bf8c76
Improvements
cecinestpasunepipe Feb 26, 2024
2f1ad6a
Improvements.
cecinestpasunepipe Feb 27, 2024
6556984
Improvements.
cecinestpasunepipe Feb 27, 2024
b250544
Improvements.
cecinestpasunepipe Feb 27, 2024
265f1cf
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 27, 2024
dbb4e4a
Improvements.
cecinestpasunepipe Feb 27, 2024
2e570f5
Improvements.
cecinestpasunepipe Feb 27, 2024
2948bbc
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 27, 2024
0334aa1
Update dissect/target/loaders/mqtt.py
cecinestpasunepipe Feb 27, 2024
6e64e45
Custom command support in MQTT-loader (DIS-2906)
cecinestpasunepipe Mar 6, 2024
f9567d1
Add support for Custom MQTT commands (DIS-2906)
cecinestpasunepipe Mar 12, 2024
31154ff
Merge branch 'main' into DIS-2906_Custom_Command_MQTT
cecinestpasunepipe Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dissect/target/loaders/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def __init__(self, broker: Broker, port: str, key: str, crt: str, ca: str, case:
self.certificate_file = crt
self.cacert_file = ca
self.case = case
self.command = kwargs.get("command", None)

@suppress
def read(self, host: str, disk_id: int, seek_address: int, read_length: int) -> SeekMessage:
Expand Down Expand Up @@ -182,6 +183,8 @@ def _on_id(self, hostname: str, payload: bytes) -> None:
self.topo[key].append(payload.decode("utf-8"))
self.mqtt_client.subscribe(f"{self.case}/{host}/DISKS")
self.mqtt_client.subscribe(f"{self.case}/{host}/READ/#")
if self.command is not None:
self.mqtt_client.publish(f"{self.case}/{host}/COMM", self.command.encode("utf-8"))
time.sleep(1)

def _on_log(self, client: mqtt.Client, userdata: Any, log_level: int, message: str) -> None:
Expand Down Expand Up @@ -245,6 +248,7 @@ def connect(self) -> None:
@arg("--mqtt-key", dest="key", help="private key file")
@arg("--mqtt-crt", dest="crt", help="client certificate file")
@arg("--mqtt-ca", dest="ca", help="certificate authority file")
@arg("--mqtt-command", dest="command", help="direct command to client(s)")
class MQTTLoader(Loader):
"""Load remote targets through a broker."""

Expand Down