Skip to content

Fix encoding errors#32

Merged
NeffIsBack merged 5 commits into
mainfrom
neff-fix-file-decoding
Sep 22, 2023
Merged

Fix encoding errors#32
NeffIsBack merged 5 commits into
mainfrom
neff-fix-file-decoding

Conversation

@NeffIsBack

@NeffIsBack NeffIsBack commented Sep 20, 2023

Copy link
Copy Markdown
Member

Better error handling when reading a file with some non utf-8 characters.

Now you can add --ignore-decoding-errors to just skip non utf-8 characters in your password file.

image

Issues:
byt3bl33d3r/CrackMapExec#806
byt3bl33d3r/CrackMapExec#808
byt3bl33d3r/CrackMapExec#356

Fixing coding error when password uses

Issue: byt3bl33d3r/CrackMapExec#786

@Marshall-Hallenbeck

Copy link
Copy Markdown
Collaborator

It's interesting that rockyou isn't utf-8...

The question comes down to "should we check the file encoding and fail out if its not utf-8, or silently remove non-utf-8 chars?"

@NeffIsBack NeffIsBack added the bug-fix This Pull Request fixes a bug label Sep 20, 2023
@NeffIsBack NeffIsBack marked this pull request as ready for review September 20, 2023 14:14
@XiaoliChan

Copy link
Copy Markdown
Contributor

Think we can ignore the decode error by default, don't need a new argument, just tell the users in self.logger.error(f"{password} decode error")

@NeffIsBack

NeffIsBack commented Sep 20, 2023

Copy link
Copy Markdown
Member Author

Think we can ignore the decode error by default, don't need a new argument, just tell the users in self.logger.error(f"{password} decode error")

That would be possible, but imo telling the user in advance would be better. Otherwise it is easy to miss, especially if you take something like rockyou (where you anyway have to wait >30h). I think that would have more or less the same effect as ignoring bad characters

@XiaoliChan

XiaoliChan commented Sep 20, 2023

Copy link
Copy Markdown
Contributor

That would be possible, but imo telling the user in advance would be better. Otherwise it is easy to miss, especially if you take something like rockyou (where you anyway have to wait >30h). I think that would have more or less the same effect as ignoring bad characters

Yeah yeah, if loading a huge passwords list and users wait for a long time then it break with decode error, that mind be annoy XD

@XiaoliChan

Copy link
Copy Markdown
Contributor

I don't know which codec windows(maybe I should said the six lib in impacket ) will accept it except utf-8

Maybe --password-codec args is better?

@NeffIsBack

Copy link
Copy Markdown
Member Author

I don't know which codec windows(maybe I should said the six lib in impacket ) will accept it except utf-8

Maybe --password-codec args is better?

Hmm i dont think the error occures because user want to use another codec. I think this is more likely happening when user are not aware that their files contain non utf-8 characters like here. But the six lib is a valid point, not sure if it would even work if we use other codecs.

@NeffIsBack NeffIsBack changed the title Fix decode errors on password file decoding Fix coding errors Sep 20, 2023
@Marshall-Hallenbeck Marshall-Hallenbeck changed the title Fix coding errors Fix encoding errors Sep 20, 2023

@Marshall-Hallenbeck Marshall-Hallenbeck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@NeffIsBack NeffIsBack merged commit 87a2efa into main Sep 22, 2023
@NeffIsBack NeffIsBack deleted the neff-fix-file-decoding branch September 22, 2023 12:33
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.

3 participants