File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1616
1717from sharehound .core .Config import Config
1818from sharehound .core .Logger import Logger
19+ from sharehound .utils .utils import is_port_open
1920
2021
2122def load_targets (options : argparse .Namespace , config : Config , logger : Logger ):
2223 targets = []
2324
24- if options .targets_file is not None or len (options .target ) != 0 :
25+ if (
26+ options .auth_dc_ip is not None
27+ and options .auth_user is not None
28+ and (options .auth_password is not None or options .auth_hashes is not None )
29+ ):
30+ if not is_port_open (
31+ options .auth_dc_ip , (389 if not options .ldaps else 636 ), timeout = 10
32+ ):
33+ logger .error (
34+ "Domain controller %s is not reachable on port %d"
35+ % (options .auth_dc_ip , (389 if not options .ldaps else 636 ))
36+ )
37+ return []
2538
39+ if options .targets_file is not None or len (options .target ) != 0 :
2640 # Loading targets line by line from a targets file
2741 if options .targets_file is not None :
2842 if os .path .exists (options .targets_file ):
You can’t perform that action at this time.
0 commit comments