Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/ntp/ntp_req_nonce_dos.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Exploit::Remote::Udp8include Msf::Auxiliary::UDPScanner9include Msf::Auxiliary::NTP10include Msf::Auxiliary::DRDoS1112def initialize13super(14'Name' => 'NTP Mode 6 REQ_NONCE DRDoS Scanner',15'Description' => %q{16This module identifies NTP servers which permit mode 6 REQ_NONCE requests that17can be used to conduct DRDoS attacks. In some configurations, NTP servers will18respond to REQ_NONCE requests with a response larger than the request,19allowing remote attackers to cause a distributed, reflected20denial of service (aka, "DRDoS" or traffic amplification) via spoofed21requests.22},23'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',24'References' =>25[26['CVE', '2013-5211'], # see also scanner/ntp/ntp_monlist.rb27['URL', 'https://github.com/rapid7/metasploit-framework/pull/3696'],28['URL', 'https://www.rapid7.com/blog/post/2014/08/25/r7-2014-12-more-amplification-vulnerabilities-in-ntp-allow-even-more-drdos-attacks/']29],30'DisclosureDate' => 'Aug 25 2014',31'License' => MSF_LICENSE32)33end3435# Called for each response packet36def scanner_process(data, shost, sport)37@results[shost] ||= []38@results[shost] << Rex::Proto::NTP::NTPControl.new.read(data)39end4041# Called before the scan block42def scanner_prescan(batch)43@results = {}44@probe = Rex::Proto::NTP::NTPControl.new45@probe.version = datastore['VERSION']46@probe.operation = 1247end4849# Called after the scan block50def scanner_postscan(batch)51@results.keys.each do |k|52response_map = { @probe => @results[k] }53# TODO: check to see if any of the responses are actually NTP before reporting54report_service(55:host => k,56:proto => 'udp',57:port => rport,58:name => 'ntp'59)6061peer = "#{k}:#{rport}"62vulnerable, proof = prove_amplification(response_map)63what = 'R7-2014-12 NTP Mode 6 REQ_NONCE DRDoS'64if vulnerable65print_good("#{peer} - Vulnerable to #{what}: #{proof}")66report_vuln({67:host => k,68:port => rport,69:proto => 'udp',70:name => what,71:refs => self.references72})73else74vprint_status("#{peer} - Not vulnerable to #{what}: #{proof}")75end76end77end78end798081