-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Fix #13798, Fix #14128, fix utf8 encoding issues on meterpreter #14888
Conversation
…tf-8 filenames
…code directory
Thanks for making this PR @timwr, this should hopefully help to fix some long standing UTF-8 related bugs that I was looking into but wasn't sure how to fix appropriately. Appreciate you taking the time to try fix this! 👍 |
Hmm so this is definitely better but I'm not sure its a complete solution:
So current errors appear to be that the |
Oops I didn't test this on Windows, so the reproduction steps were not suited to Windows.
You instead end up creating a file called If instead of
|
I've updated the description, sorry about that! |
Ah ok no worries so long as we are aware this isn't a complete fix and that further updates will be needed to make a complete solution for Windows, that was the main point I wanted to make clear here. This is a brilliant fix but I don't want people thinking its the golden bullet for all UTF8 issues 😄 Will retest again now! |
Works like a charm 😄
|
Confirmation #13798 is fixed:
|
Confirmation #14128 is fixed:
|
Looks good @timwr will land this now, thanks for all your work on this, much appreciated! |
Release NotesFixed two Unicode related bugs preventing recursive download of files or folders containing UTF8 characters, or otherwise open or interact with these files, via Meterpreter. This has now been addressed for common commands such as edit, download and cd. |
Thanks for testing and landing @gwillcox-r7 !! |
Hey @timwr quick update on this but tried running this command today for the demo meeting and ran into another error:
|
Urg I feel like this bug might be the gift that keeps on giving. I can put in a quick fix for that particular case but I wonder if there are others hiding too. |
All good, I pointed it out in the demo meeting just to make people aware that we still have other areas that need improvement. Well aware though that we have lots of different areas in the framework that need fixing (just try UTF-8 with the |
This change fixes #13798 and #14128 which are caused by unicode file/directory names.
It seems the directory listing returned from the meterpreter TLV here: https://github.com/rapid7/metasploit-framework/blob/master/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb#L65
is ASCII-8BIT.
This change ensure it's encoded as UTF-8 before passing it to the database, or to Rex::Table (for ls).
Verification
List the steps needed to make sure this thing works
msfconsole
Before the fix: