Update for graphical meterpreter (cmd_ps)
git-svn-id: file:///home/svn/framework3/trunk@4981 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
6bb46ec862
commit
1630aa7900
|
@ -50,7 +50,11 @@ module Msf
|
||||||
|
|
||||||
# Init tips on the treeview for session
|
# Init tips on the treeview for session
|
||||||
tips = SessionTips.new(column_type)
|
tips = SessionTips.new(column_type)
|
||||||
tips.add_view(@treeview)
|
begin
|
||||||
|
tips.add_view(@treeview)
|
||||||
|
rescue
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
#set model to treeview
|
#set model to treeview
|
||||||
@treeview.set_model(@model)
|
@treeview.set_model(@model)
|
||||||
|
|
|
@ -96,6 +96,12 @@ module Msf
|
||||||
def build_menu
|
def build_menu
|
||||||
# Session Gtk::Menu
|
# Session Gtk::Menu
|
||||||
menu_process = Gtk::Menu.new
|
menu_process = Gtk::Menu.new
|
||||||
|
|
||||||
|
refresh_item_shell = Gtk::ImageMenuItem.new("Refresh")
|
||||||
|
refresh_image_shell = Gtk::Image.new
|
||||||
|
refresh_image_shell.set(Gtk::Stock::REFRESH, Gtk::IconSize::MENU)
|
||||||
|
refresh_item_shell.set_image(refresh_image_shell)
|
||||||
|
menu_process.append(refresh_item_shell)
|
||||||
|
|
||||||
migrate_item_shell = Gtk::ImageMenuItem.new("Migrate PID")
|
migrate_item_shell = Gtk::ImageMenuItem.new("Migrate PID")
|
||||||
migrate_image_shell = Gtk::Image.new
|
migrate_image_shell = Gtk::Image.new
|
||||||
|
@ -108,6 +114,10 @@ module Msf
|
||||||
kill_image_shell.set(Gtk::Stock::STOP, Gtk::IconSize::MENU)
|
kill_image_shell.set(Gtk::Stock::STOP, Gtk::IconSize::MENU)
|
||||||
kill_item_shell.set_image(kill_image_shell)
|
kill_item_shell.set_image(kill_image_shell)
|
||||||
menu_process.append(kill_item_shell)
|
menu_process.append(kill_item_shell)
|
||||||
|
|
||||||
|
refresh_item_shell.signal_connect('activate') do |item|
|
||||||
|
update()
|
||||||
|
end
|
||||||
|
|
||||||
migrate_item_shell.signal_connect('activate') do |item|
|
migrate_item_shell.signal_connect('activate') do |item|
|
||||||
if current = @selection.selected
|
if current = @selection.selected
|
||||||
|
@ -153,22 +163,26 @@ module Msf
|
||||||
# Kills one or more processes.
|
# Kills one or more processes.
|
||||||
#
|
#
|
||||||
def cmd_kill(*args)
|
def cmd_kill(*args)
|
||||||
@client.sys.process.kill(*(args.map { |x| x.to_i }))
|
begin
|
||||||
|
@client.sys.process.kill(*(args.map { |x| x.to_i }))
|
||||||
|
rescue ::Exception => e
|
||||||
|
MsfDialog::Warning.new(self, "Kill Process", e.to_s)
|
||||||
|
end
|
||||||
update()
|
update()
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Migrate the server to the supplied process identifier.
|
# Migrate the server to the supplied process identifier.
|
||||||
#
|
#
|
||||||
def cmd_migrate(pid)
|
def cmd_migrate(pid)
|
||||||
old_pid = @client.sys.process.getpid
|
old_pid = @client.sys.process.getpid
|
||||||
@client.core.migrate(pid)
|
@client.core.migrate(pid)
|
||||||
|
|
||||||
text = ""
|
text = ""
|
||||||
text << "Migration completed successfully : \n"
|
text << "Migration completed successfully : \n"
|
||||||
text << "Old PID :#{old_pid}\n"
|
text << "Old PID :#{old_pid}\n"
|
||||||
text << "New PID :#{@client.sys.process.getpid}"
|
text << "New PID :#{@client.sys.process.getpid}"
|
||||||
MsfDialog::Information.new(self, text)
|
MsfDialog::Information.new(self, text)
|
||||||
end
|
end
|
||||||
|
|
||||||
end # Ps
|
end # Ps
|
||||||
|
|
Loading…
Reference in New Issue