Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/msf/core/opt.rb
Views: 11780
# -*- coding: binary -*-1module Msf2#3# Builtin framework options with shortcut methods4#5# @example6# register_options(7# [8# Opt::RHOST,9# Opt::RPORT(21),10# ]11# )12# register_advanced_options([Opt::Proxies])13#14module Opt1516# @return [OptAddress]17def self.CHOST(default=nil, required=false, desc="The local client address")18Msf::OptAddress.new(__method__.to_s, [ required, desc, default ])19end2021# @return [OptPort]22def self.CPORT(default=nil, required=false, desc="The local client port")23Msf::OptPort.new(__method__.to_s, [ required, desc, default ])24end2526# @return [OptAddressLocal]27def self.LHOST(default=nil, required=true, desc="The listen address (an interface may be specified)")28Msf::OptAddressLocal.new(__method__.to_s, [ required, desc, default ])29end3031# @return [OptPort]32def self.LPORT(default=nil, required=true, desc="The listen port")33Msf::OptPort.new(__method__.to_s, [ required, desc, default ])34end3536# @return [OptString]37def self.Proxies(default=nil, required=false, desc="A proxy chain of format type:host:port[,type:host:port][...]")38Msf::OptString.new(__method__.to_s, [ required, desc, default ])39end4041# @return [OptRhosts]42def self.RHOSTS(default= nil, required=true, desc="The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html")43Msf::OptRhosts.new('RHOSTS', [ required, desc, default ], aliases: [ 'RHOST' ])44end4546def self.RHOST(default=nil, required=true, desc="The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html")47Msf::OptRhosts.new('RHOSTS', [ required, desc, default ], aliases: [ 'RHOST' ])48end4950# @return [OptPort]51def self.RPORT(default=nil, required=true, desc="The target port")52Msf::OptPort.new(__method__.to_s, [ required, desc, default ])53end5455# @return [OptEnum]56def self.SSLVersion57Msf::OptEnum.new('SSLVersion',58'Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate)',59enums: Rex::Socket::SslTcp.supported_ssl_methods60)61end6263def self.stager_retry_options64[65OptInt.new('StagerRetryCount',66'The number of times the stager should retry if the first connect fails',67default: 10,68aliases: ['ReverseConnectRetries']69),70OptInt.new('StagerRetryWait',71'Number of seconds to wait for the stager between reconnect attempts',72default: 573)74]75end7677def self.http_proxy_options78[79OptString.new('HttpProxyHost', 'An optional proxy server IP address or hostname',80aliases: ['PayloadProxyHost']81),82OptPort.new('HttpProxyPort', 'An optional proxy server port',83aliases: ['PayloadProxyPort']84),85OptString.new('HttpProxyUser', 'An optional proxy server username',86aliases: ['PayloadProxyUser'],87max_length: Rex::Payloads::Meterpreter::Config::PROXY_USER_SIZE - 188),89OptString.new('HttpProxyPass', 'An optional proxy server password',90aliases: ['PayloadProxyPass'],91max_length: Rex::Payloads::Meterpreter::Config::PROXY_PASS_SIZE - 192),93OptEnum.new('HttpProxyType', 'The type of HTTP proxy',94enums: ['HTTP', 'SOCKS'],95aliases: ['PayloadProxyType']96)97]98end99100def self.http_header_options101[102OptString.new('HttpHostHeader', 'An optional value to use for the Host HTTP header'),103OptString.new('HttpCookie', 'An optional value to use for the Cookie HTTP header'),104OptString.new('HttpReferer', 'An optional value to use for the Referer HTTP header')105]106end107108CHOST = CHOST()109CPORT = CPORT()110LHOST = LHOST()111LPORT = LPORT()112Proxies = Proxies()113RHOST = RHOST()114RHOSTS = RHOSTS()115RPORT = RPORT()116SSLVersion = SSLVersion()117end118end119120121