-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Added MSSQL Relay Server to NTLMRelayx #2083
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
base: master
Are you sure you want to change the base?
feat: Added MSSQL Relay Server to NTLMRelayx #2083
Conversation
|
Hey @epotseluevskaya hello, thanks for submitting this new feature! There are couple issues that caught my attention right away:
I'll be reviewing this PR so will be sharing more detailed comments going forward |
… hex message. Several not needed imports were removed. The server name in the LOGIN request was changed to match the target.
…SSQLRelayServer added
|
Thank you for your feedback, @gabrielg5! Yes, it seems that my ntlmrelayx.py version was outdated. I made the changes that you requested. |
gabrielg5
left a comment
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.
Been running some tests on the PR and reviewing code... a couple comments below
I'm still checking it as the client remains waiting for a response when talking to the relay. I guess it'd be better reply something to clients
A bit more on this later today
Let me know your insights on proposed changes/comments
Thank you!!
gabrielg5
left a comment
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.
Using constants to identify different packets
…ailure for unknown reasons)
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
|
Thank you @gabrielg5! I applied all the changes and added a response to the client with an imitation of a failed login ( |
gabrielg5
left a comment
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.
Awesome! Last detail before merging PR
Thank you!!
| LOG.debug("(MSSQL): Parsing the client's login request") | ||
| loginData = tds.TDS_LOGIN() | ||
| loginData.fromString(packet[8:]) | ||
| LOG.info("(MSSQL): Client login request:") |
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.
| LOG.info("(MSSQL): Client login request:") | |
| LOG.debug("(MSSQL): Client login request:") |
| LOG.info("(MSSQL): Password : %s" % password.decode("utf-8")) | ||
| LOG.info("(MSSQL): Password is not empty. Relay is not required.") | ||
| if not loginData["SSPI"]: | ||
| LOG.error("(MSSQL): NTLMSSP_NEGOTIATE not found in login message") |
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.
We should return the same "dummy error message" to the client here, right? so to avoid blocking their connect command
Can extract response to an external function and call it from here
(This state is triggered if connecting with SQL auth)
This PR is to add a MSSQL Relay server to NTLMRelayx. It is mostly based on the RAW Relay server.