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_unsettrap_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 UNSETTRAP DRDoS Scanner',15'Description' => %q{16This module identifies NTP servers which permit mode 6 UNSETTRAP requests that17can be used to conduct DRDoS attacks. In some configurations, NTP servers will18respond to UNSETTRAP requests with multiple packets, allowing remote attackers19to cause a distributed, reflected denial of service (aka, "DRDoS" or traffic20amplification) via spoofed requests.21},22'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',23'References' =>24[25['CVE', '2013-5211'], # see also scanner/ntp/ntp_monlist.rb26['URL', 'https://github.com/rapid7/metasploit-framework/pull/3696'],27['URL', 'https://www.rapid7.com/blog/post/2014/08/25/r7-2014-12-more-amplification-vulnerabilities-in-ntp-allow-even-more-drdos-attacks/']28],29'DisclosureDate' => 'Aug 25 2014',30'License' => MSF_LICENSE31)32end3334# Called for each response packet35def scanner_process(data, shost, sport)36@results[shost] ||= []37@results[shost] << Rex::Proto::NTP::NTPControl.new.read(data)38end3940# Called before the scan block41def scanner_prescan(batch)42@results = {}43@probe = Rex::Proto::NTP::NTPControl.new44@probe.version = datastore['VERSION']45@probe.operation = 3146end4748# Called after the scan block49def scanner_postscan(batch)50@results.keys.each do |k|51response_map = { @probe => @results[k] }52# TODO: check to see if any of the responses are actually NTP before reporting53report_service(54:host => k,55:proto => 'udp',56:port => rport,57:name => 'ntp'58)5960peer = "#{k}:#{rport}"61vulnerable, proof = prove_amplification(response_map)62what = 'R7-2014-12 NTP Mode 6 UNSETTRAP DRDoS'63if vulnerable64print_good("#{peer} - Vulnerable to #{what}: #{proof}")65report_vuln({66:host => k,67:port => rport,68:proto => 'udp',69:name => what,70:refs => self.references71})72else73vprint_status("#{peer} - Not vulnerable to #{what}: #{proof}")74end75end76end77end787980