Module: Ronin::Exploits::Params::Port

Defined in:
lib/ronin/exploits/params/port.rb

Overview

Adds the required port param to the exploit.

Examples

include Params::Port

Setting the default port value:

include Params::Port

default_port 143

Since:

  • 1.0.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(exploit) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Adds the required port param to the exploit class including Ronin::Exploits::Params::Port.

Parameters:

Since:

  • 1.0.0



54
55
56
57
58
59
# File 'lib/ronin/exploits/params/port.rb', line 54

def self.included(exploit)
  exploit.include Metadata::DefaultPort
  exploit.param :port, Integer, required: true,
                                default:  -> { exploit.default_port },
                                desc:     'Remote port to connect to'
end

Instance Method Details

#portInteger

The port param.

Returns:

  • (Integer)

Since:

  • 1.0.0



66
67
68
# File 'lib/ronin/exploits/params/port.rb', line 66

def port
  params[:port]
end