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

Add history support to nasm and metasm shells #18425

Conversation

adfoster-r7
Copy link
Contributor

@adfoster-r7 adfoster-r7 commented Oct 4, 2023

Closes #18423

Adds history support to the nasm and metasm shells, which can be found in the tools/exploit/nasm_shell.rb directory if installed with the nightly installers - or msf-metasm_shell with Kali. Now when re-opening these shells, previously typed commands should be remembered and available.

Verification

Before

Crashes (a regression) - but even prior to this commit there was no history functionality

After

All history is remembered; Fresh console:

bundle exec ruby tools/exploit/metasm_shell.rb                
xor al, 12type "exit" or "quit" to quit
use ";" or "\n" for newline
type "file <file>" to parse a GAS assembler source file

metasm > xor al, 12
"\x34\x0c"
metasm > exit

After re-opening the console, the up/down arrows should navigation history - and ctrl+r reverse search should work:

 bundle exec ruby tools/exploit/metasm_shell.rb
type "exit" or "quit" to quit
use ";" or "\n" for newline
type "file <file>" to parse a GAS assembler source file

(reverse-i-search)`xo': xor al, 12

The tools/exploit/nasm_shell.rb should also work

@adfoster-r7 adfoster-r7 force-pushed the add-history-support-to-nasm-and-metasm-shells branch from d959cae to 1f60093 Compare October 4, 2023 21:36
@cgranleese-r7
Copy link
Contributor

Everything worked as expected 👍

image

@cgranleese-r7 cgranleese-r7 self-assigned this Oct 5, 2023
@cgranleese-r7 cgranleese-r7 added enhancement rn-enhancement release notes enhancement rn-fix release notes fix and removed enhancement rn-enhancement release notes enhancement labels Oct 5, 2023
@cgranleese-r7 cgranleese-r7 merged commit dff907b into rapid7:master Oct 5, 2023
35 checks passed
@cgranleese-r7
Copy link
Contributor

Release Notes

Adds history support to the nasm and metasm shells. Now when re-opening these shells, previously typed commands should be remembered and available.

@adfoster-r7 adfoster-r7 added rn-enhancement release notes enhancement and removed rn-fix release notes fix labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metasm_shell error undefined method history_manager
2 participants