update for support auxiliary module with MsfAssistant

git-svn-id: file:///home/svn/framework3/trunk@4971 4d416f70-5f16-0410-b530-b9f4589650da
unstable
fab 2007-05-28 13:20:19 +00:00
parent 8f8f5d799c
commit df9e206633
2 changed files with 43 additions and 12 deletions

View File

@ -47,11 +47,14 @@ module Msf
super(@active_module.refname) super(@active_module.refname)
# Initialize exploit driver's exploit instance # Initialize exploit driver's exploit instance
@mydriver = Msf::ExploitDriver.new(framework) #@mydriver = Msf::ExploitDriver.new(framework)
#@mydriver.exploit = framework.auxiliary.create(@active_module.refname)
@mydriver = $gtk2driver
@mydriver.exploit = framework.auxiliary.create(@active_module.refname) @mydriver.exploit = framework.auxiliary.create(@active_module.refname)
@mydriver.active_module = @active_module
# Populate the datastore if possible # Populate the datastore if possible
@mydriver.exploit.load_config #@mydriver.exploit.load_config
# Main interface # Main interface
@ -268,12 +271,10 @@ module Msf
end end
if (errors.empty? == false) if (errors.empty? == false)
#button_forward.set_sensitive(false)
MsfDialog::Error.new(self, "Failed to validate : #{errors.join(', ')}") MsfDialog::Error.new(self, "Failed to validate : #{errors.join(', ')}")
false false
else else
true true
#button_forward.set_sensitive(true)
end end
end end
@ -305,7 +306,37 @@ module Msf
# Import options from the supplied assistant # Import options from the supplied assistant
@mydriver.exploit.datastore.import_options_from_hash(@hash) @mydriver.exploit.datastore.import_options_from_hash(@hash)
MsfDialog::Warning.new(self, "Auxiliary", "MsfAssistant for auxiliary modules is currently under development") opt_str = nil
action = @mydriver.exploit.datastore['ACTION']
jobify = false
@pipe = Msf::Ui::Gtk2::GtkConsolePipe.new
@pipe.create_subscriber_proc() do |msg|
$stderr.puts "MSG: #{msg}"
$gtk2driver.append_log_view(msg)
end
@pipe.print_status("Launching auxiliary #{@mydriver.exploit.refname}...")
# Always run passive modules in the background
if (@mydriver.exploit.passive? or @mydriver.exploit.passive_action?(action))
jobify = true
end
begin
@mydriver.exploit.run_simple(
'Action' => action,
'Options' => @hash,
'LocalInput' => @pipe,
'LocalOutput' => @pipe,
'RunAsJob' => jobify
)
rescue ::Exception => e
p "Auxiliary failed: #{e.to_s}"
return false
end
end end
end end

View File

@ -157,7 +157,7 @@ module Msf
# #
# The active module associated with the driver. # The active module associated with the driver.
# #
attr_accessor :active_module attr_accessor :active_module, :exploit
protected protected