Skip to content

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkjanm committed Sep 6, 2018
1 parent c5acc3a commit 93e7cfa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ldapdomaindump/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

MINIMAL_COMPUTERATTRIBUTES = ['cn', 'sAMAccountName', 'dNSHostName', 'operatingSystem', 'operatingSystemServicePack', 'operatingSystemVersion', 'lastLogon', 'userAccountControl', 'whenCreated', 'objectSid', 'description', 'objectClass']
MINIMAL_USERATTRIBUTES = ['cn', 'name', 'sAMAccountName', 'memberOf', 'primaryGroupId', 'whenCreated', 'whenChanged', 'lastLogon', 'userAccountControl', 'pwdLastSet', 'objectSid', 'description', 'objectClass']
MINIMAL_GROUPATTRIBUTES = ['cn', 'sAMAccountName', 'memberOf', 'description', 'whenCreated', 'whenChanged', 'objectSid', 'distinguishedName', 'objectClass']
MINIMAL_GROUPATTRIBUTES = ['cn', 'name', 'sAMAccountName', 'memberOf', 'description', 'whenCreated', 'whenChanged', 'objectSid', 'distinguishedName', 'objectClass']

#Class containing the default config
class domainDumpConfig(object):
Expand Down Expand Up @@ -234,7 +234,7 @@ def getAllUserSpns(self):
if self.config.minimal:
self.connection.extend.standard.paged_search('%s' % (self.root), '(&(objectCategory=person)(objectClass=user)(servicePrincipalName=*))', attributes=MINIMAL_USERATTRIBUTES, paged_size=500, generator=False)
else:
self.connection.extend.standard.paged_search('%s' % (self.root), '(&(objectCategory=person)(objectClass=user)(servicePrincipalName=*))', attributes=dap3.ALL_ATTRIBUTES, paged_size=500, generator=False)
self.connection.extend.standard.paged_search('%s' % (self.root), '(&(objectCategory=person)(objectClass=user)(servicePrincipalName=*))', attributes=ldap3.ALL_ATTRIBUTES, paged_size=500, generator=False)
return self.connection.entries

#Get all defined groups
Expand Down Expand Up @@ -450,6 +450,8 @@ def nsToMinutes(self, length):
#Parse bitwise flags into a list
def parseFlags(self, attr, flags_def):
outflags = []
if attr is None:
return outflags
for flag, val in flags_def.items():
if attr.value & val:
outflags.append(flag)
Expand All @@ -458,6 +460,8 @@ def parseFlags(self, attr, flags_def):
#Parse bitwise trust direction - only one flag applies here, 0x03 overlaps
def parseTrustDirection(self, attr, flags_def):
outflags = []
if attr is None:
return outflags
for flag, val in flags_def.items():
if attr.value == val:
outflags.append(flag)
Expand Down

0 comments on commit 93e7cfa

Please sign in to comment.