dirkjanm / ldapdomaindump

Active Directory information dumper via LDAP
MIT License
1.13k stars 180 forks source link

gid = int(group.objectSid.value.split('-')[-1]) TypeError: a bytes-like object is required, not 'str' #64

Open flashoop opened 5 months ago

flashoop commented 5 months ago

python3 ldapdomaindump.py ldap://10.10.73.150

[] Connecting as anonymous user, dumping will probably fail. Consider specifying a username/password to login with [] Connecting to host... [] Binding to host [+] Bind OK [] Starting domain dump Traceback (most recent call last): File "/home/kali/tools/ldap/ldapdomaindump/ldapdomaindump.py", line 3, in ldapdomaindump.main() File "/home/kali/tools/ldap/ldapdomaindump/ldapdomaindump/init.py", line 956, in main dd.domainDump() File "/home/kali/tools/ldap/ldapdomaindump/ldapdomaindump/init.py", line 418, in domainDump rw.generateUsersReport(self) File "/home/kali/tools/ldap/ldapdomaindump/ldapdomaindump/init.py", line 801, in generateUsersReport dd.mapGroupsIdsToDns() File "/home/kali/tools/ldap/ldapdomaindump/ldapdomaindump/init.py", line 346, in mapGroupsIdsToDns gid = int(group.objectSid.value.split('-')[-1]) TypeError: a bytes-like object is required, not 'str'

dirkjanm commented 5 months ago

"Connecting as anonymous user, dumping will probably fail"

What scenario are you encountering that you expect anonymous enumeration to work? I'd need some more info to have a look at this issue. In a normal environment, anonymous enumeration will not work so an error is expected.

apolloteapot commented 4 months ago

I just got the same error on a Vulnlab machine (it's probably the same one). It seems to be because the DC allows anonymous bind but only to query a few specific DNs (CN=Users and some OUs), so it's normal the tool can't dump it all :)