Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote::JndiInjection: handle LDAP UnbindRequest #18069

Merged
merged 2 commits into from Jun 12, 2023

Conversation

sempervictus
Copy link
Contributor

@ErikWynter showed me this output during his effort to pwn APC servers:
image

The unexpected request 2 bit is misleading - thats the LDAP component not handling the session termination in the catch-all. This takes developers down the wrong debug path, and is easy to remedy.
Resolve by explicitly adding a case for the UnbindRequest type.

Ping @smcintyre-r7 - requesting eyes-on in case i broke something (its kinda late). 馃槃

@smcintyre-r7 smcintyre-r7 self-assigned this Jun 8, 2023
Copy link
Contributor

@smcintyre-r7 smcintyre-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind also updating

to include these changes so they stay in sync?

@sempervictus
Copy link
Contributor Author

Would you mind also updating


to include these changes so they stay in sync?

set

Copy link
Contributor

@smcintyre-r7 smcintyre-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. I tested this by using the exploit/multi/http/log4shell_header_injection module and setting WfsDelay to 300. While the module was waiting for a shell, I was able to use a client to perform bind and unbind requests to ensure things were functioning properly.

msf6 exploit(multi/http/log4shell_header_injection) > run

[+] mkfifo /tmp/lasod; (nc -l -p 4444 ||nc -l 4444)0</tmp/lasod | /bin/sh >/tmp/lasod 2>&1; rm /tmp/lasod
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Using auxiliary/scanner/http/log4shell_scanner as check
[*] Scanned 1 of 1 hosts (100% complete)
[*] Sleeping 300 seconds for any last LDAP connections
[*] Client sent unbind request

@smcintyre-r7 smcintyre-r7 merged commit 834ad18 into rapid7:master Jun 12, 2023
30 checks passed
@smcintyre-r7
Copy link
Contributor

Release Notes

This updates the LDAP server library to handle unbind requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants