CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/core/auxiliary/natpmp.rb
Views: 11784
1
# -*- coding: binary -*-
2
3
module Msf
4
5
###
6
#
7
# This module provides methods for working with NAT-PMP
8
#
9
###
10
module Auxiliary::NATPMP
11
12
include Auxiliary::Scanner
13
include Rex::Proto::NATPMP
14
15
def initialize(info = {})
16
super
17
register_options(
18
[
19
Opt::RPORT(Rex::Proto::NATPMP::DefaultPort),
20
Opt::CHOST,
21
OptInt.new('LIFETIME', [true, "Time in ms to keep this port forwarded (set to 0 to destroy a mapping)", 3600000]),
22
OptEnum.new('PROTOCOL', [true, "Protocol to forward", 'TCP', %w(TCP UDP)])
23
],
24
self.class
25
)
26
end
27
28
def lifetime
29
@lifetime ||= datastore['LIFETIME']
30
end
31
32
def protocol
33
@protocol ||= datastore['PROTOCOL']
34
end
35
end
36
end
37
38