CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/core/auxiliary/ntp.rb
Views: 1904
1
# -*- coding: binary -*-
2
module Msf
3
4
###
5
#
6
# This module provides methods for working with NTP
7
#
8
###
9
module Auxiliary::NTP
10
11
include Exploit::Capture
12
include Auxiliary::Scanner
13
14
#
15
# Initializes an instance of an auxiliary module that uses NTP
16
#
17
18
def initialize(info = {})
19
super
20
register_options(
21
[
22
Opt::RPORT(123),
23
], self.class)
24
25
register_advanced_options(
26
[
27
OptInt.new('VERSION', [true, 'Use this NTP version', 2]),
28
OptInt.new('IMPLEMENTATION', [true, 'Use this NTP mode 7 implementation', 3])
29
], self.class)
30
end
31
32
# Called for each IP in the batch
33
def scan_host(ip)
34
if spoofed?
35
datastore['ScannerRecvWindow'] = 0
36
scanner_spoof_send(@probe, ip, datastore['RPORT'], datastore['SRCIP'], datastore['NUM_REQUESTS'])
37
else
38
scanner_send(@probe, ip, datastore['RPORT'])
39
end
40
end
41
end
42
end
43
44