mirror of
https://github.com/cisagov/snafflepy
synced 2026-09-24 18:22:23 +00:00
exit after missing domain
This commit is contained in:
@@ -18,16 +18,18 @@ def begin_snaffle(options):
|
|||||||
sleep(0.2)
|
sleep(0.2)
|
||||||
|
|
||||||
if(not options.domain):
|
if(not options.domain):
|
||||||
log.info("Domain not given, retrieving automatically.")
|
log.info("Domain not provided, retrieving automatically.")
|
||||||
s = Server(options.targets[0], get_info = ALL)
|
s = Server(options.targets[0], get_info = ALL)
|
||||||
c = Connection(s)
|
c = Connection(s)
|
||||||
if(not c.bind()):
|
if(not c.bind()):
|
||||||
log.error("Could not get domain automatically")
|
log.error("Could not get domain automatically")
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
options.domain = s.info.other["ldapServiceName"][0].split("@")[1]
|
options.domain = s.info.other["ldapServiceName"][0].split("@")[1]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("Could not get domain automatically")
|
log.error("Could not get domain automatically")
|
||||||
|
sys.exit(1)
|
||||||
c.unbind()
|
c.unbind()
|
||||||
|
|
||||||
domain_names = []
|
domain_names = []
|
||||||
|
|||||||
Reference in New Issue
Block a user