dploot 2.6.1__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.1 → dploot-2.6.2}/PKG-INFO +1 -1
  2. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/browser.py +1 -1
  3. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/certificates.py +1 -1
  4. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/credentials.py +1 -1
  5. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/machinecertificates.py +1 -1
  6. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/machinecredentials.py +1 -1
  7. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/machinetriage.py +1 -3
  8. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/masterkeys.py +5 -5
  9. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/rdg.py +1 -1
  10. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/sccm.py +0 -3
  11. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/triage.py +1 -2
  12. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/vaults.py +1 -1
  13. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/crypto.py +4 -4
  14. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/dpapi.py +2 -2
  15. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/smb.py +2 -3
  16. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/utils.py +3 -3
  17. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/wmi.py +0 -3
  18. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/certificates.py +2 -2
  19. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/sccm.py +1 -5
  20. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/vaults.py +0 -1
  21. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/wifi.py +1 -1
  22. {dploot-2.6.1 → dploot-2.6.2}/pyproject.toml +1 -1
  23. {dploot-2.6.1 → dploot-2.6.2}/LICENSE +0 -0
  24. {dploot-2.6.1 → dploot-2.6.2}/README.md +0 -0
  25. {dploot-2.6.1 → dploot-2.6.2}/dploot/__init__.py +0 -0
  26. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/__init__.py +0 -0
  27. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/backupkey.py +0 -0
  28. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/machinemasterkeys.py +0 -0
  29. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/machinevaults.py +0 -0
  30. {dploot-2.6.1 → dploot-2.6.2}/dploot/action/wifi.py +0 -0
  31. {dploot-2.6.1 → dploot-2.6.2}/dploot/entry.py +0 -0
  32. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/__init__.py +0 -0
  33. {dploot-2.6.1 → dploot-2.6.2}/dploot/lib/target.py +0 -0
  34. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/__init__.py +0 -0
  35. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/backupkey.py +0 -0
  36. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/browser.py +0 -0
  37. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/credentials.py +0 -0
  38. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/masterkeys.py +0 -0
  39. {dploot-2.6.1 → dploot-2.6.2}/dploot/triage/rdg.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dploot
3
- Version: 2.6.1
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'
@@ -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
 
@@ -2,7 +2,6 @@ import argparse
2
2
  import logging
3
3
  import sys
4
4
  from typing import Callable, Tuple
5
- from dploot.action.masterkeys import parse_masterkeys_options
6
5
 
7
6
  from dploot.lib.smb import DPLootSMBConnection
8
7
  from dploot.lib.target import Target, add_target_argument_group
@@ -33,8 +32,6 @@ class SCCMAction:
33
32
  logging.error(str(e))
34
33
  sys.exit(1)
35
34
 
36
- self.pvkbytes, self.passwords, self.nthashes = parse_masterkeys_options(self.options, self.target)
37
-
38
35
  def connect(self) -> None:
39
36
  self.conn = DPLootSMBConnection(self.target)
40
37
  if self.conn.connect() is None:
@@ -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
 
@@ -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
@@ -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
@@ -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.1"
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
File without changes
File without changes
File without changes
File without changes