Skip to content

Commit f7195fb

Browse files
author
kernelsmith
committed
handle unknown commands more informatively
before it just returned nothing, now it prints the familiar "Unkown command: " message
1 parent 204b43b commit f7195fb

File tree

1 file changed

+6
-0
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,6 +2524,12 @@ def temp_output.write(msg = '')
25242524

25252525
# dump the command's output so we can grep it
25262526
cmd_output = temp_output.dump_buffer
2527+
2528+
# Bail if the command failed
2529+
if cmd_output =~ /Unknown command:/
2530+
print_error("Unknown command: #{args[0]}.")
2531+
return false
2532+
end
25272533
# put lines into an array so we can access them more easily and split('\n') doesn't work on the output obj.
25282534
all_lines = cmd_output.lines.select {|line| line}
25292535
# control matching based on remaining match_mods (:insensitive was already handled)

0 commit comments

Comments
 (0)