mirror of
https://github.com/Pennyw0rth/NetExec
synced 2026-06-06 16:34:30 +00:00
fix for kerberoast function
This commit is contained in:
@@ -240,6 +240,9 @@ class ldap(connection):
|
||||
def kerberos_login(self, domain, username, password = '', ntlm_hash = '', aesKey = '', kdcHost = '', useCache = False):
|
||||
self.logger.extra['protocol'] = "LDAP"
|
||||
self.logger.extra['port'] = "389"
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.domain = domain
|
||||
# Get ldap info (target, targetDomain, baseDN)
|
||||
target, self.targetDomain, self.baseDN = self.get_ldap_info(self.host)
|
||||
|
||||
@@ -741,7 +744,6 @@ class ldap(connection):
|
||||
self.logger.highlight("No entries found!")
|
||||
elif resp:
|
||||
answers = []
|
||||
self.logger.info('Total of records returned %d' % len(resp))
|
||||
|
||||
for item in resp:
|
||||
if isinstance(item, ldapasn1_impacket.SearchResultEntry) is not True:
|
||||
@@ -792,6 +794,7 @@ class ldap(connection):
|
||||
pass
|
||||
|
||||
if len(answers)>0:
|
||||
self.logger.info('Total of records returned %d' % len(answers))
|
||||
TGT = KerberosAttacks(self).getTGT_kerberoasting()
|
||||
dejavue = []
|
||||
for SPN, sAMAccountName, memberOf, pwdLastSet, lastLogon, delegation in answers:
|
||||
|
||||
@@ -253,13 +253,16 @@ class smb(connection):
|
||||
|
||||
try:
|
||||
self.conn.login('' , '')
|
||||
except:
|
||||
#if "STATUS_ACCESS_DENIED" in e:
|
||||
self.domain = self.conn.getServerDNSDomainName()
|
||||
self.hostname = self.conn.getServerName()
|
||||
self.server_os = self.conn.getServerOS()
|
||||
except Exception as e:
|
||||
if "STATUS_NOT_SUPPORTED" in str(e):
|
||||
# no ntlm supported
|
||||
self.domain = self.args.domain
|
||||
self.hostname = self.host
|
||||
pass
|
||||
|
||||
self.domain = self.conn.getServerDNSDomainName()
|
||||
self.hostname = self.conn.getServerName()
|
||||
self.server_os = self.conn.getServerOS()
|
||||
try:
|
||||
self.signing = self.conn.isSigningRequired() if self.smbv1 else self.conn._SMBConnection._Connection['RequireSigning']
|
||||
except:
|
||||
@@ -358,7 +361,7 @@ class smb(connection):
|
||||
|
||||
# self.check_if_admin() # currently pywerview does not support kerberos auth
|
||||
|
||||
except SessionError as e:
|
||||
except (SessionError, Exception) as e:
|
||||
error = e
|
||||
try:
|
||||
self.conn.connectTree("C$")
|
||||
|
||||
Reference in New Issue
Block a user