Module: Msf::Auxiliary::NTP

Includes:
Scanner, Exploit::Capture
Defined in:
lib/msf/core/auxiliary/ntp.rb

Overview

This module provides methods for working with NTP

Instance Attribute Summary

Attributes included from Exploit::Capture

#arp_cache, #arp_capture, #capture, #dst_cache

Instance Method Summary collapse

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!

Methods included from Exploit::Capture

#arp, #arp_packet, #capture_extract_ies, #capture_icmp_echo_pack, #capture_icmp_echo_unpack, #capture_sendto, #check_pcaprub_loaded, #close_pcap, #each_packet, #expire_arpcache, #get_interface_guid, #get_ipv4_addr, #get_ipv4_addr_count, #get_ipv4_broadcast, #get_ipv4_netmask, #get_ipv6_addr, #get_ipv6_addr_count, #get_ipv6_netmask, #get_mac, #inject, #inject_eth, #inject_pcap, #inject_reply, #is_interface?, #list_interfaces, #lookup_eth, #lookupnet, #netifaces_implemented?, #open_pcap, #probe_gateway, #rhost, #should_arp?, #stats_drop, #stats_ifdrop, #stats_recv

Instance Method Details

#initialize(info = {}) ⇒ Object

Initializes an instance of an auxiliary module that uses NTP


20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/msf/core/auxiliary/ntp.rb', line 20

def initialize(info = {})
  super
  register_options(
  [
    Opt::RPORT(123),
  ], self.class)

  register_advanced_options(
    [
      OptInt.new('VERSION', [true, 'Use this NTP version', 2]),
      OptInt.new('IMPLEMENTATION', [true, 'Use this NTP mode 7 implementation', 3])
    ], self.class)
end

#scan_host(ip) ⇒ Object

Called for each IP in the batch


35
36
37
38
39
40
41
42
# File 'lib/msf/core/auxiliary/ntp.rb', line 35

def scan_host(ip)
  if spoofed?
    datastore['ScannerRecvWindow'] = 0
    scanner_spoof_send(@probe, ip, datastore['RPORT'], datastore['SRCIP'], datastore['NUM_REQUESTS'])
  else
    scanner_send(@probe, ip, datastore['RPORT'])
  end
end