Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in smb.py #1419

Closed
shaaati opened this issue Oct 6, 2022 · 0 comments
Closed

TypeError in smb.py #1419

shaaati opened this issue Oct 6, 2022 · 0 comments
Assignees

Comments

@shaaati
Copy link

shaaati commented Oct 6, 2022

During a recent pentest I ran into an issue with the following code line:

https://github.com/SecureAuthCorp/impacket/blob/3c6713e309cae871d685fa443d3e21b7026a2155/impacket/smb.py#L3497

A crackmapexec run across a network segment crashed with the error message "TypeError: argument should be integer or bytes-like object, not 'str'".
It seems that get_server_lanman returns a bytes object. I worked around this crash by modifying the two arguments to the find function to bytes objects as well (b'Windows 2000'' and b'Samba').
Due to lack of code knowledge, I do not know if this is the correct fix and therefore did not directly propose a pull request.

Edit: The issue seems to be more complex. The same code line now crashed on another network segment with the error "TypeError: must be str, not bytes". Apparently, get_server_lanman can return both bytes and str.

@alexisbalbachan alexisbalbachan self-assigned this Sep 21, 2023
alexisbalbachan added a commit to alexisbalbachan/impacket that referenced this issue Oct 12, 2023
abbra pushed a commit to abbra/impacket that referenced this issue Nov 27, 2023
* Fixed unicode shares not being found

* Fixed unicode SPNs not being decoded appropriately

* Fixed spn not being found in getST, fixes fortra#1595

* Fixed unicode issues on login when using ntlmV1 fallback
Fixes fortra#1419
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants