Starting Point foothold mssqlclient.py

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.

Type your comment> @MarkDennett said:

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.

I did… it was quite simple if I’m remembering correctly. I closed any connections I had open, deleted my ovpn file, refreshed htb and downloaded a new ovpn file and re-connected to the vpn… after that it was working. So in short, I had lost connection lol

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.

yeah this worked for me.

i am also having same issue . how to move forward from this ?
“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.”

See : python error message - Off-topic - Hack The Box :: Forums ( you have to update inpacket)

python2 mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth
Impacket v0.9.15 - Copyright 2002-2016 Core Security Technologies

Password:
[*] Encryption required, switching to TLS
[-] [(‘SSL routines’, ‘SSL_CTX_set_cipher_list’, ‘no cipher match’)]

eroor find how to solve this

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.

Yes, this worked for me.