dissect.target 3.18.dev15__py3-none-any.whl → 3.19.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ import time
10
10
  import urllib
11
11
  from dataclasses import dataclass
12
12
  from functools import lru_cache
13
+ from getpass import getpass
13
14
  from pathlib import Path
14
15
  from struct import pack, unpack_from
15
16
  from threading import Thread
@@ -270,19 +271,25 @@ class Broker:
270
271
  case = None
271
272
  bytes_received = 0
272
273
  monitor = False
274
+ username = None
275
+ password = None
273
276
 
274
277
  diskinfo = {}
275
278
  index = {}
276
279
  topo = {}
277
280
  factor = 1
278
281
 
279
- def __init__(self, broker: Broker, port: str, key: str, crt: str, ca: str, case: str, **kwargs):
282
+ def __init__(
283
+ self, broker: Broker, port: str, key: str, crt: str, ca: str, case: str, username: str, password: str, **kwargs
284
+ ):
280
285
  self.broker_host = broker
281
286
  self.broker_port = int(port)
282
287
  self.private_key_file = key
283
288
  self.certificate_file = crt
284
289
  self.cacert_file = ca
285
290
  self.case = case
291
+ self.username = username
292
+ self.password = password
286
293
  self.command = kwargs.get("command", None)
287
294
 
288
295
  def clear_cache(self) -> None:
@@ -393,6 +400,7 @@ class Broker:
393
400
  tls_version=ssl.PROTOCOL_TLS,
394
401
  ciphers=None,
395
402
  )
403
+ self.mqtt_client.username_pw_set(self.username, self.password)
396
404
  self.mqtt_client.tls_insecure_set(True) # merely having the correct cert is ok
397
405
  self.mqtt_client.on_connect = self._on_connect
398
406
  self.mqtt_client.on_message = self._on_message
@@ -411,6 +419,8 @@ class Broker:
411
419
  @arg("--mqtt-ca", dest="ca", help="certificate authority file")
412
420
  @arg("--mqtt-command", dest="command", help="direct command to client(s)")
413
421
  @arg("--mqtt-diag", action="store_true", dest="diag", help="show MQTT diagnostic information")
422
+ @arg("--mqtt-username", dest="username", help="Username for connection")
423
+ @arg("--mqtt-password", action="store_true", dest="password", help="Ask for password before connecting")
414
424
  class MQTTLoader(Loader):
415
425
  """Load remote targets through a broker."""
416
426
 
@@ -435,7 +445,10 @@ class MQTTLoader(Loader):
435
445
  if cls.broker is None:
436
446
  if (uri := kwargs.get("parsed_path")) is None:
437
447
  raise LoaderError("No URI connection details have been passed.")
448
+
438
449
  options = dict(urllib.parse.parse_qsl(uri.query, keep_blank_values=True))
450
+ if options.get("password"):
451
+ options["password"] = getpass()
439
452
  cls.broker = Broker(**options)
440
453
  cls.broker.connect()
441
454
  num_peers = int(options.get("peers", 1))
@@ -907,17 +907,20 @@ class EXTENSION_BLOCK_BEEF0004(EXTENSION_BLOCK): # noqa
907
907
  self.file_reference = c_bag.uint64(fh)
908
908
  c_bag.uint64(fh)
909
909
  if version >= 3:
910
- long_len = c_bag.uint16(fh)
910
+ # Start of strings
911
+ localized_name_offset = c_bag.uint16(fh)
911
912
  if version >= 9:
912
913
  c_bag.uint32(fh)
913
914
  if version >= 8:
914
915
  c_bag.uint32(fh)
915
916
  if version >= 3:
916
917
  self.long_name = c_bag.wchar[None](fh)
917
- if 3 <= version < 7 and long_len > 0:
918
- self.localized_name = c_bag.char[long_len](fh)
919
- if version >= 7 and long_len > 0:
920
- self.localized_name = c_bag.wchar[long_len](fh)
918
+
919
+ if 3 <= version < 7 and localized_name_offset > 0:
920
+ self.localized_name = c_bag.char[None](fh)
921
+
922
+ if version >= 7 and localized_name_offset > 0:
923
+ self.localized_name = c_bag.wchar[None](fh)
921
924
 
922
925
 
923
926
  class EXTENSION_BLOCK_BEEF0005(EXTENSION_BLOCK): # noqa
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.18.dev15
3
+ Version: 3.19.dev1
4
4
  Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -86,7 +86,7 @@ dissect/target/loaders/itunes.py,sha256=rKOhlDRypQBGkuSZudMDS1Mlb9XV6BD5FRvM7tGq
