graphical meterpreter ( beta version of file browser)

git-svn-id: file:///home/svn/framework3/trunk@4936 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
fab 2007-05-18 23:51:10 +00:00
parent 2d88b75871
commit 5f59d4370c
4 changed files with 18 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,14 +1,14 @@
module Msf
module Ui
module Gtk2
#
# Implement a basic window
#
class SkeletonBasic < Gtk::Window
def initialize(title = nil)
super(Gtk::Window::TOPLEVEL)
if title
set_title("#{title}")
end
set_title("#{title}")
signal_connect("key_press_event") do |widget, event|
if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q
@ -20,14 +20,10 @@ module Msf
end
signal_connect("delete_event") do |widget, event|
quit
destroy
true
end
end
def quit
destroy
true
end
end
end

View File

@ -16,13 +16,13 @@ module Msf
def initialize(client)
@client = client
super("MsfBrowser on #{@client.via_session}")
super("MsfBrowser on #{@client.tunnel_peer}")
@model = Gtk::ListStore.new(String, String, TrueClass, Gdk::Pixbuf)
@parent = "/"
@file_pixbuf = Gdk::Pixbuf.new(driver.get_image("gnome-file-c.png"))
@folder_pixbuf = Gdk::Pixbuf.new(driver.get_image("gnome-folder.png"))
@file_pixbuf = Gdk::Pixbuf.new(driver.get_image("msf_file.png"))
@folder_pixbuf = Gdk::Pixbuf.new(driver.get_image("msf_folder.png"))
@model.set_default_sort_func do |a, b|
if !a[COL_IS_DIR] and b[COL_IS_DIR]
1
@ -34,13 +34,17 @@ module Msf
end
@model.set_sort_column_id(Gtk::TreeSortable::DEFAULT_SORT_COLUMN_ID, Gtk::SORT_ASCENDING)
# Populate the ListStore
cmd_ls
# Define the size and border
set_default_size(650, 400)
set_border_width(8)
set_border_width(10)
vbox = Gtk::VBox.new(false, 0)
add(vbox)
# Add the view in the scrolled window
sw = Gtk::ScrolledWindow.new
sw.shadow_type = Gtk::SHADOW_ETCHED_IN
sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC)
@ -55,9 +59,9 @@ module Msf
if iter[COL_DISPLAY_NAME]
@parent = iter[COL_PATH]
cmd_ls
# up_button.sensitive = true
end
end
sw.add(iconview)
iconview.grab_focus
@ -67,7 +71,6 @@ module Msf
def cmd_ls(*args)
@model.clear
path = args[0] || @client.fs.dir.getwd
items = 0
# Enumerate each item...
@client.fs.dir.entries_with_info(path).sort { |a,b| a['FileName'] <=> b['FileName'] }.each do |p|
@ -81,7 +84,6 @@ module Msf
iter[COL_PATH] = path
iter[COL_IS_DIR] = is_dir
iter[COL_PIXBUF] = is_dir ? @folder_pixbuf : @file_pixbuf
items += 1
end
end # cmd_ls