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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntlmrelayx.py: Log initial authentication in multi-target mode #1602

Merged

Conversation

rtpt-erikgeiser
Copy link
Contributor

In multi-target mode, the initial authentication is not immediately relayed. Instead, ntlmrelayx.py relies on subsequent authentications after a rejected tree connect. However, some clients do not behave this way, e.g. because they only test if a login is possible. In this case, nothing is ever logged, not even in debug mode.

This PR adds a log line that is printed in multi-target mode as soon as the initial non-relayed authentication happens. This way, users have a way of knowing that an authentication was performed.

@anadrianmanrique anadrianmanrique added in review This issue or pull request is being analyzed medium Medium priority item and removed in review This issue or pull request is being analyzed labels Sep 14, 2023
Copy link
Collaborator

@gabrielg5 gabrielg5 left a comment

Choose a reason for hiding this comment

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

Hi @rtpt-erikgeiser,

out of curiosity, which client were you using that is not triggering the reauthentication?

impacket/examples/ntlmrelayx/servers/smbrelayserver.py Outdated Show resolved Hide resolved
impacket/examples/ntlmrelayx/servers/smbrelayserver.py Outdated Show resolved Hide resolved
rtpt-erikgeiser and others added 2 commits September 28, 2023 09:44
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
@rtpt-erikgeiser
Copy link
Contributor Author

Hi @gabrielg5, thanks for your detailed review and great suggestions.

I'm afraid I cannot disclose the name of the client due to NDAs. However, it is a popular endpoint software management suite that regularly generates high-privileged SMB connections and as far as I recall they are immediately closed after the authentication handshake. Since ntlmrelayx.py in multi-target mode does not print out anything even in debug mode, we could only leverage these connections because we saw them in Wireshark and are familiar with Impacket's source code.

I hate to ask, but could you maybe also take a quick look at #1311 and #1310. Both are tiny no-brainer bug fixes but the PRs are over a year old as they were submitted during a time of low activity in this repo. I don't want to take your attention for granted but I don't know how I can get them merged otherwise.

@gabrielg5 gabrielg5 merged commit 06217f0 into fortra:master Sep 28, 2023
9 checks passed
@gabrielg5
Copy link
Collaborator

merged thanks!

will be taking a look at those PRs you mentioned.
thank you!

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

Successfully merging this pull request may close these issues.

3 participants