2014-08-22 17:49:28 +00:00
|
|
|
# -*- coding: binary -*-
|
|
|
|
require 'rex/proto/natpmp'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# This module provides methods for working with NAT-PMP
|
|
|
|
#
|
|
|
|
###
|
|
|
|
module Auxiliary::NATPMP
|
|
|
|
|
|
|
|
include Auxiliary::Scanner
|
2014-08-22 18:01:17 +00:00
|
|
|
include Rex::Proto::NATPMP
|
2014-08-22 17:49:28 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(Rex::Proto::NATPMP::DefaultPort),
|
2014-10-16 20:24:17 +00:00
|
|
|
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)])
|
2014-08-22 17:49:28 +00:00
|
|
|
],
|
|
|
|
self.class
|
|
|
|
)
|
|
|
|
end
|
2014-10-15 13:39:38 +00:00
|
|
|
|
|
|
|
def lifetime
|
|
|
|
@lifetime ||= datastore['LIFETIME']
|
|
|
|
end
|
|
|
|
|
|
|
|
def protocol
|
|
|
|
@protocol ||= datastore['PROTOCOL']
|
|
|
|
end
|
2014-08-22 17:49:28 +00:00
|
|
|
end
|
|
|
|
end
|