|
14 | 14 | # Remi GASCOU (@podalirius_)
|
15 | 15 | #
|
16 | 16 |
|
17 |
| -import argparse |
18 |
| -import sys |
19 |
| -import traceback |
20 |
| -import logging |
21 |
| -import threading |
22 |
| -from enum import Enum |
23 | 17 | from concurrent.futures import ThreadPoolExecutor
|
24 |
| -from impacket import version |
| 18 | +from enum import Enum |
25 | 19 | from impacket.examples import logger, utils
|
| 20 | +from impacket import version |
26 | 21 | from impacket.smbconnection import SMBConnection, SMB2_DIALECT_002, SMB2_DIALECT_21, SMB_DIALECT, SessionError
|
| 22 | +from impacket.spnego import SPNEGO_NegTokenInit, TypesMech |
| 23 | +import argparse |
| 24 | +import binascii |
| 25 | +import json |
27 | 26 | import ldap3
|
| 27 | +import logging |
28 | 28 | import nslookup
|
29 |
| -import json |
| 29 | +import os |
| 30 | +import ssl |
| 31 | +import sys |
| 32 | +import threading |
30 | 33 | import time
|
| 34 | +import traceback |
| 35 | + |
31 | 36 |
|
32 | 37 | COMMON_SHARES = [
|
33 | 38 | "C$", "D$",
|
@@ -204,8 +209,8 @@ def ldap3_kerberos_login(connection, target, user, password, domain='', lmhash='
|
204 | 209 | if len(nthash) % 2:
|
205 | 210 | nthash = '0' + nthash
|
206 | 211 | try: # just in case they were converted already
|
207 |
| - lmhash = unhexlify(lmhash) |
208 |
| - nthash = unhexlify(nthash) |
| 212 | + lmhash = binascii.unhexlify(lmhash) |
| 213 | + nthash = binascii.unhexlify(nthash) |
209 | 214 | except TypeError:
|
210 | 215 | pass
|
211 | 216 |
|
@@ -405,12 +410,12 @@ def worker(args, target_name, domain, username, password, address, lmhash, nthas
|
405 | 410 | "computer": target_name,
|
406 | 411 | "comment": sharecomment,
|
407 | 412 | "type": {
|
408 |
| - "stype_value":sharetype, |
409 |
| - "stype_flags":STYPE_MASK(sharetype) |
| 413 | + "stype_value": sharetype, |
| 414 | + "stype_flags": STYPE_MASK(sharetype) |
410 | 415 | }
|
411 | 416 | }
|
412 | 417 | f = open(args.output_file, "a")
|
413 |
| - f.write(json.dumps(d)+"\n") |
| 418 | + f.write(json.dumps(d) + "\n") |
414 | 419 | f.close()
|
415 | 420 | lock.release()
|
416 | 421 | elif args.debug:
|
|
0 commit comments