Module: Msf::Auxiliary::NATPMP

Includes:
Scanner, Rex::Proto::NATPMP
Defined in:
lib/msf/core/auxiliary/natpmp.rb

Overview

This module provides methods for working with NAT-PMP

Constant Summary

Constants included from Rex::Proto::NATPMP

Rex::Proto::NATPMP::DefaultPort, Rex::Proto::NATPMP::TCP, Rex::Proto::NATPMP::UDP, Rex::Proto::NATPMP::Version

Instance Method Summary collapse

Methods included from Rex::Proto::NATPMP

#external_address_request, #get_external_address, #map_port, #map_port_request, #parse_external_address_response, #parse_map_port_response

Methods included from Scanner

#add_delay_jitter, #check, #has_check?, #has_fatal_errors?, #peer, #run, #scanner_handle_fatal_errors, #scanner_progress, #scanner_show_progress, #seppuko!

Instance Method Details

#initialize(info = {}) ⇒ Object


16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/msf/core/auxiliary/natpmp.rb', line 16

def initialize(info = {})
  super
  register_options(
    [
      Opt::RPORT(Rex::Proto::NATPMP::DefaultPort),
      Opt::CHOST,
      OptInt.new('LIFETIME', [true, "Time in ms to keep this port forwarded (set to 0 to destroy a mapping)", 3600000]),
      OptEnum.new('PROTOCOL', [true, "Protocol to forward", 'TCP', %w(TCP UDP)])
    ],
    self.class
  )
end

#lifetimeObject


29
30
31
# File 'lib/msf/core/auxiliary/natpmp.rb', line 29

def lifetime
  @lifetime ||= datastore['LIFETIME']
end

#protocolObject


33
34
35
# File 'lib/msf/core/auxiliary/natpmp.rb', line 33

def protocol
  @protocol ||= datastore['PROTOCOL']
end