mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
Initial commit of compiled java gui.
git-svn-id: file:///home/svn/framework3/trunk@9817 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
8de510f914
commit
2f6d0777ae
BIN
data/gui/lib/appframework-1.0.3.jar
Executable file
BIN
data/gui/lib/appframework-1.0.3.jar
Executable file
Binary file not shown.
BIN
data/gui/lib/swing-worker-1.1.jar
Executable file
BIN
data/gui/lib/swing-worker-1.1.jar
Executable file
Binary file not shown.
BIN
data/gui/msfgui.jar
Executable file
BIN
data/gui/msfgui.jar
Executable file
Binary file not shown.
117
msfgui
117
msfgui
@ -1,122 +1,11 @@
|
||||
#!/usr/bin/env ruby
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# This is a basic user interface using the Gtk2 GUI library
|
||||
# Graphical user interface written in Java with rpc.
|
||||
#
|
||||
# $Revision$
|
||||
#
|
||||
|
||||
msfbase = __FILE__
|
||||
while File.symlink?(msfbase)
|
||||
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
|
||||
end
|
||||
|
||||
$:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
|
||||
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
|
||||
|
||||
require 'rex'
|
||||
require 'msf/base'
|
||||
require 'msf/ui'
|
||||
|
||||
$stderr.puts "[*] Warning: As of Metasploit 3.3 this interface is no longer supported:"
|
||||
$stderr.puts " Please see https://metasploit.com/redmine/issues/503"
|
||||
$stderr.puts ""
|
||||
|
||||
# Check for ruby packages
|
||||
begin
|
||||
require 'gtk2'
|
||||
require 'libglade2'
|
||||
rescue ::Exception => e
|
||||
$stderr.puts "[*] The msfgui interface requires the ruby-gtk2 and ruby-libglade2 packages"
|
||||
$stderr.puts "[*] Dependencies include ruby-pango, ruby-glib2, ruby-gdkpixbuf2, and ruby-atk"
|
||||
$stderr.puts "[-] Error: #{e.class} #{e}"
|
||||
exit(0)
|
||||
end
|
||||
|
||||
# Check for Gtk+ version
|
||||
# Returns: nil if the GTK+ library is compatible with the given version,
|
||||
# or a string describing the version mismatch.
|
||||
if gtkversion = Gtk.check_version(2,8,0)
|
||||
$stderr.puts "[*] The msfgui interface requires Gtk+ 2.8 or later"
|
||||
$stderr.puts "[*] Your Gtk+ version : #{gtkversion}"
|
||||
exit
|
||||
end
|
||||
|
||||
require 'msf/ui/gtk2'
|
||||
|
||||
# Declare the argument parser for msfgui
|
||||
arguments = Rex::Parser::Arguments.new(
|
||||
"-v" => [ true, "A number between 0 and 3 that controls log verbosity" ],
|
||||
"-r" => [ true, "Execute the specified resource file" ],
|
||||
"-d" => [ false, "Fork and run in the background" ],
|
||||
"-D" => [ false, "Keep stdio and stderr open for debugging" ],
|
||||
"-h" => [ false, "Help banner" ])
|
||||
|
||||
opts = {}
|
||||
foreground = true
|
||||
debug = false
|
||||
|
||||
# Parse command line arguments.
|
||||
arguments.parse(ARGV) { |opt, idx, val|
|
||||
case opt
|
||||
when "-v"
|
||||
opts['LogLevel'] = val
|
||||
when "-r"
|
||||
opts['Resource'] = val
|
||||
when "-d"
|
||||
foreground = false
|
||||
when "-D"
|
||||
debug = true
|
||||
when "-h"
|
||||
print(
|
||||
"\nUsage: msfgui <options>\n" +
|
||||
arguments.usage)
|
||||
exit
|
||||
end
|
||||
}
|
||||
|
||||
# Fork into the background if requested
|
||||
begin
|
||||
if (not foreground)
|
||||
exit(0) if Process.fork()
|
||||
end
|
||||
rescue ::NotImplementedError
|
||||
$stderr.puts "[-] Background mode is not available on this platform"
|
||||
end
|
||||
|
||||
class FakeOut
|
||||
def write(buff)
|
||||
buff.length
|
||||
end
|
||||
|
||||
def method_missing(meth, *args)
|
||||
end
|
||||
end
|
||||
|
||||
if(not debug)
|
||||
|
||||
begin; $stdout.close; rescue; end
|
||||
begin; $stderr.close; rescue; end
|
||||
|
||||
fake = FakeOut.new
|
||||
$stdout = fake
|
||||
$stderr = fake
|
||||
|
||||
# Only treat super nasty Gtk errors as fatal
|
||||
GLib::Log.set_fatal_mask("GLib", GLib::Log::LEVEL_ERROR)
|
||||
GLib::Log.set_fatal_mask("Gtk", GLib::Log::LEVEL_ERROR)
|
||||
GLib::Log.set_fatal_mask("Gdk", GLib::Log::LEVEL_ERROR)
|
||||
GLib::Log.set_fatal_mask(nil, GLib::Log::LEVEL_ERROR)
|
||||
|
||||
# GLib::Log.log("Gtk", GLib::Log::LEVEL_CRITICAL, "TESTING > /dev/null")
|
||||
end
|
||||
|
||||
$stderr.puts "[*] Debugging mode is enabled"
|
||||
|
||||
# Language is English
|
||||
ENV['LANG'] = 'C'
|
||||
|
||||
# Create the driver instance and run it.
|
||||
Msf::Ui::Gtk2::Driver.new(opts).run
|
||||
java -jar `dirname $0`/data/gui/msfgui.jar
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user