mssqlclient.py [-] [('SSL routines', '', 'internal error')]
Task Info (Flyspray) | |
---|---|
Opened By | Antonio Voza (D3vil0p3r) |
Task ID | 76969 |
Type | Bug Report |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2022-12-30 22:09:46 UTC |
Status | Assigned |
Assignee | Levente Polyak (anthraxx) |
Details
When mssqlclient.py
tool from impacket is used, the following error is returned:
Impacket v0.9.24 - Copyright 2021 SecureAuth Corporation
[*] Encryption required, switching to TLS
[-] [('SSL routines', '', 'internal error')]
This issue was related to a wrong configuration in /usr/lib/python3.10/site-packages/impacket/tds.py
that has been solved in the most recent versions of Impacket. The issue has been shown here: https://github.com/fortra/impacket/issues/856#issuecomment-729880208
The Impacket version in BlackArch has this bug and does not allow to use mssqlclient.py tool. By upgrading Impacket to the latest version will solve the issue.
Steps to reproduce
- Build a machine with MS SQL server
- From the client, run mssqlclient.py reporting:'password'@10.10.10.125 -windows-auth
Actual result: Describe here what happens after you run the steps above (i.e. the buggy behaviour)
Impacket v0.9.24 - Copyright 2021 SecureAuth Corporation
[*] Encryption required, switching to TLS
[-] [('SSL routines', '', 'internal error')]
Expected result: Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour)
Impacket v0.10.1.dev1+20221214.172823.8799a1a2 - Copyright 2022 Fortra
[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: volume
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(QUERIER): Line 1: Changed database context to 'volume'.
[*] INFO(QUERIER): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server (140 3232)
[!] Press help for extra shell commands
SQL>
While getting impacket from git, remember to run all of the following commands:
git clone https://github.com/fortra/impacket
python3 -m pip install impacket
python3 -m pip install .
The last one command is important to run for setting tds.py
file in the correct manner.