Class: Msf::OptProxies

Inherits:
OptBase show all
Defined in:
lib/msf/core/opt_proxies.rb

Overview

Proxies option

Instance Attribute Summary

Attributes inherited from OptBase

#advanced, #aliases, #conditions, #default, #desc, #enums, #evasion, #fallbacks, #max_length, #name, #owner, #regex, #required

Instance Method Summary collapse

Methods inherited from OptBase

#advanced?, #display_value, #empty_required_value?, #evasion?, #initialize, #invalid_value_length?, #required?, #type?

Constructor Details

This class inherits a constructor from Msf::OptBase

Instance Method Details

#normalize(value) ⇒ Object



20
21
22
# File 'lib/msf/core/opt_proxies.rb', line 20

def normalize(value)
  value
end

#typeObject



12
13
14
# File 'lib/msf/core/opt_proxies.rb', line 12

def type
  'proxies'
end

#valid?(value, check_empty: true, datastore: nil) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
# File 'lib/msf/core/opt_proxies.rb', line 24

def valid?(value, check_empty: true, datastore: nil)
  return false if check_empty && empty_required_value?(value)

  begin
    Rex::Socket::Proxies.parse(value)
  rescue Rex::RuntimeError
    return false
  end

  true
end

#validate_on_assignment?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/msf/core/opt_proxies.rb', line 16

def validate_on_assignment?
  true
end