Files
metasploit-gs/lib/msf/core/opt.rb
T

119 lines
3.8 KiB
Ruby
Raw Normal View History

# -*- coding: binary -*-
module Msf
2015-04-03 23:28:45 -05:00
#
# Builtin framework options with shortcut methods
#
# @example
# register_options(
# [
# Opt::RHOST,
# Opt::RPORT(21),
# ]
# )
# register_advanced_options([Opt::Proxies])
#
module Opt
2015-04-03 23:28:45 -05:00
# @return [OptAddress]
def self.CHOST(default=nil, required=false, desc="The local client address")
Msf::OptAddress.new(__method__.to_s, [ required, desc, default ])
end
2015-04-03 23:28:45 -05:00
# @return [OptPort]
def self.CPORT(default=nil, required=false, desc="The local client port")
Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
end
2018-05-24 17:50:58 -05:00
# @return [OptAddressLocal]
def self.LHOST(default=nil, required=true, desc="The listen address (an interface may be specified)")
2017-05-02 12:37:59 -05:00
Msf::OptAddressLocal.new(__method__.to_s, [ required, desc, default ])
2015-04-03 23:28:45 -05:00
end
# @return [OptPort]
def self.LPORT(default=nil, required=true, desc="The listen port")
Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
end
# @return [OptString]
def self.Proxies(default=nil, required=false, desc="A proxy chain of format type:host:port[,type:host:port][...]")
Msf::OptString.new(__method__.to_s, [ required, desc, default ])
end
2018-05-24 21:25:30 -05:00
# @return [OptAddressRange]
2019-09-20 09:56:11 +02:00
def self.RHOSTS(default=nil, required=true, desc="The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'")
2018-05-24 21:25:30 -05:00
Msf::OptAddressRange.new('RHOSTS', [ required, desc, default ])
end
2019-09-20 09:56:11 +02:00
def self.RHOST(default=nil, required=true, desc="The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'")
Msf::OptAddressRange.new('RHOSTS', [ required, desc, default ], aliases: [ 'RHOST' ])
2015-04-03 23:28:45 -05:00
end
# @return [OptPort]
def self.RPORT(default=nil, required=true, desc="The target port")
Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
end
# @return [OptEnum]
def self.SSLVersion
Msf::OptEnum.new('SSLVersion',
2017-09-20 21:13:30 -05:00
'Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate)',
enums: Rex::Socket::SslTcp.supported_ssl_methods
2017-09-20 21:13:30 -05:00
)
end
def self.stager_retry_options
[
OptInt.new('StagerRetryCount',
'The number of times the stager should retry if the first connect fails',
default: 10,
aliases: ['ReverseConnectRetries']
),
OptInt.new('StagerRetryWait',
'Number of seconds to wait for the stager between reconnect attempts',
default: 5
)
]
end
def self.http_proxy_options
[
OptString.new('HttpProxyHost', 'An optional proxy server IP address or hostname',
aliases: ['PayloadProxyHost']
),
OptPort.new('HttpProxyPort', 'An optional proxy server port',
aliases: ['PayloadProxyPort']
),
OptString.new('HttpProxyUser', 'An optional proxy server username',
aliases: ['PayloadProxyUser']
),
OptString.new('HttpProxyPass', 'An optional proxy server password',
aliases: ['PayloadProxyPass']
),
OptEnum.new('HttpProxyType', 'The type of HTTP proxy',
enums: ['HTTP', 'SOCKS'],
aliases: ['PayloadProxyType']
)
]
end
def self.http_header_options
[
OptString.new('HttpHostHeader', 'An optional value to use for the Host HTTP header'),
OptString.new('HttpCookie', 'An optional value to use for the Cookie HTTP header'),
OptString.new('HttpReferer', 'An optional value to use for the Referer HTTP header')
]
end
2015-04-03 23:28:45 -05:00
CHOST = CHOST()
CPORT = CPORT()
LHOST = LHOST()
LPORT = LPORT()
Proxies = Proxies()
RHOST = RHOST()
2018-05-24 21:25:30 -05:00
RHOSTS = RHOSTS()
2015-04-03 23:28:45 -05:00
RPORT = RPORT()
SSLVersion = SSLVersion()
2015-04-03 23:28:45 -05:00
end
end