support save_config and many changes on MsfAssistant

git-svn-id: file:///home/svn/framework3/trunk@4909 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
fab 2007-05-13 19:46:26 +00:00
parent 36b6da19fd
commit 938e9bf5ad
2 changed files with 21 additions and 20 deletions

View File

@ -41,6 +41,8 @@ module Msf
)
end
include Msf::Ui::Gtk2::MyControls
#
# Init
#
@ -92,20 +94,16 @@ module Msf
# Save configuration for MsfAssistant
#
def save
# Save the console config
$gtk2driver.save_config(@mydriver.exploit)
@mydriver.exploit.datastore.import_options_from_hash(@hash, imported = false)
@mydriver.payload.share_datastore(@mydriver.exploit.datastore)
# TODO: choose the $gtk2driver or @mydriver.exploit ?
$gtk2driver.active_module = @mydriver.exploit
$gtk2driver.save_config
# Save the framework's datastore
begin
framework.save_config
if (@mydriver.exploit)
@mydriver.exploit.save_config
end
rescue
MsfDialog::Error.new(self, "Failed to save config file")
return false
end
@mydriver.exploit.datastore.to_file(Msf::Config.config_file, @mydriver.exploit.refname)
$gtk2driver.append_log_view("Saved configuration to: #{Msf::Config.config_file}\n")
end
@ -494,5 +492,3 @@ module Msf
end
end
end

View File

@ -92,7 +92,7 @@ module Msf
#
# Saves configuration for MsfAssistant.
#
def save_config(active_module)
def save_config
# Build out the assistant config group
group = {}
@ -151,6 +151,11 @@ module Msf
#
attr_reader :framework
#
# The active module associated with the driver.
#
attr_accessor :active_module
protected
attr_writer :framework # :nodoc: