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

mssqlclient: Add -target-ip #1648

Merged

Conversation

Palkovsky
Copy link
Contributor

mssqlclient doesn't have equivalent of -target-ip, which makes it impossible to perform Kerberos authetication without proper DNS configuration on the local machine.

As it is now, this is what happens (without the DNS configured):

  • using hostname as target: The tool won't be able to resolve the target IP, so it won't even open the connection.
  • using IP as target with -k: The tool will open the connection, but will not be able to find/request proper TGS with the service name as it only has the IP address.

@anadrianmanrique anadrianmanrique added the medium Medium priority item label Nov 23, 2023
@gabrielg5
Copy link
Collaborator

Hi @Palkovsky, thanks for your PR!

was checking the code and was thinking that perhaps we could take advantage of it and, being that we are adding a new parameter to the example, create a new group for this connection parameters.

Based on the smbclient implementation, in order to standardize them, we can define the connection group and put there this -target-ip parameter and move the -dc-ip one

group = parser.add_argument_group('connection')
group.add_argument('-dc-ip', action='store', metavar="ip address",
help='IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in '
'the target parameter')
group.add_argument('-target-ip', action='store', metavar="ip address",
help='IP Address of the target machine. If omitted it will use whatever was specified as target. '
'This is useful when target is the NetBIOS name and you cannot resolve it')
group.add_argument('-port', choices=['139', '445'], nargs='?', default='445', metavar="destination port",
help='Destination port to connect to SMB Server')

From the specific change you implemented, tested it and worked great!
thank you

@gabrielg5 gabrielg5 added the waiting for response Further information is needed from people who opened the issue or pull request label Jan 12, 2024
@Palkovsky
Copy link
Contributor Author

Hello, thanks for the response. I'll handle this over the weekend.

@Palkovsky
Copy link
Contributor Author

Palkovsky commented Jan 13, 2024

Done, please take a look.

@gabrielg5 gabrielg5 merged commit 82267d8 into fortra:master Jan 16, 2024
9 checks passed
@gabrielg5
Copy link
Collaborator

Awesome, thanks for changing it!

merging 🚀

XiaoliChan pushed a commit to XiaoliChan/impacket that referenced this pull request Mar 10, 2024
* mssqlclient: Enable Kerberos authentication without DNS lookup

* Group connection parameters under 'connection'
XiaoliChan pushed a commit to XiaoliChan/impacket that referenced this pull request Mar 10, 2024
* mssqlclient: Enable Kerberos authentication without DNS lookup

* Group connection parameters under 'connection'
mpgn pushed a commit to Pennyw0rth/impacket that referenced this pull request Mar 10, 2024
* mssqlclient: Enable Kerberos authentication without DNS lookup

* Group connection parameters under 'connection'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Medium priority item waiting for response Further information is needed from people who opened the issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants