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::Constants

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

Instance Method Summary collapse

Methods included from Rex::Proto::NATPMP::Packet

#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, #fail_with, #has_check?, #has_fatal_errors?, #peer, #run, #scanner_handle_fatal_errors, #scanner_progress, #scanner_show_progress, #seppuko!

Instance Method Details

#initialize(info = {}) ⇒ Object



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

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



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

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

#protocolObject



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

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