2005-05-22 19:39:21 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
module Console
|
|
|
|
|
|
|
|
module CommandDispatcher
|
|
|
|
|
|
|
|
def initialize(in_driver)
|
|
|
|
self.driver = in_driver
|
2005-07-12 05:39:44 +00:00
|
|
|
self.tab_complete_items = []
|
2005-05-22 19:39:21 +00:00
|
|
|
end
|
|
|
|
|
2005-05-22 20:28:21 +00:00
|
|
|
def print_error(msg = '')
|
2005-05-22 19:39:21 +00:00
|
|
|
driver.print_error(msg)
|
|
|
|
end
|
|
|
|
|
2005-05-22 20:28:21 +00:00
|
|
|
def print_status(msg = '')
|
2005-05-22 19:39:21 +00:00
|
|
|
driver.print_status(msg)
|
|
|
|
end
|
|
|
|
|
2005-05-22 20:28:21 +00:00
|
|
|
def print_line(msg = '')
|
2005-05-22 19:39:21 +00:00
|
|
|
driver.print_line(msg)
|
|
|
|
end
|
|
|
|
|
2005-05-22 20:28:21 +00:00
|
|
|
def print(msg = '')
|
2005-05-22 19:39:21 +00:00
|
|
|
driver.print(msg)
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_prompt(prompt)
|
|
|
|
driver.update_prompt(prompt)
|
|
|
|
end
|
|
|
|
|
|
|
|
def framework
|
|
|
|
return driver.framework
|
|
|
|
end
|
|
|
|
|
2005-07-14 06:34:58 +00:00
|
|
|
def active_module
|
|
|
|
driver.active_module
|
2005-05-22 19:39:21 +00:00
|
|
|
end
|
|
|
|
|
2005-07-14 06:34:58 +00:00
|
|
|
def active_module=(mod)
|
|
|
|
driver.active_module = mod
|
2005-05-22 19:39:21 +00:00
|
|
|
end
|
|
|
|
|
2005-07-14 07:32:11 +00:00
|
|
|
def log_error(err)
|
|
|
|
print_error(err)
|
|
|
|
|
|
|
|
wlog(err)
|
|
|
|
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_1)
|
|
|
|
end
|
|
|
|
|
2005-07-12 05:39:44 +00:00
|
|
|
#
|
|
|
|
# No tab completion items by default
|
|
|
|
#
|
|
|
|
attr_accessor :tab_complete_items
|
|
|
|
|
2005-05-22 19:39:21 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
attr_accessor :driver
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end end end
|
|
|
|
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/ui/console/module_command_dispatcher'
|
|
|
|
require 'msf/ui/console/command_dispatcher/core'
|