Skip to content

Commit 900ccc7

Browse files
author
Tod Beardsley
committed
VISUAL is okay. Also doesn't need to be a path.
I don't believe this opens an untoward attack vector -- if your attacker can run Metasploit locally, you have much bigger problems.
1 parent 72a0529 commit 900ccc7

File tree

1 file changed

+3
-7
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+3
-7
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def commands
107107
"connect" => "Communicate with a host",
108108
"color" => "Toggle color",
109109
"exit" => "Exit the console",
110-
"edit" => "Edit the current module with $EDITOR",
110+
"edit" => "Edit the current module with $VISUAL or $EDITOR",
111111
"go_pro" => "Launch Metasploit web GUI",
112112
"grep" => "Grep the output of another command",
113113
"help" => "Help menu",
@@ -634,7 +634,7 @@ def local_editor
634634

635635
def cmd_edit_help
636636
msg = "Edit the currently active module"
637-
msg = "#{msg} #{local_editor ? "with #{local_editor}" : "($EDITOR must be set first)"}."
637+
msg = "#{msg} #{local_editor ? "with #{local_editor}" : "($VISUAL or $EDITOR must be set first)"}."
638638
print_line "Usage: edit"
639639
print_line
640640
print_line msg
@@ -647,11 +647,7 @@ def cmd_edit_help
647647
#
648648
def cmd_edit
649649
unless local_editor
650-
print_error "$EDITOR must be set first. Try 'export EDITOR=/usr/bin/vim'"
651-
return
652-
end
653-
unless ::File.executable_real? local_editor
654-
print_error "#{local_editor} doesn't seem to be executable by you."
650+
print_error "$VISUAL or $EDITOR must be set first. Try 'export EDITOR=/usr/bin/vim'"
655651
return
656652
end
657653
if active_module

0 commit comments

Comments
 (0)