Starting Point foothold mssqlclient.py

Hello everyone,
I'm new at HTB and i have a problem with mssqlclient.py
When i'm running the command :
"sudo python3 mssqlclient.py ARCHETYPE\[email protected] -windows-auth"

the command return this :

Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

Password:
[*] Encryption required, switching to TLS
[-] Missing required parameter 'digestmod'.

i've tried to use the mssqlclient with python 3.7 and 2.7 but no one works

This is so sad i'm stuck in the tutorial :joy:

Thank you in advance for your answer.

«1

Comments

  • Try the same command but include the password in the login string
    ARCHETYPE/sql_svc:'thepassword'@host

  • edited April 14

    The following command worked for me a couple of weeks ago when I did it:

    python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth
    

    I am running the same version of impacket - v0.9.20, git commit number ending in a6620 (27th of March) and a Kali VM image that I downloaded last month from the Offensive Security website.

    tasidonya

  • I am also running into this issue, I have located the password but mssqlclient wont accept the password.

    [email protected]:~/impacket/examples$ mssqlclient.py ARCHETYPE\[email protected] -windows-auth
    Impacket v0.9.22.dev1+20200327.103853.7e505892 - Copyright 2020 SecureAuth Corporation

    Password:
    [*] Encryption required, switching to TLS
    [-] ERROR(ARCHETYPE): Line 1: Login failed for user 'ARCHETYPE\Guest'.

  • Hi @FaleFrost ,
    probably your problem is the '\'', note @tasdonya 's command and compare it with yours

  • I'm having the problems with this step as well..

    I enter the command as seen here: python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth

    Then it asks me for the password.

    The password in the dtsConfig file shows "password=M3g4c0rp123"

    However, when I type that in, I get the following error:

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

    No idea what that means or how to work around it...

  • Can anyone help me out with this ^^^^??

  • I think in your first command the "/" was backwards (Ie;"\").
    It should be: python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth .
    For quantuntheory, the password should not have the word "password=" in it. Just the password itself.

  • edited April 17

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

    python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth
    Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

    Password: M3g4c0rp123

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

  • edited April 18

    @quantumtheory python3 mssqlclient.py was not working for my I can't remember why, but I downloaded the tool from impacket's github mentioned in the walk-through and run it /impacket/examples$ mssqlclient.py...

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

    examples$ mssqlclient.py ARCHETYPE/[email protected] -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/[email protected] -windows-auth
    bash: mssqlclient.py: command not found

    Try "python3 mssqlclient.py ARCHETYPE/[email protected] -windows-auth"

  • @quantumtheory said:

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

    python3 mssqlclient.py ARCHETYPE/[email protected] -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.

  • edited April 21

    Type your comment> @gnothiseauton said:

    @quantumtheory said:

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

    python3 mssqlclient.py ARCHETYPE/[email protected] -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:
    [email protected]:~/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/[email protected] -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

  • edited April 21

    With that said, I now get this error:
    [email protected]:~/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/[email protected] -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
    https://github.com/SecureAuthCorp/impacket

    INSTALL
    • Needs: python pip
    • "sudo apt install python3-venv python3-pip" - installs pip for python3
    • go to '/opt' folder
    • (get git clone url from https://github.com/SecureAuthCorp/impacket)
    • "sudo git clone https://github.com/SecureAuthCorp/impacket.git" - 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/[email protected] -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:
    [email protected]:~/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/[email protected] -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
    https://github.com/SecureAuthCorp/impacket

    INSTALL
    • Needs: python pip
    • "sudo apt install python3-venv python3-pip" - installs pip for python3
    • go to '/opt' folder
    • (get git clone url from https://github.com/SecureAuthCorp/impacket)
    • "sudo git clone https://github.com/SecureAuthCorp/impacket.git" - 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/[email protected] -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/[email protected] -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/[email protected] -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 ass :)

  • 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\[email protected] -windows-auth
    or python3 mssqlclient.py ARCHETYPE\[email protected] -windows-auth

  • So much damn trouble with this impacket, This helped me install impacke t
    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\[email protected] -windows-auth
    or python3 mssqlclient.py ARCHETYPE\[email protected] -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:
    [email protected]:~/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/[email protected] -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
    https://github.com/SecureAuthCorp/impacket

    INSTALL
    • Needs: python pip
    • "sudo apt install python3-venv python3-pip" - installs pip for python3
    • go to '/opt' folder
    • (get git clone url from https://github.com/SecureAuthCorp/impacket)
    • "sudo git clone https://github.com/SecureAuthCorp/impacket.git" - 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/[email protected] -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/[email protected] -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:
    [email protected]:~/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/[email protected] -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
    https://github.com/SecureAuthCorp/impacket

    INSTALL
    • Needs: python pip
    • "sudo apt install python3-venv python3-pip" - installs pip for python3
    • go to '/opt' folder
    • (get git clone url from https://github.com/SecureAuthCorp/impacket)
    • "sudo git clone https://github.com/SecureAuthCorp/impacket.git" - 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/[email protected] -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/[email protected] -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

Sign In to comment.