Starting Point: Login failed for user 'ARCHETYPE\Guest'.

Hello everyone
I’can’t connect to sqlserver with mssqlserver.py , when i try with password M3g4c0rp123 and username ARCHETYPE\sql_svc i obtain : Login failed for user ‘ARCHETYPE\Guest’.

Pls Help me :smile:

Sounds like you must not be specifying the username correctly if it is trying to authenticate you as Guest. Can you post the full command you’re running?

Type your comment> @VbScrub said:

Sounds like you must not be specifying the username correctly if it is trying to authenticate you as Guest. Can you post the full command you’re running?

mssqlclient.py ARCHETYPE\sql_svc@10.10.10.27 -windows-auth

Looks like maybe there’s some issue with specifying the domain/machine name at the start from Linux: mssqlclient.py and Windows Authentication · Issue #613 · fortra/impacket · GitHub

Try just mssqlclient.py sql_svc@10.10.10.27 -windows-auth instead and see if that works for you

1 Like

Type your comment> @VbScrub said:

Looks like maybe there’s some issue with specifying the domain/machine name at the start from Linux: mssqlclient.py and Windows Authentication · Issue #613 · fortra/impacket · GitHub

Try just mssqlclient.py sql_svc@10.10.10.27 -windows-auth instead and see if that works for you

Thanks that works !!

Glad to hear that :slight_smile:

FYI all I did was google “impacket mssqlclient windows auth” or something like that, and that was the second result. You’ll have to get used to googling stuff like this if you want to get far on here :wink:

Type your comment> @VbScrub said:

Glad to hear that :slight_smile:

FYI all I did was google “impacket mssqlclient windows auth” or something like that, and that was the second result. You’ll have to get used to googling stuff like this if you want to get far on here :wink:

Okay I note !! :smiley:

Type your comment> @VbScrub said:

Looks like maybe there’s some issue with specifying the domain/machine name at the start from Linux: mssqlclient.py and Windows Authentication · Issue #613 · fortra/impacket · GitHub

Try just mssqlclient.py sql_svc@10.10.10.27 -windows-auth instead and see if that works for you

i tried this and the original command but im getting this once i login

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

Please help

solo tiene que cambiar \ por /
mssqlclient.py ARCHETYPE/sql_svc@10.10.10.27 -windows-auth

@squirrelcop said:

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

You’re probably not trying to do this anymore but I found a solution and wanted to share in case it helps anybody else:

According to mssqlclient : 'SSL routines', 'state_machine', 'internal error' · Issue #856 · fortra/impacket · GitHub it’s an impacket error on certain versions. You’ll have to modify impacket/tds.py

diff --git a/impacket/tds.py b/impacket/tds.py
index a24333d4…675ef822 100644
— a/impacket/tds.py
+++ b/impacket/tds.py
@@ -660,10 +660,11 @@ class MSSQL:
LOG.info(“Encryption required, switching to TLS”)

         # Switching to TLS now
  •        ctx = SSL.Context(SSL.TLSv1_METHOD)
    
  •        ctx = SSL.Context(SSL.TLSv1_2_METHOD)
           ctx.set_cipher_list('RC4, AES256')
           tls = SSL.Connection(ctx,None)
           tls.set_connect_state()
    
  •        while True:
               try:
                   tls.do_handshake()
    

@@ -908,7 +909,7 @@ class MSSQL:
LOG.info(“Encryption required, switching to TLS”)

         # Switching to TLS now
  •        ctx = SSL.Context(SSL.TLSv1_METHOD)
    
  •        ctx = SSL.Context(SSL.TLSv1_2_METHOD)
           ctx.set_cipher_list('RC4, AES256')
           tls = SSL.Connection(ctx,None)
    
1 Like

Type your comment> @VbScrub said: > Looks like maybe there’s some issue with specifying the domain/machine name at the start from Linux: mssqlclient.py and Windows Authentication · Issue #613 · fortra/impacket · GitHub > > Try just mssqlclient.py sql_svc@10.10.10.27 -windows-auth instead and see if that works for you thank you!