mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-12 11:52:01 +01:00
ce52979566
git-svn-id: file:///home/svn/framework3/trunk@3795 4d416f70-5f16-0410-b530-b9f4589650da
52 lines
1.1 KiB
Ruby
Executable File
52 lines
1.1 KiB
Ruby
Executable File
#!/usr/bin/env ruby
|
|
#
|
|
# This is a basic user interface using the Wx GUI library
|
|
#
|
|
|
|
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
|
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
|
|
|
|
|
|
require 'rex'
|
|
require 'msf/base'
|
|
require 'msf/ui'
|
|
|
|
begin
|
|
require 'wxruby'
|
|
rescue ::Exception => e
|
|
$stderr.puts "[*] The msfwx interface requires the wxruby package"
|
|
exit(0)
|
|
end
|
|
|
|
require 'msf/ui/wx'
|
|
|
|
|
|
# Declare the argument parser for msfwx
|
|
arguments = Rex::Parser::Arguments.new(
|
|
"-v" => [ true, "A number between 0 and 3 that controls log verbosity" ],
|
|
"-d" => [ false, "Keep running in the foreground" ],
|
|
"-h" => [ false, "Help banner" ])
|
|
|
|
opts = {}
|
|
background = false
|
|
|
|
# Parse command line arguments.
|
|
arguments.parse(ARGV) { |opt, idx, val|
|
|
case opt
|
|
when "-v"
|
|
opts['LogLevel'] = val
|
|
when "-d"
|
|
background = true
|
|
when "-h"
|
|
print(
|
|
"\nUsage: msfwx <options>\n" +
|
|
arguments.usage)
|
|
exit
|
|
end
|
|
}
|
|
|
|
exit if (Process.fork()) unless background == false
|
|
|
|
# Create the driver instance and run it.
|
|
Msf::Ui::Wx::Driver.new(opts).run
|