2007-05-13 09:10:26 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
module Gtk2
|
2007-07-02 15:57:36 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# This class provides an assistant to configure module
|
|
|
|
#
|
|
|
|
###
|
2007-05-13 09:10:26 +00:00
|
|
|
class MsfAssistant
|
2007-06-09 21:11:50 +00:00
|
|
|
|
2007-07-02 15:57:36 +00:00
|
|
|
###
|
|
|
|
#
|
|
|
|
# This class perform an assistant to configure and launch exploit
|
|
|
|
#
|
|
|
|
###
|
2007-05-13 09:10:26 +00:00
|
|
|
class Exploit < Msf::Ui::Gtk2::Assistant
|
|
|
|
|
|
|
|
# to stock our values
|
|
|
|
WIZARD = {}
|
|
|
|
|
|
|
|
WizardStruct = Struct.new('Wizard',
|
|
|
|
:description, :page,
|
|
|
|
:target_state, :payload_state, :options_state, :review_state)
|
|
|
|
|
|
|
|
ARRAY = [
|
|
|
|
['Target',
|
|
|
|
["Select your target", "intro", true, false, false, false],
|
|
|
|
],
|
|
|
|
['Payload',
|
|
|
|
["Select your payload", "payload", true, true, false, false],
|
|
|
|
],
|
|
|
|
['Options',
|
|
|
|
["Select your options", "option", true, true, true, false],
|
|
|
|
],
|
|
|
|
['Review',
|
2008-01-20 22:40:11 +00:00
|
|
|
["Confirm settings", "end", true, true, true, true],
|
2007-05-13 09:10:26 +00:00
|
|
|
],
|
|
|
|
].collect do |item, state|
|
2007-06-09 21:11:50 +00:00
|
|
|
WIZARD[item] = WizardStruct.new(
|
2007-05-28 01:16:34 +00:00
|
|
|
state[0],
|
2007-05-13 09:10:26 +00:00
|
|
|
state[1],
|
|
|
|
state[2],
|
|
|
|
state[3],
|
|
|
|
state[4],
|
|
|
|
state[5]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2007-05-13 19:46:26 +00:00
|
|
|
include Msf::Ui::Gtk2::MyControls
|
|
|
|
|
2007-05-13 09:10:26 +00:00
|
|
|
def initialize(active_module)
|
|
|
|
@active_module = active_module
|
|
|
|
@session_tree = $gtk2driver.session_tree
|
|
|
|
@job_tree = $gtk2driver.job_tree
|
|
|
|
@hash = {}
|
|
|
|
|
|
|
|
# Call the parent
|
2008-01-27 02:03:10 +00:00
|
|
|
super(@active_module.name)
|
2007-05-13 09:10:26 +00:00
|
|
|
|
|
|
|
# Initialize exploit driver's exploit instance
|
|
|
|
@mydriver = Msf::ExploitDriver.new(framework)
|
|
|
|
@mydriver.exploit = framework.exploits.create(@active_module.refname)
|
2007-05-13 19:46:26 +00:00
|
|
|
|
2007-05-13 11:32:55 +00:00
|
|
|
# Populate the datastore if possible
|
|
|
|
@mydriver.exploit.load_config
|
2007-05-13 09:10:26 +00:00
|
|
|
|
2008-01-27 02:03:10 +00:00
|
|
|
initialize_options()
|
2007-05-26 17:54:56 +00:00
|
|
|
|
|
|
|
# Begin the wizard
|
2007-05-13 09:10:26 +00:00
|
|
|
target_completion()
|
|
|
|
|
|
|
|
# Build the left frame
|
|
|
|
populate_frame(
|
|
|
|
[
|
|
|
|
@label_target = create_label( WIZARD['Target'].target_state,
|
|
|
|
WIZARD['Target'].description
|
|
|
|
),
|
|
|
|
@label_payload = create_label( WIZARD['Target'].payload_state,
|
|
|
|
WIZARD['Payload'].description
|
|
|
|
),
|
|
|
|
@label_options = create_label( WIZARD['Target'].options_state,
|
|
|
|
WIZARD['Options'].description
|
|
|
|
),
|
|
|
|
@label_review = create_label( WIZARD['Target'].review_state,
|
|
|
|
WIZARD['Review'].description
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
self.show_all
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Save configuration for MsfAssistant
|
|
|
|
#
|
|
|
|
def save
|
2007-05-26 22:21:40 +00:00
|
|
|
dump_to_hash()
|
|
|
|
|
2007-05-13 19:46:26 +00:00
|
|
|
@mydriver.exploit.datastore.import_options_from_hash(@hash, imported = false)
|
2007-05-26 17:54:56 +00:00
|
|
|
|
2007-05-19 22:42:27 +00:00
|
|
|
# If payload
|
2007-05-19 22:31:21 +00:00
|
|
|
begin
|
|
|
|
@mydriver.payload.share_datastore(@mydriver.exploit.datastore)
|
|
|
|
rescue
|
|
|
|
nil
|
|
|
|
end
|
2007-05-26 17:54:56 +00:00
|
|
|
|
2007-05-13 19:46:26 +00:00
|
|
|
# TODO: choose the $gtk2driver or @mydriver.exploit ?
|
|
|
|
$gtk2driver.active_module = @mydriver.exploit
|
|
|
|
$gtk2driver.save_config
|
2007-05-13 09:10:26 +00:00
|
|
|
|
2007-05-13 19:46:26 +00:00
|
|
|
# Save the framework's datastore
|
|
|
|
framework.save_config
|
|
|
|
@mydriver.exploit.datastore.to_file(Msf::Config.config_file, @mydriver.exploit.refname)
|
2008-01-27 02:06:44 +00:00
|
|
|
MsfDialog::Information.new(self,
|
|
|
|
"Configuration Saved",
|
|
|
|
"Settings for exploit module #{@mydriver.exploit.refname} have been saved to #{Msf::Config.config_file}. " +
|
|
|
|
"These settings will be loaded the next time this module is accessed."
|
|
|
|
)
|
|
|
|
|
2007-05-13 09:10:26 +00:00
|
|
|
$gtk2driver.append_log_view("Saved configuration to: #{Msf::Config.config_file}\n")
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Action when Forward button was clicked
|
|
|
|
#
|
|
|
|
def next_page
|
|
|
|
if (self.page == "intro")
|
|
|
|
self.page = "payload"
|
|
|
|
refresh_label( [@label_target], # historic
|
|
|
|
[@label_payload], # actual
|
|
|
|
[@label_options, @label_review] # next
|
|
|
|
)
|
|
|
|
display()
|
|
|
|
payload_completion()
|
|
|
|
elsif (self.page == "payload")
|
|
|
|
self.page = "options"
|
|
|
|
refresh_label( [@label_target, @label_payload], # historic
|
|
|
|
[@label_options], # actual
|
|
|
|
[@label_review] # next
|
|
|
|
)
|
|
|
|
display()
|
2008-01-27 02:03:10 +00:00
|
|
|
initialize_options()
|
2007-05-13 09:10:26 +00:00
|
|
|
options_completion()
|
|
|
|
elsif (self.page == "options")
|
2007-05-26 17:54:56 +00:00
|
|
|
if not validate()
|
|
|
|
self.page = "options"
|
|
|
|
refresh_label( [@label_target, @label_payload], # historic
|
|
|
|
[@label_options], # actual
|
|
|
|
[@label_review] # next
|
|
|
|
)
|
|
|
|
display()
|
2008-01-27 02:03:10 +00:00
|
|
|
initialize_options()
|
2007-05-26 17:54:56 +00:00
|
|
|
options_completion()
|
|
|
|
else
|
|
|
|
self.page = "end"
|
|
|
|
refresh_label( [@label_target, @label_payload, @label_options],
|
|
|
|
[@label_review],
|
|
|
|
nil
|
|
|
|
)
|
|
|
|
display()
|
|
|
|
review_completion()
|
2007-05-13 09:10:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Action when Back button was clicked
|
|
|
|
#
|
|
|
|
def back_page
|
|
|
|
if (self.page == "payload")
|
|
|
|
self.page = "intro"
|
|
|
|
refresh_label( nil,
|
|
|
|
[@label_target],
|
|
|
|
[@label_payload, @label_options, @label_review]
|
|
|
|
)
|
|
|
|
display()
|
|
|
|
target_completion()
|
|
|
|
elsif (self.page == "options")
|
|
|
|
self.page = "payload"
|
|
|
|
refresh_label( [@label_target], # historic
|
|
|
|
[@label_payload], # actual
|
|
|
|
[@label_options, @label_review] # next
|
|
|
|
)
|
|
|
|
display()
|
|
|
|
payload_completion()
|
|
|
|
elsif (self.page == "end")
|
|
|
|
self.page = "options"
|
|
|
|
refresh_label( [@label_target, @label_payload],
|
|
|
|
[@label_options],
|
|
|
|
[@label_review]
|
|
|
|
)
|
|
|
|
display()
|
2008-01-27 02:03:10 +00:00
|
|
|
initialize_options()
|
2007-05-13 09:10:26 +00:00
|
|
|
options_completion()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Display the target view
|
|
|
|
#
|
|
|
|
def target_completion
|
|
|
|
|
|
|
|
# Model for Gtk::Combo
|
|
|
|
model_target = Gtk::ListStore.new(String, Object)
|
|
|
|
|
|
|
|
# Add iter to Gtk::Combo
|
|
|
|
@active_module.targets.each_with_index do |target, idx|
|
|
|
|
iter = model_target.append
|
|
|
|
iter[0] = target.name
|
|
|
|
iter[1] = idx
|
|
|
|
end
|
|
|
|
|
|
|
|
# Gtk::ComboBox
|
|
|
|
combo_target = Gtk::ComboBox.new(model_target)
|
2007-05-13 11:32:55 +00:00
|
|
|
begin
|
|
|
|
combo_target.active = @mydriver.exploit.datastore['TARGET'].to_i
|
|
|
|
rescue
|
|
|
|
combo_target.active = 0
|
|
|
|
end
|
2007-05-13 09:10:26 +00:00
|
|
|
|
|
|
|
# Pack & renderer combo_target
|
|
|
|
renderer = Gtk::CellRendererText.new
|
|
|
|
combo_target.pack_start(renderer, true)
|
|
|
|
combo_target.set_attributes(renderer, :text => 0)
|
|
|
|
|
|
|
|
# Define default value
|
|
|
|
@hash["TARGET"] = combo_target.active_iter[1]
|
|
|
|
|
|
|
|
# Signal for combo payload
|
|
|
|
combo_target.signal_connect('changed') do ||
|
|
|
|
@hash["TARGET"] = combo_target.active_iter[1]
|
|
|
|
end
|
|
|
|
|
|
|
|
self.main.pack_start(combo_target, true, false, 0)
|
|
|
|
self.main.show_all
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Display the payload view
|
|
|
|
#
|
|
|
|
def payload_completion
|
|
|
|
|
|
|
|
# Model for Gtk::Combox
|
|
|
|
model_all = Gtk::ListStore.new(String, Object)
|
2007-05-13 19:46:26 +00:00
|
|
|
|
2007-05-13 11:32:55 +00:00
|
|
|
index = ""
|
2007-05-13 09:10:26 +00:00
|
|
|
|
|
|
|
# Add iter to Model
|
2007-05-13 11:32:55 +00:00
|
|
|
@active_module.compatible_payloads.each_with_index do |key, idx|
|
2007-05-13 09:10:26 +00:00
|
|
|
iter = model_all.append
|
2007-05-13 19:46:26 +00:00
|
|
|
|
2007-05-13 11:32:55 +00:00
|
|
|
# refname
|
|
|
|
iter[0] = key[0]
|
|
|
|
# payload
|
|
|
|
iter[1] = key[1]
|
2007-05-13 19:46:26 +00:00
|
|
|
|
2007-05-13 11:32:55 +00:00
|
|
|
if ( @mydriver.exploit.datastore['PAYLOAD'] == key[0])
|
|
|
|
index = idx
|
|
|
|
end
|
2007-05-13 09:10:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Gtk::ComboBox
|
|
|
|
combo_all = Gtk::ComboBox.new(model_all)
|
2007-05-13 11:32:55 +00:00
|
|
|
begin
|
|
|
|
combo_all.active = index
|
|
|
|
rescue
|
|
|
|
combo_all.active = 0
|
|
|
|
end
|
2007-07-02 15:57:36 +00:00
|
|
|
|
2007-05-13 09:10:26 +00:00
|
|
|
# Pack & renderer combo_all
|
|
|
|
renderer = Gtk::CellRendererText.new
|
|
|
|
combo_all.pack_start(renderer, true)
|
|
|
|
combo_all.set_attributes(renderer, :text => 0)
|
|
|
|
|
|
|
|
# Pack combo
|
|
|
|
self.main.pack_start(combo_all, true, false, 0)
|
|
|
|
|
|
|
|
# Stuff for description payload
|
|
|
|
textscroll = Gtk::ScrolledWindow.new
|
|
|
|
textscroll.shadow_type = Gtk::SHADOW_IN
|
|
|
|
textscroll.hscrollbar_policy = Gtk::POLICY_AUTOMATIC
|
|
|
|
textscroll.vscrollbar_policy = Gtk::POLICY_AUTOMATIC
|
|
|
|
buffer = Gtk::TextBuffer.new
|
|
|
|
textview = Gtk::TextView.new(buffer)
|
|
|
|
textview.set_editable(false)
|
|
|
|
textview.set_cursor_visible(false)
|
|
|
|
textscroll.add(textview)
|
|
|
|
|
|
|
|
# Pack description
|
|
|
|
self.main.pack_start(textscroll, true, false, 0)
|
|
|
|
|
|
|
|
# Define default value
|
|
|
|
buffer.set_text(combo_all.active_iter[1].new.description)
|
|
|
|
@hash["PAYLOAD"] = combo_all.active_iter[0]
|
|
|
|
|
|
|
|
# Signal for combo payload
|
|
|
|
combo_all.signal_connect('changed') do
|
|
|
|
buffer.set_text(combo_all.active_iter[1].new.description)
|
|
|
|
@hash["PAYLOAD"] = combo_all.active_iter[0]
|
|
|
|
end
|
|
|
|
|
|
|
|
self.main.show_all
|
|
|
|
end
|
|
|
|
|
2007-05-26 22:21:40 +00:00
|
|
|
|
2008-01-27 02:03:10 +00:00
|
|
|
#
|
|
|
|
# Instantiate the options page controls
|
|
|
|
#
|
|
|
|
def initialize_options
|
|
|
|
@frame_standard = Gtk::Expander.new("Standard")
|
|
|
|
@frame_advanced = Gtk::Expander.new("Advanced")
|
|
|
|
@frame_evasion = Gtk::Expander.new("Evasion")
|
|
|
|
@options_standard = Gtk::VBox.new(false, 0)
|
|
|
|
@options_advanced = Gtk::VBox.new(false, 0)
|
|
|
|
@options_evasion = Gtk::VBox.new(false, 0)
|
|
|
|
|
|
|
|
@framer = Gtk::VBox.new(false, 10)
|
|
|
|
@scroller = Gtk::ScrolledWindow.new
|
|
|
|
@scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
|
|
|
|
@scroller.set_size_request(580, 420)
|
|
|
|
|
|
|
|
@viewport = Gtk::Viewport.new(@scroller.hadjustment, @scroller.vadjustment)
|
|
|
|
|
|
|
|
@frame_standard.expanded = true
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Display options view
|
|
|
|
#
|
|
|
|
def options_completion
|
|
|
|
self.page = "options"
|
|
|
|
|
|
|
|
# Title and three sets of options
|
|
|
|
title = Gtk::Label.new
|
|
|
|
title.set_markup("<big><b>#{@mydriver.exploit.name}</b></big>")
|
|
|
|
@framer.pack_start(title, false, true, 5)
|
|
|
|
@framer.pack_start(@frame_standard, false, false, 10)
|
|
|
|
@framer.pack_start(@frame_advanced, false, false, 10)
|
|
|
|
@framer.pack_start(@frame_evasion, false, false, 10)
|
|
|
|
|
2008-11-08 23:06:04 +00:00
|
|
|
uniq = {}
|
|
|
|
|
2008-11-08 19:25:25 +00:00
|
|
|
# Exploit options
|
2008-01-27 02:03:10 +00:00
|
|
|
@mydriver.exploit.options.sorted.each do |key, opt|
|
2008-11-08 23:06:04 +00:00
|
|
|
uniq[key] ||= true
|
2008-11-08 19:25:25 +00:00
|
|
|
if(opt.evasion?)
|
|
|
|
@options_evasion.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
|
|
|
elsif(opt.advanced?)
|
|
|
|
@options_advanced.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
|
|
|
else
|
|
|
|
@options_standard.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
|
|
|
end
|
2008-01-27 02:03:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Payload options
|
|
|
|
@mydriver.payload = framework.payloads.create(@hash["PAYLOAD"])
|
|
|
|
@mydriver.payload.options.each do |key, opt|
|
2008-11-08 23:06:04 +00:00
|
|
|
next if uniq[key]
|
2008-11-08 19:25:25 +00:00
|
|
|
if(opt.evasion?)
|
|
|
|
@options_evasion.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
|
|
|
elsif(opt.advanced?)
|
2008-01-27 02:03:10 +00:00
|
|
|
@options_advanced.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
2008-11-08 19:25:25 +00:00
|
|
|
else
|
|
|
|
@options_standard.pack_start(add_option(key, opt, @mydriver.exploit.datastore[key]), false, false, 10)
|
|
|
|
end
|
|
|
|
|
2008-01-27 02:03:10 +00:00
|
|
|
end
|
2008-01-20 22:40:11 +00:00
|
|
|
|
2008-01-27 02:03:10 +00:00
|
|
|
# Display
|
|
|
|
indent = Gtk::HBox.new(false, 5)
|
|
|
|
indent.pack_start(Gtk::Label.new(""), false, false, 5)
|
|
|
|
indent.pack_start(@options_standard, false, false, 0)
|
|
|
|
indent.pack_start(Gtk::Label.new(""),true, true, 5)
|
|
|
|
@frame_standard.add(indent)
|
|
|
|
|
|
|
|
indent = Gtk::HBox.new(false, 5)
|
|
|
|
indent.pack_start(Gtk::Label.new(""), false, false, 5)
|
|
|
|
indent.pack_start(@options_advanced, false, false, 0)
|
|
|
|
indent.pack_start(Gtk::Label.new(""),true, true, 5)
|
|
|
|
@frame_advanced.add(indent)
|
|
|
|
|
|
|
|
indent = Gtk::HBox.new(false, 5)
|
|
|
|
indent.pack_start(Gtk::Label.new(""), false, false, 5)
|
|
|
|
indent.pack_start(@options_evasion, false, false, 0)
|
|
|
|
indent.pack_start(Gtk::Label.new(""),true, true, 5)
|
|
|
|
@frame_evasion.add(indent)
|
|
|
|
|
|
|
|
labels = ["Standard", "Advanced", "Evasion"]
|
|
|
|
[@frame_standard, @frame_advanced, @frame_evasion].each do |obj|
|
|
|
|
txt = labels.shift
|
|
|
|
obj.spacing = 10
|
|
|
|
obj.use_markup = true
|
|
|
|
obj.label = "<big><b>#{txt}</b></big>"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Stuff it into a viewport
|
|
|
|
@viewport.add(@framer)
|
|
|
|
|
|
|
|
# Stuff the viewport into a scrolledwindow
|
|
|
|
@scroller.add(@viewport)
|
|
|
|
|
|
|
|
# Stuff this into main and call it done
|
|
|
|
self.main.pack_start(@scroller, true, true, 10)
|
|
|
|
self.main.show_all
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2007-05-26 17:54:56 +00:00
|
|
|
#
|
2007-05-26 22:21:40 +00:00
|
|
|
# Put all values in a hash
|
2007-05-26 17:54:56 +00:00
|
|
|
#
|
2007-05-26 22:21:40 +00:00
|
|
|
def dump_to_hash
|
2008-01-27 02:03:10 +00:00
|
|
|
@options_standard.each do |widget|
|
2007-05-26 17:54:56 +00:00
|
|
|
name, value = widget.get_pair
|
|
|
|
begin
|
2007-06-09 21:11:50 +00:00
|
|
|
@hash[name] = value
|
2007-05-26 17:54:56 +00:00
|
|
|
rescue
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
@options_advanced.each do |widget|
|
|
|
|
name, value = widget.get_pair
|
|
|
|
begin
|
|
|
|
if (@mydriver.exploit.options[name].default.to_s == value)
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
@hash[name] = value
|
|
|
|
end
|
|
|
|
rescue
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-05-26 22:21:40 +00:00
|
|
|
@options_evasion.each do |widget|
|
|
|
|
name, value = widget.get_pair
|
|
|
|
begin
|
|
|
|
if (@mydriver.exploit.options[name].default.to_s == value)
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
@hash[name] = value
|
|
|
|
end
|
|
|
|
rescue
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Validate options in datastore
|
|
|
|
#
|
|
|
|
def validate
|
|
|
|
dump_to_hash()
|
|
|
|
|
2007-05-26 17:54:56 +00:00
|
|
|
errors = []
|
|
|
|
@mydriver.exploit.datastore.import_options_from_hash(@hash)
|
|
|
|
|
|
|
|
@mydriver.exploit.options.each_pair do |name, option|
|
|
|
|
if (!option.valid?(@mydriver.exploit.datastore[name]))
|
|
|
|
errors << name
|
|
|
|
|
|
|
|
# If the option is valid, normalize its format to the correct type.
|
|
|
|
elsif ((val = option.normalize(@mydriver.exploit.datastore[name])) != nil)
|
|
|
|
@mydriver.exploit.datastore.update_value(name, val)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if (errors.empty? == false)
|
2008-01-27 02:03:10 +00:00
|
|
|
MsfDialog::Error.new(self, "Failed to validate: #{errors.join(', ')}")
|
2007-05-26 17:54:56 +00:00
|
|
|
false
|
|
|
|
else
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-05-13 09:10:26 +00:00
|
|
|
#
|
|
|
|
# Display the review page
|
|
|
|
#
|
|
|
|
def review_completion
|
|
|
|
warning = Gtk::Label.new
|
|
|
|
warning.set_markup("Review your configuration before clicking the <b>apply</b> button")
|
|
|
|
self.main.pack_start(warning, false, false, 0)
|
|
|
|
|
|
|
|
label = Gtk::Label.new
|
|
|
|
review = "\n\n"
|
|
|
|
@hash.each do |key, value|
|
|
|
|
review << "<b>#{key}</b> : #{value}\n"
|
|
|
|
end
|
|
|
|
label.set_markup(review)
|
|
|
|
|
|
|
|
self.main.pack_start(label, false, false, 0)
|
|
|
|
|
|
|
|
self.main.show_all
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fire !!
|
|
|
|
#
|
|
|
|
def apply
|
|
|
|
# Import options from the supplied assistant
|
|
|
|
@mydriver.exploit.datastore.import_options_from_hash(@hash)
|
|
|
|
|
|
|
|
# Share the exploit's datastore with the payload
|
|
|
|
@mydriver.payload.share_datastore(@mydriver.exploit.datastore)
|
|
|
|
|
|
|
|
@mydriver.target_idx = (@mydriver.exploit.datastore['TARGET']).to_i
|
|
|
|
|
|
|
|
@pipe = Msf::Ui::Gtk2::GtkConsolePipe.new
|
|
|
|
|
|
|
|
@mydriver.exploit.init_ui(@pipe, @pipe)
|
|
|
|
@mydriver.payload.init_ui(@pipe, @pipe)
|
|
|
|
|
|
|
|
@mydriver.use_job = true
|
|
|
|
|
|
|
|
@pipe.create_subscriber_proc() do |msg|
|
2008-01-24 05:29:35 +00:00
|
|
|
$gtk2driver.append_log_view(@mydriver.exploit.refname.split("/")[-1] + " " + msg)
|
2007-05-13 09:10:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@pipe.print_status("Launching exploit #{@mydriver.exploit.refname}...")
|
|
|
|
|
|
|
|
begin
|
|
|
|
@mydriver.run
|
|
|
|
rescue ::Exception => e
|
Merged revisions 5366-5377 via svnmerge from
svn+ssh://metasploit.com/home/svn/framework3/branches/framework-3.1
........
r5366 | hdm | 2008-01-26 20:30:53 -0600 (Sat, 26 Jan 2008) | 2 lines
Update version information
........
r5367 | hdm | 2008-01-26 21:10:57 -0600 (Sat, 26 Jan 2008) | 3 lines
Updated for version 3.1
........
r5369 | hdm | 2008-01-26 21:13:31 -0600 (Sat, 26 Jan 2008) | 3 lines
Wipe the private directories from the branch.
........
r5371 | hdm | 2008-01-27 17:24:24 -0600 (Sun, 27 Jan 2008) | 5 lines
Timeout options added for dcerpc connect and read times. Addition of novell netware as a supported target platform. Inclusion of the serverprotect exploit (still works on the latest version). Addition of the first remote netware kernel exploit that leads to a shell, addition of netware stager and shell, and first draft of the release notes for 3.1
........
r5372 | hdm | 2008-01-27 17:30:08 -0600 (Sun, 27 Jan 2008) | 3 lines
Formatting, indentation, fixed the static IP embedded in the request
........
r5373 | hdm | 2008-01-27 20:02:48 -0600 (Sun, 27 Jan 2008) | 3 lines
Correctly trap exploit errors in a way that works with all of the UIs
........
r5374 | hdm | 2008-01-27 20:23:25 -0600 (Sun, 27 Jan 2008) | 3 lines
More last-minute bug fixes
........
r5375 | hdm | 2008-01-27 20:37:43 -0600 (Sun, 27 Jan 2008) | 3 lines
Force multi-bind off in netware, correct label display in gtk gui labels
........
r5376 | hdm | 2008-01-27 20:50:03 -0600 (Sun, 27 Jan 2008) | 3 lines
More exception handling fun
........
git-svn-id: file:///home/svn/framework3/trunk@5378 4d416f70-5f16-0410-b530-b9f4589650da
2008-01-28 03:06:31 +00:00
|
|
|
@mydriver.exploit.print_error("Exploit failed: #{$!}")
|
|
|
|
elog("Exploit failed: #{$!}", 'core', LEV_0)
|
|
|
|
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_3)
|
2007-05-13 09:10:26 +00:00
|
|
|
end
|
2008-01-24 05:29:35 +00:00
|
|
|
select(nil, nil, nil, 0.01)
|
|
|
|
@pipe.print_status("Exploit #{@mydriver.exploit.refname} completed.") if not @mydriver.use_job
|
2007-05-13 09:10:26 +00:00
|
|
|
end
|
2007-07-02 15:57:36 +00:00
|
|
|
|
|
|
|
end # MsfAssistant::Exploit
|
2007-05-13 09:10:26 +00:00
|
|
|
|
2007-07-02 15:57:36 +00:00
|
|
|
end # Exploit
|
2007-05-13 09:10:26 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2008-11-08 19:25:25 +00:00
|
|
|
end
|