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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/metasploit/command_line_argument_parser.rb', line 4
def self.parse(args)
options = {}
options['use_ssl'] = false
options['use_os_filter'] = false
options['exploit_speed'] = 5
options['limit_sessions'] = false
options['port'] = ''
options['uri'] = ''
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: exploit [options]'
opts.separator ''
opts.separator 'Specific options:'
opts.on('--port PORT', 'Metasploit port') do |port|
options['port'] = port
end
opts.on('--connection-url URL', 'Metasploit URL') do |url|
options['connection_url'] = url
end
opts.on('--use-ssl', 'Use SSL when scanning') do
options['use_ssl'] = true
end
opts.on('--token TOKEN', 'Access token for Metasploit') do |token|
options['token'] = token
end
opts.on('--workspace-name NAME', 'Name of workspace') do |workspace|
options['workspace_name'] = workspace
end
opts.on('--nexpose-console-name NAME', 'Name of Nexpose console') do |console|
options['nexpose_console_name'] = console
end
opts.on('--device-ip-to-scan IP-ADDRESS', 'IP address of device to scan') do |ip|
options['device_ip_to_scan'] = ip
end
opts.on('--use-os-filter', 'Use OS filter') do
options['use_os_filter'] = true
end
opts.on('--module-filter MODULES', 'Comma-separated list of modules to use in scan') do |modules|
options['module_filter'] = modules
end
opts.on('--report-type TYPE', 'Type of report to generate') do |type|
options['report_type'] = type.to_sym
end
opts.on('--whitelist-hosts HOSTS', 'IP addresses or CIDR blocks to scan') do |whitelist|
options['whitelist_hosts'] = whitelist
end
opts.on('--exploit-speed SPEED', 'Exploit speed') do |speed|
options['exploit_speed'] = speed
end
opts.on('--limit-sessions', 'Limit sessions') do
options['limit_sessions'] = true
end
end
opt_parser.parse!(args)
options
end
|