rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
33.89k stars 13.93k forks source link

Keyboard Input Issues in `msfconsole` on PowerShell After Update to v6.4.16 Windows11 #19294

Closed lanzeweie closed 2 weeks ago

lanzeweie commented 3 months ago

Steps to reproduce

  1. Update to Metasploit version v6.4.16-dev-e691f7217092cc55a8955fdd847ffa77c6f09f25.
  2. Open PowerShell.
  3. Start msfconsole.
  4. Attempt to use the delete key and arrow keys.

Expected behavior

The delete key and arrow keys should work as expected for navigating and editing commands in msfconsole.

Current behavior

The delete key and arrow keys do not function correctly in msfconsole when using PowerShell.

Metasploit version

Framework Version: v6.4.16-dev-e691f7217092cc55a8955fdd847ffa77c6f09f25

System Information

Attempted solutions

  1. Ensured Metasploit is up-to-date (ran msfupdate).
  2. Tried different terminals (e.g., cmd, Windows Terminal, Git Bash).
  3. Adjusted PowerShell settings:
    • Changed console buffer size and window size.
    • Disabled Quick Edit Mode.
  4. Modified Readline configuration file:
    
    "\e[3~": delete-char
    "\e[1~": beginning-of-line
    "\e[4~": end-of-line
    "\e[5~": beginning-of-history
    "\e[6~": end-of-history
adfoster-r7 commented 3 months ago

It looks like the delete keys work to modify the buffer behind the scenes; but it isn't visually removed 🤔

The rb-readline library hasn't been changed in 7 years https://github.com/rapid7/metasploit-framework/blame/master/Gemfile.lock#L393 - would have to perform a bisect to investigate when this has gone wrong

Edit: Looks like there's been changes to the legacy console support in windows, we should be able to update RbReadline to Reline to resolve this issue

lanzeweie commented 1 week ago

Thank you for your service