86
86
  dissect/target/loaders/kape.py,sha256=t5TfrGLqPeIpUUpXzIl6aHsqXMEGDqJ5YwDCs07DiBA,1237
87
87
  dissect/target/loaders/local.py,sha256=Ul-LCd_fY7SyWOVR6nH-NqbkuNpxoZVmffwrkvQElU8,16453
88
88
  dissect/target/loaders/log.py,sha256=cCkDIRS4aPlX3U-n_jUKaI2FPSV3BDpfqKceaU7rBbo,1507
89
- dissect/target/loaders/mqtt.py,sha256=wba1AFopF4ANvA5YiXd6_8T-5kRBLsiKA5xCPmrD7Xk,16024
89
+ dissect/target/loaders/mqtt.py,sha256=pn2VtFh0jeYXMod4CuZOKGhe2ScQixJ1Xhx6MHe0rzk,16540
90
90
  dissect/target/loaders/multiraw.py,sha256=4a3ZST0NwjnfPDxHkcEfAcX2ddUlT_C-rcrMHNg1wp4,1046
91
91
  dissect/target/loaders/ova.py,sha256=6h4O-7i87J394C6KgLsPkdXRAKNwtPubzLNS3vBGs7U,744
92
92
  dissect/target/loaders/overlay.py,sha256=tj99HKvNG5_JbGfb1WCv4KNSbXXSnEcPQY5XT-JUxn8,992
@@ -313,7 +313,7 @@ dissect/target/plugins/os/windows/regf/nethist.py,sha256=QHbG9fmZNmjSVhrgqMvMo12
313
313
  dissect/target/plugins/os/windows/regf/recentfilecache.py,sha256=goS6ajLIh6ZU-Gq4tupoxBoQCfMDp2qJgg-Nn5qFIsY,1850
314
314
  dissect/target/plugins/os/windows/regf/regf.py,sha256=D1GrljF-sV8cWIjWJ3zH7k52i1OWD8poEC_PIeZMEis,3419
315
315
  dissect/target/plugins/os/windows/regf/runkeys.py,sha256=-2HcdnVytzCt1xwgAI8rHDnwk8kwLPWURumvhrGnIHU,4278
316
- dissect/target/plugins/os/windows/regf/shellbags.py,sha256=t6874fvnZoQ05H0-G95-a8RpmCWjz0dli6hHGu5jBEQ,25615
316
+ dissect/target/plugins/os/windows/regf/shellbags.py,sha256=hXAqThFkHmGPmhNRSXwMNzw25kAyIC6OOZivgpPEwTQ,25679
317
317
  dissect/target/plugins/os/windows/regf/shimcache.py,sha256=no78i0nxbnfgDJ5TpDZNAJggCigD_zLrXNYss7gdg2Q,9994
318
318
  dissect/target/plugins/os/windows/regf/trusteddocs.py,sha256=3yvpBDM-Asg0rvGN2TwALGRm9DYogG6TxRau9D6FBbw,3700
319
319
  dissect/target/plugins/os/windows/regf/usb.py,sha256=hR5fnqy_sint1YyWgm1-AMhGQ4MxJOH_Wz0vbYzr9p4,7213
@@ -345,10 +345,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
345
345
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
346
346
  dissect/target/volumes/md.py,sha256=j1K1iKmspl0C_OJFc7-Q1BMWN2OCC5EVANIgVlJ_fIE,1673
347
347
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
348
- dissect.target-3.18.dev15.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
349
- dissect.target-3.18.dev15.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
350
- dissect.target-3.18.dev15.dist-info/METADATA,sha256=pRN634Yl_-MZVraWNkNflgF-LUz4LB7RgBf8oCGiKDw,12719
351
- dissect.target-3.18.dev15.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
352
- dissect.target-3.18.dev15.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
353
- dissect.target-3.18.dev15.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
354
- dissect.target-3.18.dev15.dist-info/RECORD,,
348
+ dissect.target-3.19.dev1.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
349
+ dissect.target-3.19.dev1.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
350
+ dissect.target-3.19.dev1.dist-info/METADATA,sha256=bNNn8eDSCLjMdDV-O56FQolA5nyhvCYTiZuRrsvS1V8,12718
351
+ dissect.target-3.19.dev1.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
352
+ dissect.target-3.19.dev1.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
353
+ dissect.target-3.19.dev1.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
354
+ dissect.target-3.19.dev1.dist-info/RECORD,,