Starting Point foothold mssqlclient.py

@irealmar That doesn’t work either. Whether I run the straight command or with sudo

examples$ mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth
bash: mssqlclient.py: command not found

There’s too many people having the same issue, and it makes no sense when others are successfully passing this step… so what is the difference between the 2 people?

I’m using the updated Kali Linux 2020 (updated/upgraded a couple days ago when I started hackthebox challenges)

I’ve tried Python 2 and 3 - same errors. If I enter the command without the “python” prefix, I get an error that says “mssqlclient.py: command not found”

tried all commands with and without sudo, same errors regardless.

It’s pretty frustrating. I understand part of “hacking” is figuring things out - but I’m completely lost on this. I’m doing the exact same things everyone who has passed this step has done, yet I’m getting errors that wont allow me to proceed.

Type your comment> @quantumtheory said:

@irealmar That doesn’t work either. Whether I run the straight command or with sudo

examples$ mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth
bash: mssqlclient.py: command not found

Try “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

@quantumtheory said:

I restarted my system and I still get the same error(s)

python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

Password: M3g4c0rp123

[*] Encryption required, switching to TLS
[-] Missing required parameter ‘digestmod’.

you probably downloaded impacket, but didn’t install it. On kali 2020.1b there’s the ‘problem’ that pip isn’t installed, but pip3 is… so where it says in the github “pip install .”, do in stead “pip3 install .”… normally this should fix your problem.

Type your comment> @gnothiseauton said:

@quantumtheory said:

I restarted my system and I still get the same error(s)

python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

Password: M3g4c0rp123

[*] Encryption required, switching to TLS
[-] Missing required parameter ‘digestmod’.

you probably downloaded impacket, but didn’t install it. On kali 2020.1b there’s the ‘problem’ that pip isn’t installed, but pip3 is… so where it says in the github “pip install .”, do in stead “pip3 install .”… normally this should fix your problem.

I have run python scripts before, therefore I was confident everything was installed correctly. However, I did have to install python3-pip…

With that said, I now get this error:
kali@kali:~/Downloads/Impacket$ sudo pip3 install setup.py
[sudo] password for kali:
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py

So instead, I enter command “python3 setup.py install”

and it seems to have installed everything in /usr/local.bin… However it is still not working.

I enter the command “mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

I am then asked for the password. I type the password in, and nothing happens.
Just a solid cursor for a few minutes and then I get this:

Traceback (most recent call last):
File “/usr/local/bin/mssqlclient.py”, line 4, in
import(‘pkg_resources’).run_script(‘impacket==0.9.22.dev1’, ‘mssqlclient.py’)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 1462, in run_script
exec(code, namespace, namespace)
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.22.dev1-py3.8.egg/EGG-INFO/scripts/mssqlclient.py”, line 173, in
ms_sql.connect()
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.22.dev1-py3.8.egg/impacket/tds.py”, line 532, in connect
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

With that said, I now get this error:
kali@kali:~/Downloads/Impacket$ sudo pip3 install setup.py
[sudo] password for kali:
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py

So instead, I enter command “python3 setup.py install”

and it seems to have installed everything in /usr/local.bin… However it is still not working.

I enter the command “mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

I am then asked for the password. I type the password in, and nothing happens.
Just a solid cursor for a few minutes and then I get this:

I’ll leave you my installation notes of impacket on kali 2020.1b (if you already did parts of them, then just skip them):

** IMPACKET**
A collection of python classes for working with network protocols

INSTALL
• Needs: python pip
• “sudo apt install python3-venv python3-pip” - installs pip for python3
• go to ‘/opt’ folder
• (get git clone url from GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.)
• “sudo git clone GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.” - to clone
• “cd impacket” - to go into the directory
• “pip3 install .”

afterwards, go to the examples folder and rund the command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

Also: keep in mind, you just want to connect to an mssql server, and mssqlclient is just one of many ways, if this tool doesn’t work, challenge yourself to find another tool that doesn’t work. Always good to have alternate tools for the same job.

Either way, follow the exact descriptions I left you and you should be good to go. If it doesn’t work, let me know and I’ll see what I can do. Best of luck!

Type your comment> @gnothiseauton said:

With that said, I now get this error:
kali@kali:~/Downloads/Impacket$ sudo pip3 install setup.py
[sudo] password for kali:
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py

So instead, I enter command “python3 setup.py install”

and it seems to have installed everything in /usr/local.bin… However it is still not working.

I enter the command “mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

I am then asked for the password. I type the password in, and nothing happens.
Just a solid cursor for a few minutes and then I get this:

I’ll leave you my installation notes of impacket on kali 2020.1b (if you already did parts of them, then just skip them):

** IMPACKET**
A collection of python classes for working with network protocols
GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.

INSTALL
• Needs: python pip
• “sudo apt install python3-venv python3-pip” - installs pip for python3
• go to ‘/opt’ folder
• (get git clone url from GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.)
• “sudo git clone GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.” - to clone
• “cd impacket” - to go into the directory
• “pip3 install .”

afterwards, go to the examples folder and rund the command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

Also: keep in mind, you just want to connect to an mssql server, and mssqlclient is just one of many ways, if this tool doesn’t work, challenge yourself to find another tool that doesn’t work. Always good to have alternate tools for the same job.

Either way, follow the exact descriptions I left you and you should be good to go. If it doesn’t work, let me know and I’ll see what I can do. Best of luck!

Thank you for the detailed reply.

I did everything you said, everything downloaded/installed as intended. However, come to the last command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth” - I still get the timed out error :-\

Traceback (most recent call last):
File “mssqlclient.py”, line 173, in
ms_sql.connect()
File “/home/kali/.local/lib/python3.8/site-packages/impacket/tds.py”, line 532, in connect
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

