forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsfweb
executable file
·45 lines (38 loc) · 1.13 KB
/
msfweb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/ruby
#
# This user interface provides users with a web-based interface to the
# framework that can be shared.
#
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'rex'
require 'msf/ui'
# Declare the argument parser for msfweb
arguments = Rex::Parser::Arguments.new(
"-a" => [ true, "Bind to this IP address instead of loopback" ],
"-p" => [ true, "Bind to this port instead of 55555" ],
"-v" => [ true, "A number between 0 and 3 that controls log verbosity" ],
"-d" => [ false, "Daemonize the web server" ],
"-h" => [ false, "Help banner" ])
opts = {}
background = false
# Parse command line arguments.
arguments.parse(ARGV) { |opt, idx, val|
case opt
when "-a"
opts['ServerHost'] = val
when "-p"
opts['ServerPort'] = val
when "-v"
opts['LogLevel'] = val
when "-d"
background = true
when "-h"
print(
"\nUsage: msfweb <options>\n" +
arguments.usage)
exit
end
}
exit if (Process.fork()) unless background == false
# Create the driver instance and run it.
Msf::Ui::Web::Driver.new(opts).run