HTB Starting Point - Impacket : unpack requires a buffer of 1 bytes

Hello…
I have the same error,

Raised a ticket with the service desk, will update when I hear back :slight_smile:

I am also having the same problem. First time I tried it and got [-] (‘unpack requires a buffer of 1 bytes’, “When unpacking field ‘Type | <B | b’‘[:1]’”) Then I tried command again and now I’m getting [-] [Errno 104] Connection reset by peer

just starting…same issue. Heres a trace

─$ impacket-mssqlclient -windows-auth “ARCHETYPE/sql_svc@10.10.10.27” -debug
Impacket v0.9.23.dev1+20201203.125520.aa0c78ad - Copyright 2020 SecureAuth Corporation

[+] Impacket Library Installation Path: /usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket
Password:
[+] Exception:
Traceback (most recent call last):
File “/usr/share/doc/python3-impacket/examples/mssqlclient.py”, line 179, in
res = ms_sql.login(options.db, username, password, domain, options.hashes, options.windows_auth)
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/tds.py”, line 905, in login
resp = self.preLogin()
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/tds.py”, line 520, in preLogin
tds = self.recvTDS()
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/tds.py”, line 606, in recvTDS
packet = TDSPacket(self.socketRecv(packetSize))
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/structure.py”, line 84, in init
self.fromString(data)
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/structure.py”, line 149, in fromString
self[field[0]] = self.unpack(field[1], data[:size], dataClassOrCode = dataClassOrCode, field = field[0])
File “/usr/local/lib/python3.8/dist-packages/impacket-0.9.23.dev1+20201203.125520.aa0c78ad-py3.8.egg/impacket/structure.py”, line 382, in unpack
return unpack(format, data)[0]
struct.error: (‘unpack requires a buffer of 1 bytes’, “When unpacking field ‘Type | <B | b’‘[:1]’”)
[-] (‘unpack requires a buffer of 1 bytes’, “When unpacking field ‘Type | <B | b’‘[:1]’”)

I am using Kali 2020.2 distro where I have gottent the latest impacket from github

impacket-mssqlclient -h 130 ⨯
Impacket v0.9.23.dev1+20201203.125520.aa0c78ad - Copyright 2020 SecureAuth Corporation

─$ python3 --version
Python 3.8.6

Suggestions ???

I have the same error too, i thought it was just me until i looked here. Seems we need to wait for a fix on the starting point machine?

I recently got into HTB and I am also stuck and running into this issue.

did anyone find a solution as its driving me crazy. im asuming not or someone would have commented

I have a ticket open and the service desk is working through it. In the meantime, I recommend the academy

THANKS for the reply please post result as ive just finished reinstalling kali removing reinstalling impacket python2 python3 added few versions of impacket all return the same
“[-] (‘unpack requires a buffer of 1 bytes’, “When unpacking field ‘Type | <B | b’‘[:1]’”)”
or
“[-] [Errno 104] Connection reset by peer”

Type your comment> @snowdroppe said:

I have a ticket open and the service desk is working through it. In the meantime, I recommend the academy

Let us know what they say :slight_smile:

Thank you, I thought I was going mad.

same issue here.
tried to follow some ideas I found in this forum, nothing worked.
updated all PIP packages, tried Python 3.7 - all the same.

are we all using the latest Kali VM?
I thought I’d try an older ubuntu docker just to rule it out…

Try modifying your command to include the password like so:
mssqlclient.py ARCHETYPE/sql_svc:M3g4c0rp123@10.10.10.27 -windows-auth

The problem was definitely server side and has now been resolved by service desk. You may still need to update Impacket if you get digest errors (tested and working with 0.9.22).

same issue here

Tried in both Kali and Parrot os also tried with Python2.7, Python3.8. Not working.

tested and working, indeed!

Fixed.

I am on impacket version 0.9.22.
I am still getting this error.

It is a problem with the server:
Connect to the server , reboot it then try again. eg:

# wmiexec.py administrator:MEGACORP_4dm1n\!\!@10.10.10.27
Impacket v0.9.21 - Copyright 2020 SecureAuth Corporation

[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>shutdown /r /t 0 /f

C:\>exit
# mssqlclient.py ARCHETYPE/sql_svc:M3g4c0rp123@10.10.10.27 -windows-auth
Impacket v0.9.21 - Copyright 2020 SecureAuth Corporation

[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(ARCHETYPE): Line 1: Changed database context to 'master'.
[*] INFO(ARCHETYPE): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server (140 3232)
[!] Press help for extra shell commands
SQL>

Check if your SAM and SYSTEM files are valid This link may help: unpack requires a buffer of 4 bytes · Issue #1052 · fortra/impacket · GitHub