-
Notifications
You must be signed in to change notification settings - Fork 377
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
Adding ldap support #55
Conversation
Fantastic work on this, and timely! I spent some time looking through the code (I'm fairly unfamiliar with Go), and it doesn't appear there's a way to retrieve a property for the RemoteAddress field from the ldapserver library. I see that it's at least included in the connection accepted message. Are there plans to expose that so it can be consumed by interactsh? Apologies if this isn't the place for this kind of discussion, I was just really excited to see this PR when I went looking. |
@maikthulhu, the latest commit, improved the message parsing for most types of queries. Still, the low-level logging is enabled to capture raw messages and interactions like TCP connections, tls negotiation, etc. |
Those changes definitely helped, thank you! I spent some time this evening trying to get nuclei to report a positive LDAP hit (everyone's favorite log4j CVE). I studied the dns_server.go code and adapted ldap_server.go's handleSearch method and had some success when using an injection similar to the following:
This of course populates the baseDN with the unique interactsh domain, and I was able to key off of that and construct an Interaction object. It's late and I'd like to clean it up a bit (in the morning), but would you welcome the addition? If it seems like a good idea I can adopt the same changes to the various string fields for the other handlers. |
any reason for the LDAP interaction to be returned on an |
@tmendo can you elaborate on what you mean? Are you saying the way LDAP interactions and client message delivery are handled is different than the other integrated services? |
Sort of. The main interaction is still DNS, and any LDAP interaction is recorded as Example of the output coming from the server:
My comment is more about turning the LDAP interaction into a first-level citizen, replacing the DNS one for this case (or in addition to). This because a proper LDAP interaction is much less FP prone, than a DNS one (people click URLs, anti spam things parse URLs to resolve them and check lists, etc). The other reason for the comment, is regarding being in clear. Hope that helps ps: the pull request is very good, and I only got to this point because I'm using it :) But still recent to interactsh to propose a PR :) |
@maikthulhu Thanks for implementing this. I'm going to finalize the PR and add the proposed changes. This makes the correlation possible. |
@tmendo There are a few protocols where it's not easy to fit a correlation-id payload and extract it reliably. The correlation id is used to look up the encryption key generated at registration time. This is not possible for some protocols that, as a consequence, are disabled by default (such as FTP, smb, responder, etc.). These cannot be encrypted, so they are stored into a global entry in-memory. Hence they are suitable only for self-hosted instances where the access is protected with an authentication token (enabled by default if these services are active). |
Parse SearchRequest and build Interaction object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from disabling the a) internal logger for ldapWithFullLogger
and b) debug mode as default, everything looks good to me 🎉
Internal logger enabled with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Example of ldap interaction:
interactsh-server: