Closed nikaiw closed 6 months ago
Do you know the remote host? Is it a windows or Linux machine?
Hmm weird, 385875968
is 0x17000000
, but that code doesn't exist in MS-ERREF
. Nothing starting with 0x17 exists either, and the only other reference to that error is old from https://github.com/fortra/impacket/issues/658
Sorry, I wanted to add this info. Remote target is a windows. However it seems that it is indeed an impacket issue related to an error code not being handled
reproduced directly with impacket
File "/home/user/.local/lib/python3.10/site-packages/impacket/smb.py", line 581, in __str__
return 'SMB SessionError: %s(%s)' % nt_errors.ERROR_MESSAGES[self.error_code]
KeyError: 385875968
A wireshark capture show the server return an error message "Error code: Out of memory" which was probably rarely encountered thus not handled by impacket.
It is handled in SMBv1:
But seems not handled in SMBv3:
Adding 0x17000000: ("STATUS_MEMORY","Out of memory"),
to the impacket file impacket/nt_errors.py fix that.
INFO Error creating SMBv1 connection to particularhost: SMB SessionError: class: ERRDOS, code: ERRnomem(Insufficient server memory to perform the requested function.)
INFO Error creating SMBv3 connection to particularhost: SMB SessionError: STATUS_MEMORY(Out of memory)
You can open a PR on impacket side ?
can you make sure you are using latest version of impacket @nikaiw ?
poetry update
poetry run netexec ...
hello, I apologize.. using the latest impacket version they indeed handle unkown error message:
[10:55:04] INFO Socket info: host=redacted, hostname=redacted, kerberos=False, ipv6=False, link-local ipv6=False
INFO Error creating SMBv1 connection to redacted: SMB SessionError: class: ERRDOS, code: ERRnomem(Insufficient server memory to perform the requested function.)
INFO Error creating SMBv3 connection to redacted: SMB SessionError: unknown error code: 0x17000000
INFO Failed to create connection object for target redacted, exiting...
Exception happens for a particular host during the exception handling.
Steps to reproduce the behavior i.e.: Command:
netexec smb particularhost
Resulted in:Calltrace
Exception during the handling of the exception