Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 55 lines (41 sloc) 1.177 kB
aca397d @hmoore-r7 Initial import for the msfgui code from Fab
hmoore-r7 authored
1 #!/usr/bin/env ruby
2 #
3 # This is a basic user interface using the Gtk2 GUI library
4 #
5
6 msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
7 $:.unshift(File.join(File.dirname(msfbase), 'lib'))
8
9
10 require 'rex'
11 require 'msf/base'
12 require 'msf/ui'
13
14 begin
15 require 'gtk2'
16 require 'libglade2'
17 rescue ::Exception => e
18 $stderr.puts "[*] The msfgtk2 interface requires the ruby-gtk2 and ruby-libglade2 package"
19 exit(0)
20 end
21
22 require 'msf/ui/gtk2'
23
24
25 # Declare the argument parser for msfwx
26 arguments = Rex::Parser::Arguments.new(
27 "-v" => [ true, "A number between 0 and 3 that controls log verbosity" ],
28 "-d" => [ false, "Keep running in the foreground" ],
29 "-h" => [ false, "Help banner" ])
30
31 opts = {}
32 background = false
33
34 # Parse command line arguments.
35 arguments.parse(ARGV) { |opt, idx, val|
36 case opt
37 when "-v"
38 opts['LogLevel'] = val
39 when "-d"
40 background = true
41 when "-h"
42 print(
43 "\nUsage: msfgui <options>\n" +
44 arguments.usage)
45 exit
46 end
47 }
48
49 exit if (Process.fork()) unless background == false
50
51 # Create the driver instance and run it.
52 Msf::Ui::Gtk2::Driver.new(opts).run
53
54
Something went wrong with that request. Please try again.