add automatic retrieval of domain if not given

This commit is contained in:
root
2023-07-18 16:05:00 -04:00
parent 9c26a40f5d
commit 82fbfbfb69
+13
View File
@@ -17,6 +17,19 @@ def begin_snaffle(options):
print("Beginning the snaffle...")
sleep(0.2)
if(not options.domain):
log.info("Domain not given, retrieving automatically.")
s = Server(options.targets[0], get_info = ALL)
c = Connection(s)
if(not c.bind()):
log.error("Could not get domain automatically")
else:
try:
options.domain = s.info.other["ldapServiceName"][0].split("@")[1]
except Exception as e:
log.error("Could not get domain automatically")
c.unbind()
domain_names = []
# TODO: Talk to AD via LDAP to get list of computers with file shares
if options.disable_computer_discovery: