-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objectSid values is Garbled #224
Comments
func (e *EntryAttribute) Print() |
Try using a base64 encoding.
|
I ran into this issue as well and couldn't find an existing Go example on how to solve this. So, I found some examples in other languages and wrote a Go version. So, just in case it would be helpful for others, https://github.com/bwmarrin/go-objectsid |
@bwmarrin Feel free to make a pull request to integrate your code and become a contributor. Community support is always welcomed |
@stefanmcshane I'm not opposed to that - but I'm not sure the best way to implement this into go-ldap. What go-ldap returns is a valid, albeit low level, result - not a bug. The issue here is when users want to present that data as a string, how should they go about doing that. They could use my library I linked above or a helper function could also be added to go-ldap. Or maybe if the library maintainers would prefer to just return the string format, then that's another approach. I'm open to feedback on what would make the most sense. |
We would not want to change the return value to string as it would cause breaking changes for whomever is using the library. |
I have the same problem and I tried this solution as follow, but sid is still empty. objectSid := entry.GetRawAttributeValue("ObjectSid")
sid := base64.StdEncoding.EncodeToString(objectSid)
fmt.Println(sid) |
@L0nm4r if you're setting the
|
I found it was case problem👀, I changed the code like this and it worked : objectSid := entry.GetRawAttributeValue("objectSid")
sid := base64.StdEncoding.EncodeToString(objectSid)
fmt.Println(sid) Sorry to bother you and thanks for your reply! |
Lots of Active Directory attributes are binary encoded. The objectSid binary format is documented (very short) here https://ldapwiki.com/wiki/ObjectSID You could take a look at my project adalanche located here https://github.com/lkarlslund/adalanche It does decoding of objectSid and ntSecurityDescriptor attributes, and might give you some hints to get you started. It also does kick ass ACL analysis, but that's another matter :) |
objectSid values is Garbled
And can't get the attribute after "objectSid"
LDAP server is MS AD
The text was updated successfully, but these errors were encountered: