ldapconsole
ldapconsole copied to clipboard
[bug] Error 'str' object has no attribute 'decode' when using the preset query all_users
When I tried the preset query all_users on a brand new Windows Server 2019, I got this error :
By changing code in the get_all_users function, it works fine (don't know if it's the intended way though) :
Modification in the get_all_users : removing the [0].decode(utf-8) part and [0] on _sAMAccountName and _sid variables respectively :
if len(results.keys()) != 0:
if attributes == ["objectSid", "sAMAccountName"]:
for distinguishedName in results.keys():
_sAMAccountName = results[distinguishedName]["sAMAccountName"]
_sid = format_sid(results[distinguishedName]["objectSid"])
print(" | \x1b[93m%-25s\x1b[0m : \x1b[96m%s\x1b[0m" % (_sAMAccountName, _sid))