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

Encode-decode subfolder for smb spider to avoid encode error in case non latin-1 symbols #436

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

a-urth
Copy link

@a-urth a-urth commented Oct 5, 2024

In case there is a folder with non latin-1 symbols (cyrillic lets say) smb spider will fail with following error

[17:00:56] ERROR    Exception while calling proto_flow() on target <ip-address>: 'latin-1' codec can't encode character '\u03b1' in position 60: ordinal not in range(256)                                          connection.py:174

Error itself comes from impacket which is used for smb connection during list directory step. Although its much easier (and faster) to fix it here.

In case characters are latin-1 then no change to string will be done.

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me a setup i can test it with?
I tried to add the character you provided to the folder/filenames, but that didn't trigger the error.
At the moment the share content just disappears with the changes:
image

@NeffIsBack NeffIsBack added the bug-fix This Pull Request fixes a bug label Oct 5, 2024
@a-urth
Copy link
Author

a-urth commented Oct 7, 2024

Interesting...
for me it happened with --spider C\$ --spider-folder Users and under Users there was Администратор folder, which caused the issue

@NeffIsBack
Copy link
Contributor

I might have found a solution:
image

@NeffIsBack
Copy link
Contributor

@a-urth can you recheck if the error persists with #446 (or if this fixes it)?

@a-urth
Copy link
Author

a-urth commented Oct 12, 2024

Ah I see, then you was already on this issue, nice! let me try it asap and i'll get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This Pull Request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants