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

wip: Fix Reline ASCII-8BIT <-> UTF-8 issues #19524

Closed

Conversation

sjanusz-r7
Copy link
Contributor

@sjanusz-r7 sjanusz-r7 commented Oct 1, 2024

This PR is trying to fix some of the Reline issues I have introduced as part of: #19397

This PR changes the main msfconsole prompt to provide input and output as UTF-8-encoded strings by providing UTF-8 wrappers around some of our commonly used IO classes.

It seems like these changes could have a wide impact than I initially anticipated as it begins to introduce ASCII-8BIT <-> UTF-8 encoding issues both ways. I will keep testing and addressing any edge cases I come across.

Affected issues:

I am currently fixing the tests. Tests should now pass.

Verification

  • Create an example file on disk with non-English characters, e.g. touch メタスプロイトが大好きです
  • Write some output to the file, e.g. echo 'hello world!' > メタスプロイトが大好きです
  • Start msfconsole
  • Verify you can call off to the local filesystem with autocompletion: cat メタスプ<TAB> This did not work previously with Readline as we do not have a Filesystem dispatcher in the stack which implements def_cat_tabs when trying to auto-complete local filenames.
  • Get a meterpreter shell vs e.g. Windows
  • Create the non-English file on the Windows box
  • Enter the Meterpreter shell
  • Verify you can auto-complete the filename: cat メタスプ<TAB> which should result in cat メタスプロイトが大好きです
  • Verify pressing Enter results in the file contents being read and output.

@sjanusz-r7 sjanusz-r7 force-pushed the fix-reline-ascii-utf8-encoding branch from 0693040 to 32cfbee Compare October 1, 2024 15:47
@sjanusz-r7 sjanusz-r7 closed this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant