2005-05-22 19:39:21 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
module Console
|
|
|
|
|
|
|
|
module CommandDispatcher
|
|
|
|
|
2005-07-18 05:13:21 +00:00
|
|
|
include Rex::Ui::Text::DispatcherShell::CommandDispatcher
|
2005-05-22 19:39:21 +00:00
|
|
|
|
2005-07-18 05:13:21 +00:00
|
|
|
def initialize(driver)
|
|
|
|
super
|
2005-05-22 19:39:21 +00:00
|
|
|
|
2005-07-18 05:13:21 +00:00
|
|
|
self.driver = driver
|
2005-05-22 19:39:21 +00:00
|
|
|
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)
|
2005-09-24 00:19:27 +00:00
|
|
|
|
|
|
|
# If it's a syntax error, log the call stack that it originated from.
|
2005-09-27 00:35:51 +00:00
|
|
|
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_1)
|
2005-07-14 07:32:11 +00:00
|
|
|
end
|
|
|
|
|
2005-05-22 19:39:21 +00:00
|
|
|
attr_accessor :driver
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2005-07-15 22:30:04 +00:00
|
|
|
module ModuleCommandDispatcher
|
|
|
|
|
|
|
|
include Msf::Ui::Console::CommandDispatcher
|
|
|
|
|
|
|
|
def mod
|
|
|
|
return driver.active_module
|
|
|
|
end
|
2005-05-22 19:39:21 +00:00
|
|
|
|
2005-10-10 00:30:14 +00:00
|
|
|
def mod=(m)
|
|
|
|
self.driver.active_module = m
|
|
|
|
end
|
|
|
|
|
2005-07-15 22:30:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end end end
|
|
|
|
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/ui/console/command_dispatcher/core'
|
2005-07-15 22:30:04 +00:00
|
|
|
|