Not familiar enough to determine why I would be timing out regarding those errors…

I can try to find a different tool, but at the same time would like to learn why this one doesn’t work for me

Thank you for the detailed reply.

I did everything you said, everything downloaded/installed as intended. However, come to the last command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth” - I still get the timed out error :-\

Traceback (most recent call last):
File “mssqlclient.py”, line 173, in
ms_sql.connect()
File “/home/kali/.local/lib/python3.8/site-packages/impacket/tds.py”, line 532, in connect
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

Not familiar enough to determine why I would be timing out regarding those errors…

I can try to find a different tool, but at the same time would like to learn why this one doesn’t work for me

It’s good to have the spirit to try to find why things don’t work.
If your install went well and you get a timeout, I’d try to ping the machine, so “ping 10.10.10.27”… it might be that your connection was lost, or that you didn’t start the VPN, or that it can’t connect or whatever.
Timeout is more likely to be a lower-layer problem than the software layer. Try to ping the machine, if you get a ping, try to nmap just the port you want to connect to, I believe it was port 445, no? (so “nmap -p445 10.10.10.27”). If either one fails, you have connection issues, not software issues.
If both work, you should be able to connect, can’t see why.

Try it and let me know. Best of luck.

I updated kali and redownloaded the .ovpn file - and now all seems to have worked…

A lot of people were getting stuck on this particular step - so thanks again for your detailed replies as it doesn’t only help me, but I know its going to help so many others.

Again - I greatly appreciate your time and efforts to clear this step up!

Thanks for taking the time to express your appreciation. Glad to hear you got it fixed! Go kick some ■■■ :slight_smile:

hey guys try this…

apt install python3
pip3 install impact

installation of impact examples: /usr/share/doc/python3-impacket/examples

cd /usr/share/doc/python3-impacket/examples

try to run
pyhon mssqlclient.py ARCHETYPE\sql_svc@10.10.10.27 -windows-auth
or python3 mssqlclient.py ARCHETYPE\sql_svc@10.10.10.27 -windows-auth

So much ■■■■ trouble with this impacket, This helped me install impacke thttps://youtu.be/ZjVncSKK1EY
Works like a dream now.

Type your comment> @ltambellini said:

hey guys try this…

apt install python3
pip3 install impact

installation of impact examples: /usr/share/doc/python3-impacket/examples

cd /usr/share/doc/python3-impacket/examples

try to run
pyhon mssqlclient.py ARCHETYPE\sql_svc@10.10.10.27 -windows-auth
or python3 mssqlclient.py ARCHETYPE\sql_svc@10.10.10.27 -windows-auth

After I got an error:
Password:
[*] Encryption required, switching to TLS
[-] Missing required parameter ‘digestmod’.

As I can see, Python version 3.8 is poorly compatible with Impacket, most likely the problem lies precisely in this and will have to look for alternatives or do a downgrade

I fixed this problem installing the setup.py of impacket.
I wrote “python3 setup.py install”

After that my problem of “Missing Digestmod” was resolved.

[*] Encryption required, switching to TLS
[-] [(‘SSL routines’, ‘state_machine’, ‘internal error’)]

Every time I try to use mssqlclient.py I receive this error

Type your comment> @5H4D0W13 said:

[*] Encryption required, switching to TLS
[-] [(‘SSL routines’, ‘state_machine’, ‘internal error’)]

Every time I try to use mssqlclient.py I receive this error

Yes same, i tried everyway in the forum, still can’t figure it out

Type your comment> @CrimsonHack said:

I fixed this problem installing the setup.py of impacket.
I wrote “python3 setup.py install”

After that my problem of “Missing Digestmod” was resolved.

Thank you, dude!

you need to upgrade impacket to solve this problem use the command
pip3 install impacket --upgrade --user

Type your comment> @quantumtheory said:

Type your comment> @gnothiseauton said:

With that said, I now get this error:
kali@kali:~/Downloads/Impacket$ sudo pip3 install setup.py
[sudo] password for kali:
ERROR: Could not find a version that satisfies the requirement setup.py (from versions: none)
ERROR: No matching distribution found for setup.py

So instead, I enter command “python3 setup.py install”

and it seems to have installed everything in /usr/local.bin… However it is still not working.

I enter the command “mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

I am then asked for the password. I type the password in, and nothing happens.
Just a solid cursor for a few minutes and then I get this:

I’ll leave you my installation notes of impacket on kali 2020.1b (if you already did parts of them, then just skip them):

** IMPACKET**
A collection of python classes for working with network protocols
GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.

INSTALL
• Needs: python pip
• “sudo apt install python3-venv python3-pip” - installs pip for python3
• go to ‘/opt’ folder
• (get git clone url from GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.)
• “sudo git clone GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.” - to clone
• “cd impacket” - to go into the directory
• “pip3 install .”

afterwards, go to the examples folder and rund the command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth”

Also: keep in mind, you just want to connect to an mssql server, and mssqlclient is just one of many ways, if this tool doesn’t work, challenge yourself to find another tool that doesn’t work. Always good to have alternate tools for the same job.

Either way, follow the exact descriptions I left you and you should be good to go. If it doesn’t work, let me know and I’ll see what I can do. Best of luck!

Thank you for the detailed reply.

I did everything you said, everything downloaded/installed as intended. However, come to the last command “python3 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth” - I still get the timed out error :-\

Traceback (most recent call last):
File “mssqlclient.py”, line 173, in
ms_sql.connect()
File “/home/kali/.local/lib/python3.8/site-packages/impacket/tds.py”, line 532, in connect
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

Not familiar enough to determine why I would be timing out regarding those errors…

I can try to find a different tool, but at the same time would like to learn why this one doesn’t work for me

Hey, did you get anywhere with solving this? I have the same problem.